Welcome to MSDN Blogs Sign in | Join | Help

Gathering virtual machine uptime information from Virtual Server

Virtual Server 2005 R2 provides an interesting set of statistical information about virtual machines through the VMAccountant object.  Below is a simple script that will go through all virtual machines on a physical computer and display the information about how long they have been running as reported by their accountant objects:

Set vs = CreateObject("VirtualServer.Application")
set vms = vs.VirtualMachines

For Each vm in vms
        Wscript.Echo "Virtual machine: " & vm.Name
        Wscript.Echo "Uptime: " & vm.Accountant.Uptime
        Wscript.Echo
Next

Note that the uptime information is reported in seconds.

Cheers,
Ben

Published Thursday, April 06, 2006 6:28 PM by Virtual PC Guy

Comments

Thursday, April 13, 2006 4:55 PM by Carlos Pantoja

# re: Gathering virtual machine uptime information from Virtual Server

That's really great but better will be one function that returns the idle time of one Virtual Machine Guest. With this we can use Host resources even more efficiently. There's any way to accomplish that?
Thursday, April 13, 2006 5:07 PM by Carlos Pantoja

# re: Gathering virtual machine uptime information from Virtual Server

That's really great but better will be one function that returns the idle time of one Virtual Machine Guest. With this we can use Host resources even more efficiently. There's any way to accomplish that?

Thanks,
Thursday, April 20, 2006 1:08 PM by Virtual PC Guy

# re: Gathering virtual machine uptime information from Virtual Server

New Comments to this post are disabled
 
Page view tracker