Get list of storage volumes authorized to particular host in SoftLayer

倾然丶 夕夏残阳落幕 提交于 2019-12-25 07:58:57

问题


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

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)

How can I access the storage volumes from this ID?

Thanks


回答1:


Add the following mask in your code allowedNetworkStorage

e.g:

id_mask = "mask[id, allowedNetworkStorage]"

It will display information for the storage objects that this Virtual Server has access to



来源:https://stackoverflow.com/questions/39299496/get-list-of-storage-volumes-authorized-to-particular-host-in-softlayer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!