Cluster

EVC with PowerCLI 5.5 R2–Part 1

What is EVC?

Enhanced vMotion Compatibility (EVC) is a vSphere feature that you can enable on a specific cluster to maximize the vMotion compatibility of hosts within that cluster. EVC will make sure that all hosts in the cluster present the same CPU feature set to their virtual machines, even if the actual CPUs on the hosts differ. An EVC-enabled cluster can contain hosts with CPUs of different generations but only from a single CPU vendor.

What about performance?

EVC masks only those processor features that affect vMotion compatibility. Enabling EVC does not prevent a virtual machine from taking advantage of faster processor speeds, increased numbers of CPU cores, or hardware virtualization support that might be available on newer hosts.

What is “EVC mode”?

The EVC mode of a cluster reflects the minimum CPU generation that is supported by all hosts in that cluster.

Apart from its human readable name, each EVC mode also has a “key” that is used by the vSphere API as a unique identifier. PowerCLI uses the EVC key for all EVC-related operations. The set of available (supported) EVC modes depends on the particular vSphere Server version. For version 5.5 these are:

EVC modes for Intel CPUs

Intel Processor Family (Generation) EVC-Mode Key
Intel® “Merom” Generation intel-merom
Intel® “Penryn” Generation intel-penryn
Intel® “Nehalem” Generation intel-nehalem
Intel® “Westmere” Generation intel-westmere
Intel® “Sandy Bridge” Generation intel-sandybridge
Intel® “Ivy Bridge” Generation intel-ivybridge


EVC modes for AMD CPUs

Intel Processor Family (Generation) EVC-Mode Key
AMD Opteron™ Generation 1 amd-rev-e
AMD Opteron™ Generation 2 amd-rev-f
AMD Opteron™ Gen. 3 (no 3DNow!™) amd-greyhound-no3dnow
AMD Opteron™ Generation3 amd-greyhound
AMD Opteron™ Generation 4 amd-bulldozer
AMD Opteron™ “Piledriver” Generation amd-piledriver

The EVC modes in each of the above groups are sorted in ascending order. Each EVC mode for the same CPU vendor exposes all CPU features of the previous EVC mode plus any new features that are present in the newer CPU generation. EVC modes from different CPU vendors are not compatible and cannot be compared. You can retrieve all available EVC modes on a specific vSphere server using:

$viserver = Connect-VIServer MYVISERVER

$viServer.ExtensionData.Capability.SupportedEVCMode

Retrieving the EVC mode for clusters, hosts and VMs with PowerCLI

Cluster

You can retrieve the current EVC mode of a cluster using its EVCMode property.

Get-Cluster ‘MyCluster’ | select -Property Name,EVCMode

Host

Hosts always inherit their EVC mode from the cluster which they are part of. To retrieve the current EVC mode of a host you just have to read its cluster’s EVCMode property.

$vmhost = Get-VMHost MYVMHOST

$vmhost.Parent.EVCMode

Or

Get-Cluster -VMHost ‘MyVMHost’ | select -Property EVCMode

The maximum EVC capability of a host depends on its hardware capabilities, such as CPU vendor and CPU generation. Additionally, software settings in BIOS that disable specific CPU features may also affect the host’s EVC capability. You can determine the maximum EVC capability of a host using its MaxEVCMode property

$vmhost = Get-VMHost MYVMHOST

$vmhost.MaxEVCMode

Or

Get-VMHost ‘MyVMHost’ | select Name,MaxEvcMode

Virtual Machine

Virtual machines typically inherit their EVC mode from the host (and respectively the cluster) on which they are running. There are two exceptions to this. Both of them have impact on the vMotion compatibility of the VM. The first one is when the CPUID mask of the VM is set explicitly and it overrides the current EVC mode for that particular VM. Although possible, it is unlikely that you will use it in a vMotion related scenario, so you do not have to bother about it. The second one is when the cluster’s EVC mode was changed while the VM was running. In this case, the cluster switches to the newer EVC mode, but the VM preserves its old EVC mode until it is powered off and powered on again. If you need to find the actual EVC mode for a specific VM, you can use :

$view = Get-VM ‘MyVM’ | Get-View

$view.Summary.Runtime.MinRequiredEVCModeKey

Or

(Get-VM ‘MyVM’).Extensiondata.Summary.Runtime.MinRequiredEVCModeKey

Configuring EVC

Enable EVC on a newly created cluster

If you are building up a new cluster from scratch, the process is quite straight forward. You create the cluster, enable EVC mode, select compatible hosts and move them into the new cluster.

$cluster = New-Cluster -Name ‘MyCluster’ -Location ‘Datacenter’ -EVCMode ‘intel-westmere’

Get-VMHost ‘MyVMHost’ | Move-VMHost -Destination $cluster

The above example assumes that the host is not already part of another cluster. Otherwise, you will first have to move it out of the original cluster before adding it to the new one. This example also assumes that the selected host is compatible with the cluster’s EVC mode. In an upcoming post, I will show you how you can select hosts automatically with PowerCLI, using different compatibility checks.

Enable EVC on an existing cluster

To enable EVC on an existing cluster, you first have to make sure that hosts in the cluster support the desired EVC mode. If the cluster contains incompatible hosts, they will have to be moved out of the cluster to allow setting the particular EVC mode. Then you can use Set-Cluster to change the cluster’s EVC mode.

Set-Cluster ‘MyCluster’ -EVCMode ‘intel-westmere’

Disable EVC on a cluster

To disable EVC on a cluster, you set its EVC mode to $null.

Set-Cluster ‘ MyCluster’ -EVCMode $null

TodorThis post was created by Todor Tsvetkov…

Todor is a developer engineer in the PowerCLI team. He joined VMware and PowerCLI in late 2011 and has since taken active part in analyzing, architecting and developing various features of the product. His contribution to the latest PowerCLI release includes the Tagging and EVC functionality.

Like everyone in the PowerCLI team, he is dedicated on delivering a fully-functional, high-quality product. When not working on PowerCLI, he spends his time roller skating, playing the piano and practicing impro theater.