SoftLayer 对象存储 API:创建 250GB/500GB 块存储失败。 20GB 或 1000GB 都可以
SoftLayer Object Storage API: Creation of 250GB/500GB Block Storage failure. 20GB or 1000GB are OK
我正在部署 CloudFoundry 并在内部调用 SoftLayer API 来创建 250GB iSCSI 磁盘但导致如下错误。
类似的方法,创建500GB磁盘出错,但是创建20GB或1000GB成功。
是 SoftLayer API 问题还是我的环境更改了一些价目表?
{"method":"create_disk","arguments":[250000,{},"29211213"],"context":{"director_uuid":"c789ac25-4e92-419c-4b9e-a95d0927a8ec"}}
********************
[json] 2017/03/08 22:36:43 DEBUG - Deserialized request
********************
{create_disk [250000 map[] 29211213]}
********************
---
[softlayer-go] Request:
GET /rest/v3/SoftLayer_Virtual_Guest/29211213/getObject.json?objectMask=accountId;createDate;dedicatedAccountHostOnlyFlag;domain;fullyQualifiedDomainName;hostname;hourlyBillingFlag;id;lastPowerStateId;lastVerifiedDate;maxCpu;maxCpuUnits;maxMemory;metricPollDate;modifyDate;notes;postInstallScriptUri;privateNetworkOnlyFlag;startCpus;statusId;uuid;userData.value;localDiskFlag;globalIdentifier;managedResourceFlag;primaryBackendIpAddress;primaryIpAddress;location.name;location.longName;location.id;datacenter.name;datacenter.longName;datacenter.id;networkComponents.maxSpeed;operatingSystem.passwords.password;operatingSystem.passwords.username;blockDeviceTemplateGroup.globalIdentifier;primaryNetworkComponent.networkVlan.id;primaryBackendNetworkComponent.networkVlan.id HTTP/1.1
Host: api.softlayer.com
[softlayer-go] Response:
HTTP/1.1 200 OK
Connection: close
Content-Length: 1680
Content-Type: application/json
Date: Thu, 09 Mar 2017 04:36:44 GMT
Server: Apache
Vary: Accept-Encoding
X-Frame-Options: SAMEORIGIN
{"accountId":604909,"createDate":"2017-03-08T22:31:35-06:00","dedicatedAccountHostOnlyFlag":false,"domain":"softlayer.com","fullyQualifiedDomainName":"director-dysa-ca-east.softlayer.com","hostname":"director-dysa-ca-east","id":29211213,"lastPowerStateId":null,"lastVerifiedDate":null,"maxCpu":4,"maxCpuUnits":"CORE","maxMemory":8192,"metricPollDate":null,"modifyDate":"2017-03-08T22:35:18-06:00","startCpus":4,"statusId":1001,"uuid":"5373b553-16a9-9834-9433-538e4f99bc5d","blockDeviceTemplateGroup":{"globalIdentifier":"99120edd-f394-438a-bb8f-f0b777967edd"},"datacenter":{"id":448994,"longName":"Toronto 1","name":"tor01"},"globalIdentifier":"8ec68b88-8593-4c14-a031-52b2f308076c","hourlyBillingFlag":true,"localDiskFlag":true,"location":{"id":1209443,"name":"04"},"managedResourceFlag":false,"networkComponents":[{"maxSpeed":1000},{"maxSpeed":1000}],"operatingSystem":{"hardwareId":null,"id":14845517,"manufacturerLicenseInstance":"","passwords":[{"password":"******","username":"root"}],"softwareLicense":{"id":1932,"softwareDescriptionId":1342,"softwareDescription":{"controlPanel":0,"id":1342,"licenseTermValue":null,"longDescription":"Ubuntu 14.04-64 Minimal for VSI","manufacturer":"Ubuntu","name":"Ubuntu","operatingSystem":1,"referenceCode":"UBUNTU_14_64","upgradeSoftwareDescriptionId":null,"upgradeSwDescId":null,"version":"14.04-64 Minimal for VSI","virtualLicense":0,"virtualizationPlatform":0,"requiredUser":"root"}}},"primaryBackendIpAddress":"10.166.221.170","primaryBackendNetworkComponent":{"networkVlan":{"id":1466879}},"primaryIpAddress":"169.55.185.149","primaryNetworkComponent":{"networkVlan":{"id":1466873}},"privateNetworkOnlyFlag":false,"userData":[]}
[SoftLayerDiskCreator] 2017/03/08 22:36:44 DEBUG - Creating disk of size '250000'
---
[softlayer-go] Request:
GET /rest/v3/SoftLayer_Product_Package/222/getItemPrices.json?objectFilter={"itemPrices":{"item":{"keyName":{"operation":"250_GB_PERFORMANCE_STORAGE_SPACE"}}}}&objectMask=filteredMask[id;locationGroupId;item.id;item.keyName;item.units;item.description;item.capacity] HTTP/1.1
Host: api.softlayer.com
[softlayer-go] Response:
HTTP/1.1 200 OK
Connection: close
Content-Length: 1165
Content-Type: application/json
Date: Thu, 09 Mar 2017 04:36:44 GMT
Server: Apache
Softlayer-Total-Items: 7
Vary: Accept-Encoding
X-Frame-Options: SAMEORIGIN
[{"id":82419,"locationGroupId":509,"item":{"capacity":"250","description":"250 GB Storage Space","id":5138,"keyName":"250_GB_PERFORMANCE_STORAGE_SPACE","units":"GB"}},{"id":82413,"locationGroupId":503,"item":{"capacity":"250","description":"250 GB Storage Space","id":5138,"keyName":"250_GB_PERFORMANCE_STORAGE_SPACE","units":"GB"}},{"id":82415,"locationGroupId":505,"item":{"capacity":"250","description":"250 GB Storage Space","id":5138,"keyName":"250_GB_PERFORMANCE_STORAGE_SPACE","units":"GB"}},{"id":154295,"locationGroupId":583,"item":{"capacity":"250","description":"250 GB Storage Space","id":5138,"keyName":"250_GB_PERFORMANCE_STORAGE_SPACE","units":"GB"}},{"id":40728,"locationGroupId":null,"item":{"capacity":"250","description":"250 GB Storage Space","id":5138,"keyName":"250_GB_PERFORMANCE_STORAGE_SPACE","units":"GB"}},{"id":82417,"locationGroupId":507,"item":{"capacity":"250","description":"250 GB Storage Space","id":5138,"keyName":"250_GB_PERFORMANCE_STORAGE_SPACE","units":"GB"}},{"id":82421,"locationGroupId":545,"item":{"capacity":"250","description":"250 GB Storage Space","id":5138,"keyName":"250_GB_PERFORMANCE_STORAGE_SPACE","units":"GB"}}]
---
[softlayer-go] Request:
GET /rest/v3/SoftLayer_Product_Package/222/getItemPrices.json?objectFilter={"itemPrices":{"attributes":{"value":{"operation":250}},"categories":{"categoryCode":{"operation":"performance_storage_iops"}}}}&objectMask=filteredMask[id;locationGroupId;item.id;item.keyName;item.units;item.description;item.capacity] HTTP/1.1
Host: api.softlayer.com
[softlayer-go] Response:
HTTP/1.1 200 OK
Connection: close
Content-Length: 2
Content-Type: application/json
Date: Thu, 09 Mar 2017 04:36:44 GMT
Server: Apache
Softlayer-Total-Items: 0
Vary: Accept-Encoding
X-Frame-Options: SAMEORIGIN
[]
[json] 2017/03/08 22:36:46 DEBUG - CloudError response bytes
********************
{"result":null,"error":{"type":"Bosh::Clouds::CloudError","message":"Creating disk of size '250000': Create SoftLayer iSCSI disk error.: No proper performance storage (iSCSI volume)for size 250","ok_to_retry":false},"log":""}
********************
简短的回答是,如果您想继续使用相同的过滤器,则需要在此请求中使用 1000 而不是 250 或 500:
Request:
GET /rest/v3/SoftLayer_Product_Package/222/getItemPrices.json?objectFilter={"itemPrices":{"attributes":{"value":{"operation":250}},"categories":{"categoryCode":{"operation":"performance_storage_iops"}}}}&objectMask=filteredMask[id;locationGroupId;item.id;item.keyName;item.units;item.description;item.capacity] HTTP/1.1
Host: api.softlayer.com
长话短说,您将无法使用 softlayer 的过滤器获取这些值,您将需要使用自己的代码来过滤这些值,这是因为 IOPS 价格对存储容量有限制,例如
rest/v3/SoftLayer_Product_Package/222/getItemPrices.json?objectMask=filteredMask[attributes,capacityRestrictionMaximum,capacityRestrictionMinimum,id,locationGroupId,item[id,keyName,units,description,capacity]]
{
"id": 41522,
"locationGroupId": null,
"attributes": [
{
"id": 11860,
"itemPriceAttributeTypeId": 21,
"itemPriceId": 41522,
"value": "100",
"itemPriceAttributeType": {
"id": 21,
"keyname": "CAPACITY_RESTRICTION_MIN"
}
},
{
"id": 11862,
"itemPriceAttributeTypeId": 22,
"itemPriceId": 41522,
"value": "1000",
"itemPriceAttributeType": {
"id": 22,
"keyname": "CAPACITY_RESTRICTION_MAX"
}
},
{
"id": 11864,
"itemPriceAttributeTypeId": 24,
"itemPriceId": 41522,
"value": "STORAGE_SPACE"
}
],
在上面的结果中,您可以看到值 CAPACITY_RESTRICTION_MAX
和
CAPACITY_RESTRICTION_MIN
这些值表示价格适用于 100 GB 到 1000 GB 的存储,因此此价格适用于 250 GB 和 500 GB 的存储。您正在使用的过滤器正在过滤这些值,在这种情况下,您必须更改过滤器以验证您的存储(在本例中为 250GB)是否在此值范围内,但使用 Softlayer 的过滤器无法完成,因为要过滤的值是字符串而不是单个整数,例如:
"value": "100"
所以您需要将该值解析为整数,然后验证它是否在范围内(使用 Softlayer 的过滤器是不可能的)。
您当前的过滤器适用于其他值的原因是因为 CAPACITY_RESTRICTION_MAX
和 CAPACITY_RESTRICTION_MIN
具有相同的值,例如
"id": 40792,
"locationGroupId": null,
"attributes": [
{
"id": 9670,
"itemPriceAttributeTypeId": 21,
"itemPriceId": 40792,
"value": "20",
"itemPriceAttributeType": {
"id": 21,
"keyname": "CAPACITY_RESTRICTION_MIN"
}
},
{
"id": 9672,
"itemPriceAttributeTypeId": 22,
"itemPriceId": 40792,
"value": "20",
"itemPriceAttributeType": {
"id": 22,
"keyname": "CAPACITY_RESTRICTION_MAX"
}
},
{
"id": 9674,
"itemPriceAttributeTypeId": 24,
"itemPriceId": 40792,
"value": "STORAGE_SPACE"
}
],
此致
我正在部署 CloudFoundry 并在内部调用 SoftLayer API 来创建 250GB iSCSI 磁盘但导致如下错误。
类似的方法,创建500GB磁盘出错,但是创建20GB或1000GB成功。
是 SoftLayer API 问题还是我的环境更改了一些价目表?
{"method":"create_disk","arguments":[250000,{},"29211213"],"context":{"director_uuid":"c789ac25-4e92-419c-4b9e-a95d0927a8ec"}}
********************
[json] 2017/03/08 22:36:43 DEBUG - Deserialized request
********************
{create_disk [250000 map[] 29211213]}
********************
---
[softlayer-go] Request:
GET /rest/v3/SoftLayer_Virtual_Guest/29211213/getObject.json?objectMask=accountId;createDate;dedicatedAccountHostOnlyFlag;domain;fullyQualifiedDomainName;hostname;hourlyBillingFlag;id;lastPowerStateId;lastVerifiedDate;maxCpu;maxCpuUnits;maxMemory;metricPollDate;modifyDate;notes;postInstallScriptUri;privateNetworkOnlyFlag;startCpus;statusId;uuid;userData.value;localDiskFlag;globalIdentifier;managedResourceFlag;primaryBackendIpAddress;primaryIpAddress;location.name;location.longName;location.id;datacenter.name;datacenter.longName;datacenter.id;networkComponents.maxSpeed;operatingSystem.passwords.password;operatingSystem.passwords.username;blockDeviceTemplateGroup.globalIdentifier;primaryNetworkComponent.networkVlan.id;primaryBackendNetworkComponent.networkVlan.id HTTP/1.1
Host: api.softlayer.com
[softlayer-go] Response:
HTTP/1.1 200 OK
Connection: close
Content-Length: 1680
Content-Type: application/json
Date: Thu, 09 Mar 2017 04:36:44 GMT
Server: Apache
Vary: Accept-Encoding
X-Frame-Options: SAMEORIGIN
{"accountId":604909,"createDate":"2017-03-08T22:31:35-06:00","dedicatedAccountHostOnlyFlag":false,"domain":"softlayer.com","fullyQualifiedDomainName":"director-dysa-ca-east.softlayer.com","hostname":"director-dysa-ca-east","id":29211213,"lastPowerStateId":null,"lastVerifiedDate":null,"maxCpu":4,"maxCpuUnits":"CORE","maxMemory":8192,"metricPollDate":null,"modifyDate":"2017-03-08T22:35:18-06:00","startCpus":4,"statusId":1001,"uuid":"5373b553-16a9-9834-9433-538e4f99bc5d","blockDeviceTemplateGroup":{"globalIdentifier":"99120edd-f394-438a-bb8f-f0b777967edd"},"datacenter":{"id":448994,"longName":"Toronto 1","name":"tor01"},"globalIdentifier":"8ec68b88-8593-4c14-a031-52b2f308076c","hourlyBillingFlag":true,"localDiskFlag":true,"location":{"id":1209443,"name":"04"},"managedResourceFlag":false,"networkComponents":[{"maxSpeed":1000},{"maxSpeed":1000}],"operatingSystem":{"hardwareId":null,"id":14845517,"manufacturerLicenseInstance":"","passwords":[{"password":"******","username":"root"}],"softwareLicense":{"id":1932,"softwareDescriptionId":1342,"softwareDescription":{"controlPanel":0,"id":1342,"licenseTermValue":null,"longDescription":"Ubuntu 14.04-64 Minimal for VSI","manufacturer":"Ubuntu","name":"Ubuntu","operatingSystem":1,"referenceCode":"UBUNTU_14_64","upgradeSoftwareDescriptionId":null,"upgradeSwDescId":null,"version":"14.04-64 Minimal for VSI","virtualLicense":0,"virtualizationPlatform":0,"requiredUser":"root"}}},"primaryBackendIpAddress":"10.166.221.170","primaryBackendNetworkComponent":{"networkVlan":{"id":1466879}},"primaryIpAddress":"169.55.185.149","primaryNetworkComponent":{"networkVlan":{"id":1466873}},"privateNetworkOnlyFlag":false,"userData":[]}
[SoftLayerDiskCreator] 2017/03/08 22:36:44 DEBUG - Creating disk of size '250000'
---
[softlayer-go] Request:
GET /rest/v3/SoftLayer_Product_Package/222/getItemPrices.json?objectFilter={"itemPrices":{"item":{"keyName":{"operation":"250_GB_PERFORMANCE_STORAGE_SPACE"}}}}&objectMask=filteredMask[id;locationGroupId;item.id;item.keyName;item.units;item.description;item.capacity] HTTP/1.1
Host: api.softlayer.com
[softlayer-go] Response:
HTTP/1.1 200 OK
Connection: close
Content-Length: 1165
Content-Type: application/json
Date: Thu, 09 Mar 2017 04:36:44 GMT
Server: Apache
Softlayer-Total-Items: 7
Vary: Accept-Encoding
X-Frame-Options: SAMEORIGIN
[{"id":82419,"locationGroupId":509,"item":{"capacity":"250","description":"250 GB Storage Space","id":5138,"keyName":"250_GB_PERFORMANCE_STORAGE_SPACE","units":"GB"}},{"id":82413,"locationGroupId":503,"item":{"capacity":"250","description":"250 GB Storage Space","id":5138,"keyName":"250_GB_PERFORMANCE_STORAGE_SPACE","units":"GB"}},{"id":82415,"locationGroupId":505,"item":{"capacity":"250","description":"250 GB Storage Space","id":5138,"keyName":"250_GB_PERFORMANCE_STORAGE_SPACE","units":"GB"}},{"id":154295,"locationGroupId":583,"item":{"capacity":"250","description":"250 GB Storage Space","id":5138,"keyName":"250_GB_PERFORMANCE_STORAGE_SPACE","units":"GB"}},{"id":40728,"locationGroupId":null,"item":{"capacity":"250","description":"250 GB Storage Space","id":5138,"keyName":"250_GB_PERFORMANCE_STORAGE_SPACE","units":"GB"}},{"id":82417,"locationGroupId":507,"item":{"capacity":"250","description":"250 GB Storage Space","id":5138,"keyName":"250_GB_PERFORMANCE_STORAGE_SPACE","units":"GB"}},{"id":82421,"locationGroupId":545,"item":{"capacity":"250","description":"250 GB Storage Space","id":5138,"keyName":"250_GB_PERFORMANCE_STORAGE_SPACE","units":"GB"}}]
---
[softlayer-go] Request:
GET /rest/v3/SoftLayer_Product_Package/222/getItemPrices.json?objectFilter={"itemPrices":{"attributes":{"value":{"operation":250}},"categories":{"categoryCode":{"operation":"performance_storage_iops"}}}}&objectMask=filteredMask[id;locationGroupId;item.id;item.keyName;item.units;item.description;item.capacity] HTTP/1.1
Host: api.softlayer.com
[softlayer-go] Response:
HTTP/1.1 200 OK
Connection: close
Content-Length: 2
Content-Type: application/json
Date: Thu, 09 Mar 2017 04:36:44 GMT
Server: Apache
Softlayer-Total-Items: 0
Vary: Accept-Encoding
X-Frame-Options: SAMEORIGIN
[]
[json] 2017/03/08 22:36:46 DEBUG - CloudError response bytes
********************
{"result":null,"error":{"type":"Bosh::Clouds::CloudError","message":"Creating disk of size '250000': Create SoftLayer iSCSI disk error.: No proper performance storage (iSCSI volume)for size 250","ok_to_retry":false},"log":""}
********************
简短的回答是,如果您想继续使用相同的过滤器,则需要在此请求中使用 1000 而不是 250 或 500:
Request:
GET /rest/v3/SoftLayer_Product_Package/222/getItemPrices.json?objectFilter={"itemPrices":{"attributes":{"value":{"operation":250}},"categories":{"categoryCode":{"operation":"performance_storage_iops"}}}}&objectMask=filteredMask[id;locationGroupId;item.id;item.keyName;item.units;item.description;item.capacity] HTTP/1.1
Host: api.softlayer.com
长话短说,您将无法使用 softlayer 的过滤器获取这些值,您将需要使用自己的代码来过滤这些值,这是因为 IOPS 价格对存储容量有限制,例如
rest/v3/SoftLayer_Product_Package/222/getItemPrices.json?objectMask=filteredMask[attributes,capacityRestrictionMaximum,capacityRestrictionMinimum,id,locationGroupId,item[id,keyName,units,description,capacity]]
{
"id": 41522,
"locationGroupId": null,
"attributes": [
{
"id": 11860,
"itemPriceAttributeTypeId": 21,
"itemPriceId": 41522,
"value": "100",
"itemPriceAttributeType": {
"id": 21,
"keyname": "CAPACITY_RESTRICTION_MIN"
}
},
{
"id": 11862,
"itemPriceAttributeTypeId": 22,
"itemPriceId": 41522,
"value": "1000",
"itemPriceAttributeType": {
"id": 22,
"keyname": "CAPACITY_RESTRICTION_MAX"
}
},
{
"id": 11864,
"itemPriceAttributeTypeId": 24,
"itemPriceId": 41522,
"value": "STORAGE_SPACE"
}
],
在上面的结果中,您可以看到值 CAPACITY_RESTRICTION_MAX
和
CAPACITY_RESTRICTION_MIN
这些值表示价格适用于 100 GB 到 1000 GB 的存储,因此此价格适用于 250 GB 和 500 GB 的存储。您正在使用的过滤器正在过滤这些值,在这种情况下,您必须更改过滤器以验证您的存储(在本例中为 250GB)是否在此值范围内,但使用 Softlayer 的过滤器无法完成,因为要过滤的值是字符串而不是单个整数,例如:
"value": "100"
所以您需要将该值解析为整数,然后验证它是否在范围内(使用 Softlayer 的过滤器是不可能的)。
您当前的过滤器适用于其他值的原因是因为 CAPACITY_RESTRICTION_MAX
和 CAPACITY_RESTRICTION_MIN
具有相同的值,例如
"id": 40792,
"locationGroupId": null,
"attributes": [
{
"id": 9670,
"itemPriceAttributeTypeId": 21,
"itemPriceId": 40792,
"value": "20",
"itemPriceAttributeType": {
"id": 21,
"keyname": "CAPACITY_RESTRICTION_MIN"
}
},
{
"id": 9672,
"itemPriceAttributeTypeId": 22,
"itemPriceId": 40792,
"value": "20",
"itemPriceAttributeType": {
"id": 22,
"keyname": "CAPACITY_RESTRICTION_MAX"
}
},
{
"id": 9674,
"itemPriceAttributeTypeId": 24,
"itemPriceId": 40792,
"value": "STORAGE_SPACE"
}
],
此致