【问题标题】:How to Launch a compute Instance with data disk in IBM cloud using softlayer Rest API如何使用 softlayer Rest API 在 IBM 云中使用数据磁盘启动计算实例
【发布时间】:2019-09-10 09:01:49
【问题描述】:

我需要使用 softlayer rest API 启动计算实例并创建卷,并且需要使用 globalIdentifier 启动。

https://api.softlayer.com/rest/v3/SoftLayer_Virtual_Guest.json

身体: { “参数”: [{ "complexType": "SoftLayer_Virtual_Guest", “最大内存”:4, “主机名”:“jagatest”, “最大CPU”:2, “域”:“test.local”, “hourlyBillingFlag”:真, “startCpus”:1, “blockDeviceTemplateGroup”:{ “全局标识符”:“375c7ad3-1b39-4c58-a657-7fc4351d7b06” }, “块设备”:[{ “设备”:“0”, “磁盘映像”:{ “容量”:25 } }, { “设备”:“2”, “磁盘映像”:{ “容量”:10 } } ], “localDiskFlag”:假, “数据中心”: { "complexType": "SoftLayer_Location", “名称”:“sjc01” } }] }

错误通过:

{"error":"为'blockDevices'提供的值无效。使用图像模板时可能未提供块设备。","code":"SoftLayer_Exception_InvalidValue"}

【问题讨论】:

    标签: rest api ibm-cloud ibm-cloud-infrastructure


    【解决方案1】:

    尝试关注下一个请求

    方法 POST

    https://api.softlayer.com/rest/v3/SoftLayer_Virtual_Guest/createObject.json

    身体

    {
      "parameters": [
        {
          "complexType": "SoftLayer_Virtual_Guest",
          "maxMemory": 4,
          "hostname": "jagatest",
          "maxCpu": 2,
          "domain": "test.local",
          "hourlyBillingFlag": true,
          "startCpus": 1,
          "blockDeviceTemplateGroup": {
            "globalIdentifier": "375c7ad3-1b39-4c58-a657-7fc4351d7b06"
          },
          "localDiskFlag": false,
          "datacenter": {
            "complexType": "SoftLayer_Location",
            "name": "sjc01"
          }
        }
      ]
    }
    

    【讨论】:

    • 感谢丹尼尔的回复。我需要添加两个带有 globalIdentifier 的数据盘。
    • 作为一种解决方法,首先配置 VSI,然后使用 VSI 中所需的所有磁盘进行更新。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-02-25
    • 2023-04-01
    • 2017-01-26
    • 1970-01-01
    相关资源
    最近更新 更多