I'd like to check for VMs with out of date hardware versions (easy to do) and would prefer to pull the latest support version from the vCenter server instead of setting it manually. While we're in between v5.1 an v5.5 I want to the script to know automatically what to compare against. I could check the vcenter version against a hash table of vcenter and hardware version, but even that requires manual intervention to populate and maintain when the next version of vSphere comes out. I'm assuming it involves Get-View, but I don't know which object I should be looking in.
Anyone have an idea? Thanks!
So for the commands you could use:
$vc = connect-viserver xxxx
theire you get for example (5.5)
if you like more info about center then you could query instead of $vc.version
$instance = get-view serviceinstance
theire you have now more infos
and for vm for example you get like that
$vm = get-vm xxxxxx |get-view
if you like to have split "vmx-" then do $vm.config.version.split("vmx-")
with that you could easy create a short script where you make a loop against all vm's in the you're vCenter.
So and if 5.5 is the Version you have of you're vCenter you could easy filter vm's which are not matching the "10"
http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=200724... (good info for the version support and what is working ).
PS: i'am not quit sure if this info is hiddin somewhere in the API to query against the latest supported version. not quit sure.
but its important to query mainly the versions of ESX/i
because if you have vcenter 5.5 and Esxi is 5.1 then latest supportat vHW is based on the esxi version. So means now v9 maximum.