Now, i know that there are some examples in internet about this but they were not working for me for some reason(still don’t know why).
UpgradeVM_Task SDK ref
So in order to upgrade vmware hardware version you have to execute method called UpgradeVM_Task from virtual machine object.
(get-view -id $myvmid).UpgradeVM_Task(‘vmx-08’)
If you want to upgrade to version 7, then you have to use ‘vmx-07’. I am running this against vsphere 5 and it works very well. Now, reading manual it says:
Regarding the ‘Version’ parameter:
“If specified, upgrade to that specified version. If not specified, upgrade to the most current virtual hardware supported on the host.”
But if you will give $null or “” , or nothing, it will just not work. I hope i will get some more information why it behaves like this.
$vmview=get-view -id $id
$param = @($null)
This will run upgrade_VM_Task method without specifying the version string. It took me some time to figure this out 😉
ParameterType : System.String
Name : version
Position : 0
Attributes : None
Member : VMware.Vim.ManagedObjectReference UpgradeVM_Task(System.String) -> 1 parameter
the parameter should be an array of 1 null here
Invoke(System.Object obj, System.Object parameters)