System Center Virtual Machine Manager
A family of System Center products that enable enterprise-wide management of virtual machines.
392 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello
What I need is the guest virtual machine running on Hyper-V to be able to use power management features including hibernation.
For S1-S4 power management in Hyper-V virtual machines, but encountering an error when enabling hibernate using "powercfg /h on," which says, "The system firmware does not support."
Hi,
Please try the following to see if it works.
Param (
[string]$VmName,
[bool]$Enable = $true
)
# To modify, machine must be off
$Vm = Get-VM -Name $VmName
$Vm | Stop-VM -Force -WarningAction Ignore
$wmiComputerSystem = gwmi -namespace root\virtualization\v2 -query "select * from Msvm_ComputerSystem where ElementName= '$VmName'"
$wmi_vsSettingData = $wmiComputerSystem.GetRelated("Msvm_VirtualSystemSettingData","Msvm_SettingsDefineState",$null,$null, "SettingData", "ManagedElement", $false, $null)
Write-Output ("Before: EnableHibernation = " + $wmi_vsSettingData.EnableHibernation)
# $wmi_vsSettingData.EnableHibernation = $Enable # Doesn't work - says The property 'EnableHibernation' cannot be found on this object
# So, need to munge XML ourselves
[xml]$vsSettingsDataXml = $wmi_vsSettingData.gettext(1)
$EnableHibernationNodes = $vsSettingsDataXml.SelectNodes("/INSTANCE/PROPERTY[@NAME='EnableHibernation']")
$EnableHibernationNodes[0].VALUE=$Enable.ToString()
$wmi_vsSettingDataMgmt = Get-WmiObject -Namespace "root\virtualization\v2" -Class Msvm_VirtualSystemManagementService
$job = $wmi_vsSettingDataMgmt.ModifySystemSettings($vsSettingsDataXml.OuterXml)