Updating Automatically
Starting from version 7.5, newly deployed Virtuozzo Server nodes are configured to get updates automatically by default. Automatic updating requires a valid license to be installed. Manual updating remains possible and does not depend on license status.
Note the following, however:
- Automatic updating is not enabled for nodes upgraded from older versions of Virtuozzo Server. You can enable automatic updates for them as explained in Enabling Automatic Updates for Upgraded Nodes.
- Automatic updating is disabled for Virtuozzo Storage clusters. For more information, see Updating Nodes in Virtuozzo Storage Clusters.
The following update policies are available:
- fast, get updates immediately after release.
- slow, get updates two weeks after release.
- stable, get updates six weeks after release.
- auto, a special policy that lets the Virtuozzo update server assign one of the other policies to a node.
Each node that requests updates automatically through the auto policy is registered by the Virtuozzo update server and assigned a regular update policy: fast, slow, or stable. To make automatic updating predictable, a policy is assigned to a node only once. You can change it manually, however, as explained in Changing Node Update Policy.
Each node is configured as follows during installation of Virtuozzo Server:
The repository file
/etc/yum.repos.d/vz-auto-update.repois created. It lists node’s unique repositories for automatic updating. Such URLs contain a$hwidvariable that is replaced by node’s hardware ID during updates. The file also lists the static repositories for each update policy.The repositories in/etc/yum.repos.d/vz-auto-update.repoare disabled by default, while those in/etc/yum.repos.d/virtuozzo.repoare enabled. This ensures that manual updating viayum updateworks as usual.Repositories in/etc/yum.repos.d/virtuozzo.repoare the same as those for the fast update policy. So runningyum updatedelivers the latest updates as soon as they are released.The
vzautoupdatetool for working with update policies is installed.The timer service
vzautoupdate.timeris enabled and started. It will runvzautoupdate.servicedaily to get updates. A schedule, i.e. the time of day to trigger an update at, is chosen randomly and written to/etc/systemd/system/vzautoupdate.timer.d/override.conf.Automatic updating is enabled. An update policy is not assigned yet.
When the timer triggers an update, the following happens, given that node’s license is valid:
- The repositories in
/etc/yum.repos.d/vz-auto-update.repoare enabled, while those in/etc/yum.repos.d/virtuozzo.repoare disabled. - The
vzautoupdatetool contacts the Virtuozzo update server at node’s HWID-based repository URLs. - The update server checks node’s license. If an update policy has been assigned to the node, the HWID-based URL redirects to a static repository for that update policy. Otherwise, the update server registers the node and assigns a policy to it. Then the HWID-based URL redirects to a static repository for that update policy.
- Packages are downloaded and installed as usual by
yum update. - The repositories in
/etc/yum.repos.d/vz-auto-update.repoare disabled, while those in/etc/yum.repos.d/virtuozzo.repoare enabled again. - If an update contains a new kernel and a reboot is recommended, the tool attempts to notify the local administrator via sendmail (if it is running).
/var/log/vz_auto_update.log.Enabling Automatic Updates for Upgraded Nodes
To enable automatic updates for a node that has been upgraded to Virtuozzo Server 7.5, do the following:
Install the required package:
1# yum install vzautoupdateDoing so delivers the repository file
/etc/yum.repos.d/vz-auto-update.repoand enables automatic updating.Enable and start the timer service:
1# systemctl enable vzautoupdate.timer; systemctl start vzautoupdate.timerThe node will automatically request updates according to schedule. To see the schedule, run
1# vzautoupdate get-schedule
You can also check /etc/systemd/system/vzautoupdate.timer.d/override.conf.
Changing Node Update Policy
You can manually switch between automatic updating and specific update policies with vzautoupdate set-policy.
Switching to a policy means that when you run the update tool, it will get packages from that policy’s repositories. For example, to change node update policy to stable, run
| |
If you need to check packages available for a policy, use vzautoupdate available-updates. For example:
| |
To update packages from the selected repository, run
| |
yum update will deliver packages from the repositories in /etc/yum.repos.d/virtuozzo.repo. They are the same as those for the fast update policy.To switch back to automatic updating, run
| |
If the node is still registered at the Virtuozzo update server, its update policy will be as previously assigned. Otherwise the node will get a policy according to the rules explained earlier.