This post is about upgrading multiple VMtools using powercli. I will start off with what is VMtools and why are they so important to be updated and looked after with love.
Overview of VMware Tools (With my Comments)
VMware Tools is a suite of utilities that enhances the performance of the virtual machines guest operating system and improves management of the virtual machine. Without VMware Tools installed in your guest operating system, guest performance lacks important functionality. Installing VMware Tools eliminates or improves these issues:
- Low video resolution (VDI estate)
- Inadequate color depth (vDI estate)
- Incorrect display of network speed (and a must if using VMXNet3)
- Restricted movement of the mouse (vDi estate)
- Inability to copy and paste and drag-and-drop files (same as above)
- Missing sound
- Provides the ability to take quiesced snapshots of the guest OS (Using Veeam or other backup products)
- Synchronizes the time in the guest operating system with the time on the host (NTP etc…)
VMware Tools includes these components:
- VMware Tools service
- VMware device drivers
- VMware user process
- VMware Tools control panel
Well thats explains why they’re so important and worth looking after them. Now lets get into the main post.
## Connect to vCenter Server
Connect-VIServer uk3p-vc01.lab.local, hdcp-vc01.lab.local
### Specify the list of VMs to Upgrade... You can use a CSV ...
$VMToUpgrade = "UK3P-WEB02","UK3P-WEB01","HDCP-WEB02","HDCP-WEB01"
### Update Tools Without a Reboot
Get-VM $VMToUpgrade | Where-Object {$_.ExtensionData.Guest.ToolsVersionStatus -eq 'guestToolsNeedUpgrade'`
-and $_.PowerState -eq "PoweredOn" } | Get-VMGuest | Where-Object {$_.GuestFamily -eq "windowsGuest"} | Update-Tools -NoReboot -RunAsync
### Update Tools with Reboot
Get-VM $VMToUpgrade | Where-Object {$_.ExtensionData.Guest.ToolsVersionStatus -eq 'guestToolsNeedUpgrade'`
-and $_.PowerState -eq "PoweredOn" } | Get-VMGuest | Where-Object {$_.GuestFamily -eq "windowsGuest"} | Update-Tools
### Check Tools Version After Upgrade
Get-VMGuest $VMToUpgrade | select HostName, State, OSFullName, ToolsVersion | ft -a
We can see the status is now upgraded to the latest both in PowerCLI and Web Client
The Manual Way
1. Log into the vSphere Client or vSphere Web Client. From the home screen, go to “VMs and Templates” and click on the folder containing your VMs.
2. In the vSphere Client, click on the “Virtual Machines” tab. For the vSphere Web Client, click on the “Related Objects” tab and then “Virtual Machines”.
3. In the middle pane (since you can’t do a multiple select in the left pane), click on one of the VMs you’d like to upgrade, hold Ctrl and then start clicking the other VMs.
4. Now right-click on one of the VMs, then “Guest” (“Guest OS” in the Web Client), and then Install/Upgrade VMware Tools.
5. Once the “Install/Upgrade VMware Tools” screen pops up, paste the following in the “Advanced Options” and click OK or Continue:
VM Version 9 or above (ESXi 5.1 or above version)
/S /v"/qn REBOOT=R"
VM Version 8 (ESXi 5.0)
/S /v"/qn REBOOT=ReallySuppress"
Go grab a coffee and come back to see VCenter will finish the upgrade process without rebooting the VMs. Or alternatively use update manager. I will cover in a later post. I hope this has been informative to you share the love.
## Connect to vCenter Server
Connect-VIServer uk3p-vc01.lab.local, hdcp-vc01.lab.local
### Specify the list of VMs to Upgrade... You can use a CSV ...
$VMToUpgrade = "UK3P-WEB02","UK3P-WEB01","HDCP-WEB02","HDCP-WEB01"
### Update Tools Without a Reboot
Get-VM $VMToUpgrade | Where-Object {$_.ExtensionData.Guest.ToolsVersionStatus -eq 'guestToolsNeedUpgrade'`
-and $_.PowerState -eq "PoweredOn" } | Get-VMGuest | Where-Object {$_.GuestFamily -eq "windowsGuest"} | Update-Tools -NoReboot -RunAsync
### Update Tools with Reboot
Get-VM $VMToUpgrade | Where-Object {$_.ExtensionData.Guest.ToolsVersionStatus -eq 'guestToolsNeedUpgrade'`
-and $_.PowerState -eq "PoweredOn" } | Get-VMGuest | Where-Object {$_.GuestFamily -eq "windowsGuest"} | Update-Tools
### Check Tools Version After Upgrade
Get-VMGuest $VMToUpgrade | select HostName, State, OSFullName, ToolsVersion | ft -a