hi,
i am trying to create a workflow that automatically upgrade vmtools + vm hardwrae version for a specific virtual machine.
the vmtools upgrade process is working perfectly without any issues, i can list a predefined array of virtual machines with status "tools required updates" and then update them.
unfortunately, i cannot find anything related to predefined condition of virtual machine hardware version (vmx-11,vmx-10 etc..) ,
my goal is to make a query which check the virtual machine current vm version and compare that to the host (esxi) most compatible vm version available.
how can i create this workflow?
Hi,
Here is sample code that prints the current vm version and all versions supported by the host (input parameter is variable vm of type VC:VirtualMachine)
System.log("VM version: " + vm.vmVersion);
System.log("Versions supported by the VM's host:");
var opts = vm.environmentBrowser.queryConfigOptionDescriptor();
for each (var opt in opts) {
for each (var host in opt.host) {
if (host.id == vm.runtime.host.id) {
System.log(" " + opt.key);
break;
}
}
}
Hi,
Here is sample code that prints the current vm version and all versions supported by the host (input parameter is variable vm of type VC:VirtualMachine)
System.log("VM version: " + vm.vmVersion);
System.log("Versions supported by the VM's host:");
var opts = vm.environmentBrowser.queryConfigOptionDescriptor();
for each (var opt in opts) {
for each (var host in opt.host) {
if (host.id == vm.runtime.host.id) {
System.log(" " + opt.key);
break;
}
}
}
thank you! works as expected.