help1bp
Contributor
Contributor

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

Jump to solution

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

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

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

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

0 Kudos
JamieGator32
Enthusiast
Enthusiast

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
0 Kudos