Description
Using instance.CreateServer with a marketplace image like docker
, I get
Request:
{
"name": "instance-8c95edb7",
"dynamic_ip_required": false,
"commercial_type": "GP1-XS",
"image": "65763732-a8a0-4d0a-8490-4c4e3d4682e4",
"volumes": {
"0": {
"size": 15000000000,
"volume_type": "sbs_volume"
}
},
"project": "[redacted]",
"tags": []
}
Response
{
"message": "Cannot create a volume of type sbs_volume from a base of type l_ssd",
"type": "precondition_failed"
}
However, it works in the console:
Request
{
"name": "instance-8c95edb7",
"dynamic_ip_required": false,
"commercial_type": "GP1-XS",
"image": "docker",
"volumes": {
"0": {
"size": 15000000000,
"volume_type": "sbs_volume"
}
},
"project": "[redacted]",
"tags": []
}
Response: Success
It looks like this resolution is the culprit: https://github.com/scaleway/scaleway-sdk-go/blob/master/api/instance/v1/server_utils.go#L25-L36
This is not done by the UI, I guess the selection does not account for the volume type.
I guess the fix would be one of these:
- Let the backend do the resolution
- Update the image resolution code to select the right image