How Can We Help?
Find allowed HW versions
The importance of using the correct HW version for your VMs is documented in many KBs.
But which HW versions can you use in your environment?
It seems there is no enumeration available listing all the valid HW versions. But we can use the a REST API call to query the vCenter.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
$vcName = 'vcsa.fqdn' $hwService = 'com.vmware.vcenter.vm.hardware' try{ Connect-CisServer -Server $vcName -ErrorAction Stop } catch{ throw "Connection to the $vcName vSphere Automation SDK server failed." } $hw = Get-CisService | where{$_.Name -eq $hwService} $validHWVersion = $hw.Help.upgrade.version.Element.CreateExample().Split(':')[1].TrimEnd('.').Replace(' ','').Split(',') Disconnect-CisServer -Server $vcName -Confirm:$false |
In the array $validHWVersion you will now have the permitted HW versions for your environment.
On a side note, use the HardwareVersion parameter on the Set-VM cmdlet to configure the HW version for a VM. The Version parameter is deprecated.
1 |
Get-VM -Name MyVM | Set-VM -HardwareVersion vmx-17 |