Closed GoogleCodeExporter closed 8 years ago
[deleted comment]
Is there a way to get the ammount of vCPU's _and_, most imporantly, the current
ammount of SWAP being used on a host? When counting disk quota and expenses it
is IMO mandatory to count the SWAP+HDD when counting disk costs for each vhost.
So, is there any way to fetch the ammount of SWAP space being used?
Original comment by Anton.Do...@gmail.com
on 5 Dec 2011 at 1:22
[deleted comment]
***PATCH*** (Total Disk usage, internal Operating System disk)
Found a container which, didn't give specifics but it DID give me the disk
quotas i need to do my cost sheet.
prop.Name == 'storage' is the container but has very limited information, but
just what you need.
I'll attach a patch for:
C:\Python26\Lib\site-packages\pysphere-0.1.0-py2.6-win32.egg\pysphere\vi_virtual
_machine.py
I think i followed the code standard in this file, at least as well as i could.
Original comment by Anton.Do...@gmail.com
on 5 Dec 2011 at 2:12
Attachments:
currently in the trunk version you can do this
from pysphere import *
s = VIServer()
s.connect("hostname", "user", "password")
vm = s.get_vm_by_path("...vmx path...")
#num of cpus:
print vm.properties.config.hardware.numCPU
#to get swap data
pm = s.get_performance_manager()
stats = pm.get_entity_statistic(vm._mor, ['swapin', 'swapout', 'swapped'])
for stat in stats:
print stat.description
print stat.value
#to get a full list of the stats you can get for this vm object run
pm.get_entity_counters(vm._mor)
Original comment by argo...@gmail.com
on 5 Dec 2011 at 5:27
Regarding disk space utilization you can run:
from pysphere import *
s = VIServer()
s.connect("hostname", "user", "password")
vm = s.get_vm_by_path("...vmx path...")
print vm._disks
Original comment by argo...@gmail.com
on 5 Dec 2011 at 5:29
Original issue reported on code.google.com by
Anton.Do...@gmail.com
on 5 Dec 2011 at 8:36