ganapa2000
Enthusiast
Enthusiast

How To get the CPU, Memory and HDD Size from Power Off VMs ?

How To get the CPU, Memory and HDD Size from Power Off VMs ?

Thanks

Madhu

0 Kudos
9 Replies
LucD
Leadership
Leadership

What do you mean by 'HDD Size'?

The name and size of the partitions inside the guest OS?

Or the size of the VMDK attached to the VM?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
ganapa2000
Enthusiast
Enthusiast

Hi LucD,

I am looking for following feilds

FolderNameIP AddressVM PowerStateOSCPUMemory (GB)Capacity(GB)UsedSpace(GB)FreeSpace(GB)FreeSpace(%)

I am able to get the details of Powered On VMs but I would like to get the details of Powered Off VMs as well.

Please help.

0 Kudos
LucD
Leadership
Leadership

Not too sure what you attached there?

That code does produce information for all VMs, independent of their powerstate.

Or are you looking for a complete new script to get the info you listed?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
ganapa2000
Enthusiast
Enthusiast

Hi LucD,

I have attached the current script, which I am using. It works fine for VMs which are Powered On but for Powered Off VMs, I am unable to get the HDD (Capacity) as it shows blank (zero)

Need you help, if attached script can be tweaked to get the details of Powered Off VMs or a new script.

0 Kudos
LucD
Leadership
Leadership

When the VM is powered off for a longer time, that information, which is obtained through the VMware Tools, is not available.

No solution for VMs that are powered off for a longer time I'm afraid.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
ganapa2000
Enthusiast
Enthusiast

Hi LucD,

I am able to get the HDD Capacity of Powered Off VMs using

get-vm | Select Name,NumCpu,MemoryGB,UsedSpaceGB

But How do I get this added to my script, use above code only if the VMs are Powered Off else continue to current code

0 Kudos
LucD
Leadership
Leadership

Those are 2 different measurements, the one under Guest is measured inside the guest OS, the one you just mentioned is measured from outside the guest OS.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
ganapa2000
Enthusiast
Enthusiast

For Powered Off, I am good with measured from outside the guest OS

0 Kudos
LucD
Leadership
Leadership

Try the attached script.

When the VM is powered off, instead of the individual guest OS partitions, you will see 'All' in MountPoint column.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos