VMware Cloud Community
help1bp
Contributor
Contributor
Jump to solution

PowerCli How to toggle Reserve all guest memory (All locked) setting

Does anyone know how to enable the setting in the screen capture? I have gotten as far as creating this script but can not locate the paramter to toggle the setting.

Get-VM -Name VMName | Get-VMResourceConfiguration | Set-VMResourceConfiguration

http://www.vmware.com/support/developer/PowerCLI/PowerCLI50/html/Set-VMResourceConfiguration.html

12-5-2012 10-38-10 AM.jpg

1 Solution

Accepted Solutions
RvdNieuwendijk
Leadership
Leadership
Jump to solution

To enable the "Reserve all guest memory (All locked)" setting you can use:

$spec = New-Object VMware.Vim.VirtualMachineConfigSpec
$spec.memoryReservationLockedToMax = $true
(Get-VM $VM).ExtensionData.ReconfigVM_Task($spec)

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

View solution in original post

3 Replies
RvdNieuwendijk
Leadership
Leadership
Jump to solution

To enable the "Reserve all guest memory (All locked)" setting you can use:

$spec = New-Object VMware.Vim.VirtualMachineConfigSpec
$spec.memoryReservationLockedToMax = $true
(Get-VM $VM).ExtensionData.ReconfigVM_Task($spec)

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

Thank you that did it. I was looking at the wrong command.

Reply
0 Kudos
JamieGator32
Enthusiast
Enthusiast
Jump to solution

Thanks for the script.  Worked like a charm.

James F Cruce VCP6.5-DCV Gainesville VMUG Leader http://vmug.com/gainesville @jamescruce http://astgl.com
Reply
0 Kudos