获取在SoftLayer中授权给特定主机的存储卷的列表 [英] Get list of storage volumes authorized to particular host in SoftLayer
本文介绍了获取在SoftLayer中授权给特定主机的存储卷的列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用/etc/hosts从运行的cluseter中确定所有IP.我可以通过以下方式获取虚拟机ID:
I'm using /etc/hosts to determine all IP's from my running cluseter. I can get the VM id's with
for node_ip in ip_list:
node_ip = ''.join(node_ip)
id_mask = "mask[id]"
vm_instance = SL.instance(sl_config).vm.list_instances(mask=id_mask,private_ip=node_ip)
print vm_instance
现在,我想使用VM ID来获取附加到它们的存储卷的列表.我正在使用Virtual_Guest,但还没有运气
Now, I'd like to use VM id's in order to get a list of the storage volumes attached to them. I am looking at using Virtual_Guest, but haven't had luck with
vm_guest = SL.instance(sl_config).vm_guest.findByIpAddress(id=node_ip)
如何从此ID访问存储卷?
How can I access the storage volumes from this ID?
谢谢
推荐答案
在代码中添加以下掩码 allowedNetworkStorage
Add the following mask in your code allowedNetworkStorage
例如:
id_mask = "mask[id, allowedNetworkStorage]"
它将显示此虚拟服务器有权访问的存储对象的信息
It will display information for the storage objects that this Virtual Server has access to
这篇关于获取在SoftLayer中授权给特定主机的存储卷的列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文