Get list of storage volumes authorized to particul

2019-09-10 18:03发布

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条回答
Evening l夕情丶
2楼-- · 2019-09-10 18:42

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

查看更多
登录 后发表回答