7.10. Updating Containers¶
Virtuozzo Hybrid Server provides three means of keeping your containers up to date:
Updating EZ template RPM packages on the node so that new containers are up to date.
Updating caches of the EZ templates installed on the node to create new containers quicker.
Updating EZ templates inside existing containers to keep existing containers up to date.
7.10.1. Updating EZ Templates¶
You can update an EZ template like any other RPM package using the yum update
command. For example:
# yum update centos-6-x86_64-ez
...
Updated:
centos-6-x86_64-ez.noarch 0:4.7.0-1
Complete!
Note the following:
Updating an EZ template requires that you append
ez
to template name.You can also use the
vzpkg update template
command to update EZ templates.
7.10.2. Updating EZ Template Caches¶
With the release of new updates for the corresponding Linux distribution, the created EZ template cache can become obsolete. Virtuozzo Hybrid Server allows you to quickly update your EZ template caches using the vzpkg update cache
command.
Note
If you are going to update the cache of a commercial EZ template (e.g., Red Hat Enterprise Server 6 or SLES 11), you should first update software packages in the remote repository used to handle this EZ template and then proceed with updating the EZ template cache.
When executed, vzpkg update cache
checks the cache
directory in the template area (/vz/template/cache
by default) on the hardware node and updates all existing tarballs in this directory. However, you can explicitly indicate the tarball for what EZ template should be updated by specifying the EZ template name. For example, to update the tarball for the centos-6-x86_64
EZ template, run this command:
# vzpkg update cache centos-6-x86_64
Loading "rpm2vzrpm" plugin
Setting up Update Process
Setting up repositories
base0 100% |=========================| 951 B 00:00
base1 100% |=========================| 951 B 00:00
base2 100% |=========================| 951 B 00:00
base3 100% |=========================| 951 B 00:00
<...>
Upon the vzpkg update cache
execution, the old tarball name gets the -old
suffix (e.g., centos-x86.tar.gz-old
).
You can also pass the -f
option to vzpkg update cache
to remove an existing tar archive and create a new one instead of it.
If the vzpkg update cache
command does not find a tarball for one or several EZ templates installed on the server, it creates tar archives of the corresponding EZ templates and puts them to the /vz/template/cache
directory.
7.10.3. Updating EZ Templates in Existing Containers¶
You can update packages of a container EZ template with the vzpkg update
command. For example, to update all packages of the template centos-6-x86_64
used in the container with the UUID 26bc47f6-353f-444b-bc35-b634a88dbbcc
, run
# vzpkg update 26bc47f6-353f-444b-bc35-b634a88dbbcc centos-6-x86_64
<...>
Updating: httpd ### [1/4]
Updating: vzdev ### [2/4]
Cleanup : vzdev ### [3/4]
Cleanup : httpd ### [4/4]
Updated: httpd.i386 0:2.0.54-10.2 vzdev.noarch 0:1.0-4.swsoft
Complete!
Updated:
httpd i386 0:2.0.54-10.2
vzdev noarch 0:1.0-4.swsoft
Note the following:
Updating EZ templates is supported for running containers only.
If you are going to update the cache of a commercial EZ template, first update software packages in the remote repository used to handle this EZ template and then proceed with updating the EZ template cache.
As you can see from the example above, the httpd
and vzdev
applications have been updated for the centos-6-x86_64
EZ template. If you wish to update all EZ templates (including the EZ template) inside the container at once, run:
# vzpkg update 26bc47f6-353f-444b-bc35-b634a88dbbcc
<...>
Running Transaction
Updating : hwdata #### [1/2]
Cleanup : hwdata #### [2/2]
Updated: hwdata.noarch 0:1.0-3.swsoft
Complete!
Updated:
hwdata noarch 0:0.158.1-1
In the example above, only the hwdata
package inside the container needed to be updated.