Setting Up Repositories with vzcreaterepo
Virtuozzo 6 provides you with a special utility, vzcreaterepo , to facilitate the process of setting up repositories for RHEL-like distributions, including repositories for Red Hat Enterprise Linux 5.
Note: The current version of vzcreaterepo does not support creating repositories for Red Hat Enterprise Linux 6 and all versions of openSUSE and SUSE Linux Enterprise Server.
The process of setting up a repository with vzcreaterepo includes the following steps:
- Installing an OS template for which you plan to set up the repository.
- Obtaining the Linux distribution files to use as the basis for creating the repository.
Note: Always try to get the most recent versions of Linux distributions. For example, when creating a repository for Red Hat Enterprise Linux 5 and choosing between two versions 5.7 or 5.8, go with version 5.8. This will help you avoid possible problems with vzcreaterepo that is optimized for work with the latest versions of Linux distributions.
- Creating the repository with the
vzcreaterepo utility from the prepared distribution files. - Configuring the
vzpkg template management tool to contact the created repository. As a rule, vzcreaterepo automatically configures the vzpkg tool to work with newly created repositories. If some extra configuration is required, the utility will inform you of the steps to complete.
The example below assumes the following:
- You want to create a repository for the x64 version of Red Hat Enterprise Linux 5.8.
- The
redhat-el5-x86_64 OS template is installed on your server. - The full path to the RHEL 5.8 ISO image on the server is
/mnt/iso/rhel-server-5.8-x86_64-dvd.iso .
To set up a repository, you can run this command:
# vzcreaterepo -t redhat-el5-x86_64 -i /home/rhel-server-5.8-x86_64-dvd.iso
By default, vzcreaterepo sets up the repository in the /vz/template/repos/download/redhat/el5/x86_64 directory. If necessary, you can specify another location for your repository using the -d option.
To configure your repository to also store package updates for RHEL 5.8, you need to specify a number of additional options when executing the vzcreaterepo command, for example:
# vzcreaterepo -t redhat-el5-x86_64 -i /home/rhel-server-5.8-x86_64-dvd.iso --ctid 101 --ip 192.168.98.198 --hostname myrhelupdates.com --nameserver 192.168.0.1 -e user@mycompany.com
Along with setting up a repository for RHEL 5.8 in the /vz/template/repos/download/redhat/el5/x86_64 directory, this command:
- Creates Container 101 with the IP address of 192.168.98.198 and the hostname of
myrhelupdates.com . - Configures for the Container the nameserver with the IP address of 192.168.0.1.
- Asks you for the user name and password to log in to the Red Hat Network (RHN). Use the credentials you provided when registering in RHN.
- Registers the Container in the Red Hat Network with the email address
user@mycompany.com . Replace user@mycompany.com with the email address you specified when setting up your account in the Red Hat Network. - Downloads updated packages from the RHEL web site to the Container and creates an update repository from these packages.
Notes:
1. An active Internet connection is required to connect to the Red Hat website and register in the Red Hat Network.
2. You must have an active RHN account before running the vzcreaterepo command to create a repository with package updates. The account must allow you to download updates for the system for which you are setting up the repository.
|