VMware Cloud Community
BWinchell
Enthusiast
Enthusiast
Jump to solution

How to enable/disable the VM option Tools upgrade policy

  Hello,

This seems like a simple request but I cannot find the right syntax for it.  I am trying to create a workflow that will enable/disable the VM option to automatically check VMtools on next reboot.

I can check to see what it currently is but cannot figure out how to change it.

var currentopt = vm.config.tools.toolsUpgradePolicy;

System.log ("currentopt = " + currentopt);

Any assistance will be helpful.

Thanks

B

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
3 Replies
jpsider
Expert
Expert
Jump to solution

0 Kudos
dvatov
VMware Employee
VMware Employee
Jump to solution

I think that you should call vm.reconfigurevm_task (http://pubs.vmware.com/vsphere-60/topic/com.vmware.wssdk.apiref.doc/vim.VirtualMachine.html#reconfig...) and in the VirtualMachineConfigSpec provide the needed ToolsConfigInfo (http://pubs.vmware.com/vsphere-60/topic/com.vmware.wssdk.apiref.doc/vim.vm.ToolsConfigInfo.html)‌ You can check some of the library workflows how they assemble the VirtualMachineConfigSpec

0 Kudos
BWinchell
Enthusiast
Enthusiast
Jump to solution

Fixed a logical error in the code.

So I was missing the VcMachineConfigSpec before the VcToolsUpgradePolicy.

So here is the finished product.

Thanks

B

0 Kudos