rboyle23
Contributor
Contributor

Memory Resource Allocation - Unlimited option

Jump to solution

Looking for some assistance with a script that will run against all vm's and show where the unlimited option is checked/not checked for memory resource allocation.  Any help is appreciated.

Thanks,

0 Kudos
1 Solution

Accepted Solutions
RvdNieuwendijk
Leadership
Leadership

You can get a list of virtual machines and the memory resource allocation setting with:

Get-VM | `
Get-VMResourceConfiguration | `
Select-Object @{N="Name";E={(Get-View $_.vmid).name}},MemLimitMB

If the MemLimitMB value is -1 it means unlimited.

Regards, Robert

Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition

View solution in original post

0 Kudos
2 Replies
RvdNieuwendijk
Leadership
Leadership

You can get a list of virtual machines and the memory resource allocation setting with:

Get-VM | `
Get-VMResourceConfiguration | `
Select-Object @{N="Name";E={(Get-View $_.vmid).name}},MemLimitMB

If the MemLimitMB value is -1 it means unlimited.

Regards, Robert

Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition
0 Kudos
LucD
Leadership
Leadership

That information can be retrieved with the Get-VMResourceConfiguration cmdlet.

Something like this

get-vm | Get-VMResourceConfiguration | `
  select VM,@{N="MemLimit(MB)";E={if($_.MemLimitMB -eq -1){"Unlimited"}else{$_.MemLimitMB}}}


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

0 Kudos