I am trying to find the setting to use to put my Windows VMs Power Management on Standby Mode (instead of default "Suspend"). Please see attached image. I am looking for the parameters/properties that control and manage the settings shown on the image to use in my PowerCLI script. Specifically, what new object I need to create to take care of this. Any help highly appreciated.
Thanks very much.
</krish>
Try like this
$vm = Get-VM -Name $vmName
$spec = New-Object VMware.Vim.VirtualMachineConfigSpec
$spec.PowerOpInfo = New-Object VMware.Vim.VirtualMachineDefaultPowerOpInfo
$spec.PowerOpInfo.StandbyAction = 'checkpoint'
$vm.ExtensionData.ReconfigVM($spec)
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Moderator: Moved to PowerCLI
This is the 2nd thread of yours that I’ve moved to the PowerCLI area.
Try like this
$vm = Get-VM -Name $vmName
$spec = New-Object VMware.Vim.VirtualMachineConfigSpec
$spec.PowerOpInfo = New-Object VMware.Vim.VirtualMachineDefaultPowerOpInfo
$spec.PowerOpInfo.StandbyAction = 'checkpoint'
$vm.ExtensionData.ReconfigVM($spec)
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks LucD. That was exactly the setting I was looking for.
I tried it and it worked correctly. Much appreciated
Sincerely,
Krish.