Tech: Inspecting Virtual Server 2005 virtual hard disks

Ben Armstrong published a nice script to verify at host level how large Microsoft Virtual Server 2005 virtual disks are and how much space they already took:

‘Connect to Virtual Server
Set virtualServer = CreateObject(“VirtualServer.Application”)

‘Create a VHD object with the .VHD file specified on the command line
Set aVirtualHardDisk = virtualServer.GetHardDisk(WScript.Arguments(0))

GuestSize = clng(cdbl(aVirtualHardDisk.SizeInGuest) / 1048576)
HostSize = clng(cdbl(aVirtualHardDisk.SizeOnHost) / 1048576)

‘Display information about the disk size
wscript.echo “The virtual hard disk, ” & WScript.Arguments(0) & ” is “&_
GuestSize & ” MB to the virtual machine. It is using ” & _
HostSize & ” MB space on the host operating system”

Be sure to check the original post for updates and comments.