【发布时间】:2016-03-17 01:43:35
【问题描述】:
如何继续通过 API 将存储块持久性附加和分离到虚拟机。
【问题讨论】:
如何继续通过 API 将存储块持久性附加和分离到虚拟机。
【问题讨论】:
要授权/允许主机到Network Storage(即耐力),请执行:
网址:
https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Network_Storage/[Storage_id]/allowAccessFromHostList
方法:POST
Json 有效负载:
{
"parameters": [
[
{
"id": 1234567,
"objectType": "SoftLayer_Virtual_Guest"
}
]
]
}
其中:1234567 是 Virtual Server Instance
以上请求用于授权“耐力”和“性能”。
如果要授权 “Virtual Guest”,“IpAddress” or “Hardware”,“objectType” 的有效值为:
“SoftLayer_Virtual_Guest “,”SoftLayer_Network_Subnet_IpAddress”, ”SoftLayer_Hardware”。
参考: SoftLayer_Network_Storage::allowAccessFromHostList
注意: “网络存储”和VSI/Bar Metal/Subnet必须位于同一位置/数据中心。
这些请求帮助我们获得可用主机可以被授权给特定的“network storage”,正如我们在门户中看到的那样:
要获得有效的可用虚拟客人,请执行:
https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Network_Storage/[storage_id]/getAllowableVirtualGuests?objectMask=mask[id,fullyQualifiedDomainName]
Method: GET
参考:SoftLayer_Network_Storage::getAllowableVirtualGuests
可用的金属条:
https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Network_Storage/[storage_id]/getAllowableHardware
Method: GET
参考:SoftLayer_Network_Storage::getAllowableHardware
要获取有效的可用具有关联 IP 地址的子网,请执行:
https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Network_Storage/[storage_id]/ getAllowableSubnets?objectMask=mask[id,networkIdentifier,cidr,subnetType,ipAddresses[id,ipAddress]]
Method: GET
【讨论】:
订购存储设备后,您必须按照以下步骤操作:
授权要访问存储的主机
将存储安装到您的主机
通过API,您只能从VSI或裸机服务器授权主机,以便该服务器具有挂载耐力块存储的权限,但必须手动挂载。
要通过 API 授权块存储,您可以使用以下方法: http://sldn.softlayer.com/reference/services/SoftLayer_Network_Storage/allowAccessFromHostList http://sldn.softlayer.com/reference/services/SoftLayer_Virtual_Guest/allowAccessToNetworkStorage http://sldn.softlayer.com/reference/services/SoftLayer_Hardware_Server/allowAccessToNetworkStorage
要挂载存储,请参阅以下文档: https://knowledgelayer.softlayer.com/procedure/accessing-block-storage-linux https://knowledgelayer.softlayer.com/procedure/accessing-block-storage-microsoft-windows https://knowledgelayer.softlayer.com/procedure/accessing-file-storage-linux https://knowledgelayer.softlayer.com/content/ordering-and-configuring-endurance-and-performance-block-storage-vmwaresoftlayer https://knowledgelayer.softlayer.com/procedure/endurance-provisioning
问候
【讨论】: