A request came in last week to help automate the inventory of vSphere Virtual Machines (VMs) that have been configured with the Per-VM EVC (Enhanced vMotion Compatibility) capability.

It is important to understand that if a VM is not configured with Per-VM EVC, it will automatically inherit the configured EVC-mode from the vSphere Cluster. While there are several vSphere API properties that will give you information about the EVC details for a VM, the quickest way to check whether a VM has Per-VM EVC configured is by looking at the FeatureMask property.
Here is a quick PowerCLI snippet that demonstrates the use of this vSphere API:
$vms = Get-View -ViewType VirtualMachine -Property Name, Runtime
foreach ($vm in $vms) {
if($vm.Runtime.FeatureMask -ne $null -and $vm.name -notmatch "vCLS-") {
Write-Host "Per-VM EVC Enabled for $(${vm}.name)"
}
}
Here is an example output when running this script and you can adjust the output based on your needs including exporting it to CSV list/etc.





