使用1TB HDD配置虚拟服务器

时间:2015-11-28 06:11:56

标签: ibm-cloud-infrastructure

我需要通过API配置服务器配置 内存:16GB, 操作系统:Centos5.6四核64位, HDD:1TB

我使用过的API请求       https://api.softlayer.com/rest/v3/SoftLayer_Virtual_Guest/createObject.json

请求发布数据:

{"parameters":[{"hostname":"jmblw","domain":"micron.com","startCpus":4,"maxMemory":16,"blockDevices":[{"device":0,"diskImage":{"capacity":100}},{"device":2,"diskImage":{"capacity":1000}}],"hourlyBillingFlag":true,"localDiskFlag":true,"operatingSystemReferenceCode":"CENTOS_5_64","datacenter":{"name":"sng01"}}]}

回应:

{
"error": "Unable to find a price for block device 2.",
"code": "SoftLayer_Exception_NotFound"
}

您能否告诉我如何设置具有HDD 1 TB的服务器。请将请求正文发布数据的结构发送给我

1 个答案:

答案 0 :(得分:0)

SAN磁盘的配置容量为1TB(对于第二个磁盘),但“本地”磁盘的最大容量为300GB。如果我们将“localDiskFlag”:true更改为“false”,则该请求应该有效。

请尝试以下方法:

https://[usename]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Virtual_Guest/createObject.json

方法:POST

JSON:

{
  "parameters": [
    {
      "hostname": "jmblw",
      "domain": "micron.com",
      "startCpus": 4,
      "maxMemory": 16,
      "blockDevices": [
        {
          "device": 0,
          "diskImage": {
            "capacity": 100
          }
        },
        {
          "device": 2,
          "diskImage": {
            "capacity": 1000
          }
        }
      ],
      "hourlyBillingFlag": true,
      "localDiskFlag": false,
      "operatingSystemReferenceCode": "CENTOS_5_64",
      "datacenter": {
        "name": "sng01"
      }
    }
  ]
}