Updating Software in Virtual Machines
To keep software in your virtual machines up to date, you can use the same means you would use on standalone computers running the corresponding operating systems:
- In Linux-based virtual machines, you can use the native Linux updaters (
up2date,yum, oryast). - In Windows-based virtual machines, you can use the native Windows updaters (e.g., the Windows Update tool).
Updating the KVM/QEMU Hypervisor in Virtual Machines
Virtuozzo Server can update KVM/QEMU hypervisor live in running virtual machines that have KVM/QEMU version 2.6.0 or newer.
To do this, install the vz-qemu-engine-updater package and update the qemu-kvm-vz package:
| |
Updating qemu-kvm-vz starts a 10-minute timer to give yum time to complete the operation. After that the vz-qemu-engine-updater tool begins updating KVM/QEMU in each running virtual machine, one at a time.
Immediate updating may not be possible in several cases:
yumis currently locked on the node (in this case, no VMs can be updated automatically until the lock is released).- A VM is changing states (e.g., from
runningtostopped). - Configuration changes are being applied to a VM.
- A backup of a VM is being created.
- Any other
prlctloperation is executed on a VM.
The KVM/QEMU updater will skip such VMs and queue them for a later update. The updater will perform a set number of retries to update VMs that have been skipped, each retry after a set delay. If retries are exhausted or the update fails for some reason, the virtual machine is left running with the outdated KVM/QEMU.
To manually disable automatic updates, mask the updater service:
| |
To re-enable updates, unmask the updater service:
| |
To check if virtual machines have been successfully updated, view the log file:
| |
To configure the number of retries, the delay between them, and other parameters, refer to the vz-qemu-engine-updater.json man page and edit the /var/lib/vz-qemu-engine-updater.json configuration file.
Updating the KVM/QEMU Hypervisor Manually
If, for some reason, the KVM/QEMU hypervisor was not automatically updated in a running VM, you can do it manually as follows:
Make sure that the VM uses an outdated version of the hypervisor.
Check the version installed on the node:
1 2# rpm -qa qemu-kvm-vz qemu-kvm-vz-<version>.x86_64And compare it with the version the VM currently uses:
1 2# virsh qemu-monitor-command <VM_name> '{"execute":"query-version"}' <...>"package":" (qemu-kvm-vz-<version>)"}<...>Make sure no
prlctloperations are being executed on the VM.Update the hypervisor that the VM uses:
1# prlctl update-qemu <VM_name>
Updating Virtuozzo Guest Tools in Virtual Machines
Starting from Virtuozzo Server 7.0.4 (Update 4), Virtuozzo guest tools in virtual machines are updated automatically via a weekly cron job that starts the vz-guest-tools-updater tool.
The following requirements must be met:
- The
vz-guest-tools-updaterpackage must be installed on the node. - The virtual machine must have the
--tools-autoupdateparameter set toon(this is the default behavior).
The first automatic installation of Virtuozzo guest tools to a running SUSE Linux Enterprise Server/Desktop 15 SP6 virtual machine with the vz-guest-tools-updater tool requires stopping the VM. If you prefer the first-time installation of the guest tools without downtime, install them manually from our system ISO after ensuring the previously mounted ISO is ejected. Use the following CLI command:
| |
Otherwise, via Virtuozzo Automator, go to the Configure tab and select Install Guest Tools.
With the Virtuozzo guest tools set up, the subsequent run of vz-guest-tools-updater for the running VM will update the guest tools online (without downtime) to the latest version.
InstallTools parameter to false in the /etc/vz/tools-update.conf configuration file.The vz-guest-tools-updater tool builds a list of VMs with the enabled --tools-autoupdate parameter and outdated guest tools. After that, a 5-minute timer triggers simultaneous guest tools update in a configurable number of VMs. If an update attempt fails, the tool will queue that VM for another try. If the second attempt fails, the VM’s guest tools will be left outdated.
Windows virtual machines need to be restarted to complete the update of guest tools. On every such update, administrators inside these VMs receive a reboot notification upon login or immediately if they are logged in.
You can configure the number of VMs whose guest tools are to be updated simultaneously by changing the value of the MaxVMs parameter in the /etc/vz/tools-update.conf configuration file.
To check the update status of guest tools in one or more VMs, use the --get-state option for the vz-guest-tools-updater tool and specify VM names in a sequence. For example:
| |
If the guest tools in the given virtual machine are up to date, the command output will be as follows:
| |
To disable automatic updating of Virtuozzo guest tools for a VM, run the following command:
| |
To manually update guest tools in one or more VMs, start the vz-guest-tools-updater script by specifying VM names in a sequence. For example:
| |
vz-guest-tools-updater starts updating the guest tools in MaxVMs random VMs.