Custom Search

Tuesday, May 22, 2012

vmware psphere find compute resource

from psphere.client import Client
from psphere.managedobjects import ComputeResource

client = Client("192.168.0.144", "root", "xxxxx")#ESXi node's IP

compute_res_list = ComputeResource.all(client)

print "=====cr_list=====", cr_list

for compute_res in compute_res_list:
    print "Compute Resource Name: ", compute_res.name



OUTPUT
=======

=====cr_list===== [psphere.managedobjects.ComputeResource object at 0xbc4f750>]

Compute Resource Name: localhost.



Note:
We can also find ComputeResource of vClient

No comments:

Post a Comment