Error when enabling EVC mode

When you try to enable EVC on a cluster-level it could happens, that you get an error saying VMs cause problems enabling EVC on a host. Error when enable EVC mode is like:

The host cannot be admitted to the cluster's current Enhanced vMotion Compatibility mode. Powered-on or suspended virtual machines on the host may be using CPU features hidden by that mode.

One reason could be, to use Hardware virtualization feature in a VM.

evc_vm_error

To find these VMs quickly, you can run the following PowerCLI command:

Get-VM | Where-Object {$_.ExtensionData.config.nestedhvenabled -eq $true}

If there are any VMs, having this feature enabled, you have to disable it to be able to enable EVC mode. To disable the feature, VMs has to be powered down. You can use this small script to disable the feature.

$spec = New-Object VMware.Vim.VirtualMachineConfigSpec
$spec.nestedHVEnabled = $false
foreach ($vm in (Get-VM | Where-Object {$_.ExtensionData.config.nestedhvenabled -eq $true -and $_.PowerState -eq "PoweredOff"} )) {
    $vm.ExtensionData.ReconfigVM($spec)
}

Notes

Another reason for this error you can find here.

Leave a Reply

Your email address will not be published. Required fields are marked *