Automate your VM Tools Upgrade Policy – Use Script to Upgrade VMware Tools

When we have Large VM environment then Automation is the Key and this time we will see how we automate your VM Tools upgrade policy? VMware Tools is very important component and we have to make it up to date and when we have huge environment then we don’t want to upgrade VMware tools automatically.

By default VMware Tools upgrade policy is disabled and its in manual mode, anytime we need make it automatic – Let me show you How to Automate your VM Tools Upgrade Policy?

Open vCenter and navigate to the VM Machine and click Edit VMOptionsVMware ToolsCheck and Upgrade Tools during Power Cycling.

Automate your VM Tools Upgrade Policy
Automate your VM Tools Upgrade Policy

To update this configuration, there is a property in the vSphere API called toolsUpgradePolicy which can accept two values: manual or upgradeAtPowerCycle.

Use Power CLI Script to Upgrade VMware Tools and make it Automated

get-cluster CLUSTER_NAME_HERE | get-vm VM_NAME_HERE_OR_REMOVE_FOR_ALL_VMS | where-object {

$_.guest.OSFullname -match “^Microsoft Windows*.”

} | foreach-object {

$vmConfigSpec = New-Object VMware.Vim.VirtualMachineConfigSpec

$vmConfigSpec.Tools = New-Object VMware.Vim.ToolsConfigInfo

$vmConfigSpec.Tools.ToolsUpgradePolicy = “UpgradeAtPowerCycle”

(Get-View $_.ID).ReconfigVM($vmConfigSpec)

}

with the Help of this Above Power CLI command you can make Upgrade VMware Tools and make it Automated.

0 responses on "Automate your VM Tools Upgrade Policy – Use Script to Upgrade VMware Tools"

Leave a Message

About AIK IT Support

Start Building Your Career with Solid Platform and its the time to Grab the Opportunity and Start Today

top
© AIK IT Support All rights reserved.