📜 ⬆️ ⬇️

6 ways to keep VM Tools up to date

When it comes to maintaining the latest versions of VM Tools (a set of utilities to increase the performance of virtual machines), there are 6 different ways that vSphere administrators can use. These methods provide optimization for automation, standardization and segregation of duties.



VMware status depends on host


Recall that each ESXi host provides storage for VM Tools installers, which is a configurable option and explicitly refers to / productLocker symlink. A target can be either local to each node, or it can point to a centralized VM Tools repository in a shared data repository.
image
VM Tools status for each individual virtual machine is always in the context of the base host. As shown below, two different versions of Tools can be considered relevant, since the base hosts are not identical.


image

When an event occurs on a specific virtual machine, for example, the inclusion of vMotion, the VM Tools version running on the guest OS is compared with the version on the main ESXi host. If a newer version is used on the host, then the version of the virtual machine is considered obsolete.
image
Please note that there is no mechanism for virtual machines running on vSphere to contact the mother ship and find out if there are newer versions of VM Tools - only the relationship between the virtual machine and the host matters in this case. This may explain why VMs may suddenly complain about outdated VM Tools after migrating from one host to another — the destination host may have newer versions.



VM Tools type determines the choice of update method


There are three types of VM Tools - its own for each supported operating system, plus two additional offers in the form of binary packages for Linux. There are several ways to initiate a VM Tools update from vSphere or from a guest OS. The methods proposed below are applicable only for guest Windows or Linux using ISO VM Tools, except for the separately noted cases. VM Tools for Linux packages — OVT and OSP — are not managed through vSphere, so they can be installed and updated only within each guest OS using native management tools.


')

1. Automatic update when loading VM


The easiest way to constantly maintain new versions of VM Tools is to check the box and forget about this element of the infrastructure. After the virtual machine restarts, for example, after installing the guest OS patches, the state of the virtual machine tools will be checked and updates will be installed if necessary. In many cases, this will cause an additional reboot after the VM Tools installation is complete.


image
Such an approach may be applicable for less important loads, possibly for infrastructures designed for testing or development. Imagine a situation where the VM unexpectedly restarts due to a large-scale shutdown of the infrastructure. After an emergency launch and when launching applications, administrators may encounter unexpected subsequent reboots if new versions of VM Tools are found available for download. This is an extreme case, but still worth keeping it in mind.

2. Upgrading one or more VMs using the vSphere interface


In the vSphere Web Client , when the VM indicates that VM Tools is out of date, a button may appear to automatically initiate updates. This can be done interactively or in fully automatic mode. In the latter case, administrators also have the ability to suppress any possible reboots on Windows virtual machines - this is a good option to coordinate the restart time in accordance with the planned OS restart.


Important note for guest OSs other than Windows and Linux: VM Tools on Solaris, FreeBSD, and Mac OS VMs can only be updated using the manual interactive method. There are currently no automatic updates for these guests.
Going further, you can also select several virtual machines in the web client interface and initiate VM Tools update for all VMs at once.
image

3. VMware Update Manager: Immediate or scheduled update, and update on download.


VMware Update Manager (VUM) plays two very important roles when it comes to updating VM tools. The first role is to extract the updated VM Tools from the ISO in the form that is necessary for a normal ESXi stream patch. This patch is then sent to all managed hosts in accordance with the baseline set by the administrators. As soon as this happens, individual virtual machines will start checking for a new version of VM Tools and will have the right to upgrade.


image

The second role of VUM in managing VM Tools is to track updates for individual VMs in accordance with the source data. Keep in mind that VUM does this work using the vSphere methods described in the two preceding paragraphs. In one mode, VUM can be used to massively change the configuration of several virtual machines so that VM Tools updates are checked and downloaded if necessary every time the guest OS is restarted, as the administrator does in step 1. The advantage of using VUM is that several virtual machines can be configured and reconfigured at a time.


image
Other VUM modes are designed to launch VM Tools updates both immediately and at scheduled times, as well as the administrator can do this manually (see clause 2). One additional advantage of using VUM to initiate these updates is the ability to restore disabled or suspended virtual machines, subsequently returning them to their original state after the update.

4. Guest Update - Delegating Management to Application Owners


In those cases where application owners require tight control over everything that happens in the guest OS, it is possible to allow VM Tools updates inside the guest OS. The tray icon in Windows will indicate that an update is available, and the VM Tools configuration dialog box allows you to interactively start the update at a convenient time.


image

For a similar functionality using the command line, vmware-toolbox-cmd is offered for Linux and Windows guest OS. Keep in mind that in the case of Linux this applies only to ISO VM Tools, whereas for OVT and OSP, another method is used, as described in clause 6.



5. Bulk update using PowerCLI automation


In very large environments or for those used for more mature production processes, PowerCLI is a powerful tool for upgrading VM Tools. This approach can be used for specific groups of virtual machines in many convenient ways, such as clustering, tags, or using other vSphere attributes.


image

6. Native Linux package management processes


By nature, Linux guest OSs using OSP or OVT update VM Tools as part of a wider repair and update process used for other components. This allows administrators to use existing batch managers in Linux or more flexible management and monitoring solutions without the consent of the vSphere administrators.



Instead of conclusion


With these flexible ways to update VM Tools, you can find the right method for each VMware datacenter, regardless of what the requirements are: centralized control, automation, delegation to application owners, or integration with existing patch management processes.

Source: https://habr.com/ru/post/303332/


All Articles