thank you for your great job.
I am trying to gather usage statistics for a number of vSphere 4.1 hosts I manage. I have the free version, so I have no vCenter.
s.get_resource_pools() # this is what I obtain: {'ha-root-pool': '/Resources', 'pool1': '/Resources/CSNDC', 'pool0': '/Resources/COMMON', 'pool2': '/Resources/IMDATE'}
File "C:\Users\Andrea\Documents\Development\VMWare Py Utilities\testVM.py", line 11, in <module>
s.get_resource_pools(('ha-root-pool', 'ClusterComputeResource'))
File "C:\Python26\lib\site-packages\pysphere-0.1.6-py2.6.egg\pysphere\vi_server.py", line 196, in get_resource_pools
obj_type=MORTypes.ResourcePool)
File "C:\Python26\lib\site-packages\pysphere-0.1.6-py2.6.egg\pysphere\vi_server.py", line 624, in _retrieve_properties_traversal
return request_call(request)
File "C:\Python26\lib\site-packages\pysphere-0.1.6-py2.6.egg\pysphere\vi_server.py", line 640, in call_retrieve_properties_ex
request)._returnval
File "C:\Python26\lib\site-packages\pysphere-0.1.6-py2.6.egg\pysphere\resources\VimService_services.py", line 118, in RetrievePropertiesEx
response = self.binding.Receive(RetrievePropertiesExResponseMsg.typecode)
File "C:\Python26\lib\site-packages\pysphere-0.1.6-py2.6.egg\pysphere\ZSI\client.py", line 544, in Receive
self.ReceiveSOAP(**kw)
File "C:\Python26\lib\site-packages\pysphere-0.1.6-py2.6.egg\pysphere\ZSI\client.py", line 427, in ReceiveSOAP
if not self.IsSOAP():
File "C:\Python26\lib\site-packages\pysphere-0.1.6-py2.6.egg\pysphere\ZSI\client.py", line 419, in IsSOAP
self.ReceiveRaw()
File "C:\Python26\lib\site-packages\pysphere-0.1.6-py2.6.egg\pysphere\ZSI\client.py", line 386, in ReceiveRaw
response = self.local.h.getresponse()
File "C:\Python26\lib\httplib.py", line 990, in getresponse
response.begin()
File "C:\Python26\lib\httplib.py", line 391, in begin
version, status, reason = self._read_status()
File "C:\Python26\lib\httplib.py", line 355, in _read_status
raise BadStatusLine(line)
httplib.BadStatusLine
This interrupts the connection to all connected VSphere client. I suspect this is a bug in the VMWare API's..
I found no other way to query statistics for the VM the various server are hosting. I am trying to obtain the host-cpu and gust mem usage (the same I can see in the vSphere client tab).