首页 文章

SoftLayer API:基于VSI flavor的订单是否支持指定image_id

提问于
浏览
0

我们希望使用flavor(例如 . Balanced type)以编程方式对VSI进行排序,但是不使用标准的os_code,而是希望从公共图像模板(即CentOS7-ChangeStable)创建VSI . 从以下文档中可以看出它是可能的 .

http://softlayer-python.readthedocs.io/en/latest/_modules/SoftLayer/managers/vs.html

但是我试过但是得到了以下错误:

SoftLayer.exceptions.SoftLayerAPIError: SoftLayerAPIError(SoftLayer_Exception_InvalidValue): Invalid value provided for 'blockDevices'. Block devices may not be provided when using an image template.

使用slcli失败也有不同的错误:

# slcli vs create --hostname testvsi --domain vmonic.local --flavor BL2_4X8X100 --image 1cc8be72-f230-4ab9-b4b2-329c3e747853 --datacenter tok02 --private
This action will incur charges on your account. Continue? [y/N]: y
SoftLayerAPIError(SoftLayer_Exception_Public): Order is missing the following category: Operating System.

请告知SL API / python API是否支持使用带有“flavor”的“image_id” . 谢谢!

1 回答

  • 1

    这是API的一个问题,python客户端使用http://sldn.softlayer.com/reference/services/softlayer_virtual_guest/createObject方法使用RESTFul创建VSI,同样的请求将是这样的:

    POST: https://$USERNAME:@APIKEY@api.softlayer.com/rest/v3.1/SoftLayer_Virtual_Guest/createObject
    
    Payload:
    {
        "parameters": [{
            "datacenter": {
                "name": "tok02"
            },
            "domain": "softlayer.local",
            "hourlyBillingFlag": true,
    
            "blockDeviceTemplateGroup": {
                "globalIdentifier": "1cc8be72-f230-4ab9-b4b2-329c3e747853"
            },
            "hostname": "rcabflav",
            "privateNetworkOnlyFlag": true,
            "supplementalCreateObjectOptions": {
                "flavorKeyName": "BL2_4X8X100"
            }
        }]
    }
    

    并且你会得到同样的错误,我在Softlayer中报告了这个错误,如果你想要你可以在softlayer中提交一张票并报告它 .

相关问题