VMware Cloud Community
bansne
Enthusiast
Enthusiast
Jump to solution

How to get VM settings details using power cli?

Hi,

I went through link http://communities.vmware.com/thread/325036?tstart=0 whcih was very helpful. However i want to know is there anyway i can get VM details?

I want Hardware ,Option tab and resource tab details of VM which we see in VM --> Edit settings.

My main concern is to get memory details of VM . There are multiple VMs in my infrstructure on which memory is limited to less amout then what is actually given to the VM.

Like for example in one of the VM we had issue where after troubleshooting i found out the memory assigned on hardware tab is 16GB whereas on resource tab it was limited to 8GB , which caused driver to lock the memory to have other tools use them.

Regards

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Don't you get the version number ?


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

View solution in original post

0 Kudos
11 Replies
LucD
Leadership
Leadership
Jump to solution

Thread moved to the PowerCLI community.

The following will list all your VMs and show  their name, HW memory allocation and the resource allocatyion memory limit.

If that last property shows -1 that means there is no limit.

Get-VM | 
Select Name,MemoryGB,
@
{n="Resource Limit";E={Get-VMResourceConfiguration -VM $_ | Select -ExpandProperty MemLimitGB}}


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

bansne
Enthusiast
Enthusiast
Jump to solution

Surprisingly it only displayed VM names memory states Smiley Sad

Please excuse any typos!

Sent from my iPhone

0 Kudos
LucD
Leadership
Leadership
Jump to solution

It seesm to be working for me. Which PowerCLI version are you runnning ? Do a

Get-PowerCLIVersion


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

0 Kudos
bansne
Enthusiast
Enthusiast
Jump to solution

PowerCLI C:\Scripts> Get-PowerCLIVersion

PowerCLI Version

0 Kudos
LucD
Leadership
Leadership
Jump to solution

Don't you get the version number ?


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

0 Kudos
bansne
Enthusiast
Enthusiast
Jump to solution

Note sure why it was not updating from my phone.Please find below version detials.

PowerCLI C:\Scripts> Get-PowerCLIVersion

PowerCLI Version
----------------
   VMware vSphere PowerCLI 5.0.1 build 581491
---------------
Snapin Versions
---------------
   VMware AutoDeploy PowerCLI Component 5.0 build 544967
   VMware ImageBuilder PowerCLI Component 5.0 build 544967
   VMware License PowerCLI Component 5.0 build 544881
   VMware vSphere PowerCLI Component 5.0 build 581435

0 Kudos
LucD
Leadership
Leadership
Jump to solution

Sorry but I only see the header, no version numbers


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

0 Kudos
bansne
Enthusiast
Enthusiast
Jump to solution

i have edit my reply above version is:    VMware vSphere PowerCLI 5.0.1 build 581491

0 Kudos
LucD
Leadership
Leadership
Jump to solution

The current version is PowerCLI 5.1 R2, perhaps you should consider an upgrade ?


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

bansne
Enthusiast
Enthusiast
Jump to solution

Thanks LucD Let me try with that too..will update you

0 Kudos
bansne
Enthusiast
Enthusiast
Jump to solution

Hi LucD,

Sorry for comming late on this! I had updated cli to version 5.1 r2 and ran the script given by you. It's worked just perfect I got the output I was looking for. Thank you so much for you help! Looking forward for more interesting scripts Smiley Happy

regards!

0 Kudos