Skip to content

Wrong marketplace image selection #2603

@aslafy-z

Description

@aslafy-z

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinginstanceInstance issues, bugs and feature requestspriority:highestBugs filled by customers, security issues

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions