6.2. Importing

Before distributing packages via RHN Satellite Server, the packages must first be uploaded to the Satellite. This section describes the process for importing packages and other channel data.

ImportantImportant
 

To populate custom channels correctly, you must first populate at least one Red Hat base channel. The RHN Satellite Synchronization Tool creates the necessary directory structures and permissions; without these, the custom channel tools will not work properly. For this reason, you should use these instructions to set up your base channel(s) and then refer to the RHN Channel Management Guide for steps to establish custom channels.

6.2.1. Prerequisites

To perform the RHN Satellite Server import, the following prerequisites must be met:

6.2.2. Preparing for Import

Although it is possible to conduct the import directly from the RHN website, this should be done only if Channel Content CDs (or ISOs) are not available. It takes a long time to populate a channel from scratch over the Internet. For this reason, Red Hat urges you to use CDs, if they are available, for initial import.

Channel Content CDs are special collections that contain both packages and XML dumps of metadata. If the Channel Content CDs don't accompany the Satellite Installation CD, the ISO images can be downloaded from the RHN website. After logging in, click Channels in the top navigation bar and then the name of the channel for your version of RHN Satellite Server. Click the Downloads tab and use the instructions on the page to obtain the Channel Content ISOs, designated as "channel" ISOs. If the desired Channel Content ISOs don't appear, ensure your RHN Entitlement Certificate has been uploaded to RHN and correctly identifies the target channels.

Channel content, whether it comes in the form of physical discs or downloadable ISOs, is mounted and then copied to a temporary repository directory. Before mounting the CDs/ISOs, ensure the temporary repository has enough disk space to copy all the contents into a single directory. For a single channel, the approximate required space is 3 GB. The process to copy channel CDs/ISOs is to mount each one, copy its contents to the temporary repository, and then unmount the CD/ISO. Repeat. Each channel consists of several CDs/ISOs. Once finished, the administrator should delete the temporary directory and all of its contents. Follow these steps:

  1. Log into the machine as root.

  2. Insert the first Channel Content CD or ISO that has been burned to disc.

  3. Create a directory in /mnt to store the file(s) with the command:

    mkdir /mnt/import
  4. If you are installing from official CD and it is not mounted automatically, mount it using the command:

    mount /dev/cdrom /mnt/import

    If you are installing from ISO, mount the file from within the directory containing it using the command:

    mount iso_filename /mnt/import -o loop
  5. Create a target directory for the files, such as:

    mkdir /var/rhn-sat-import/
  6. This sample command assumes the administrator wants to copy the contents of the CD/ISO (mounted in /mnt/import) into /var/rhn-sat-import/:

    cp -ruv /mnt/import/* /var/rhn-sat-import/
  7. Then unmount /mnt/import in preparation for the next CD or ISO:

    umount /mnt/import/
  8. Repeat these steps for each Content CD or ISO of every channel to be imported.

6.2.3. Running the Import

The rhns-satellite-tools package provides the satellite-sync program for managing all package, channel, and errata imports and synchronizations.

The following process assumes in the previous step the user has copied all data to /var/rhn-sat-import.

NoteNote
 

The trailing backslash (\) in all subsequent command examples is a continuation character; it may safely be omitted. Long versions of all options are used in the examples for clarity. You may use short versions where available.

The first step in importing channels into the database is listing the channels available for import. This is accomplished with the command:

satellite-sync --list-channels --mount-point /var/rhn-sat-import

The next step is to initiate the import of a specific channel. Do this using a channel label presented in the previous list. The command will look like:

satellite-sync -c rhel-i386-as-3 --mount-point /var/rhn-sat-import

NoteNote
 

Importing package data can take up to two hours per channel. But you may begin registering systems to channels as soon as they appear in the RHN Satellite Server's website. No packages are necessary for registration, although updates cannot be retrieved from the Satellite until the channel is completely populated.

You may repeat this step for each channel or include them all within a single command by passing each channel label preceded by an additional -c flag, like so:

satellite-sync -c channel-label-1 -c channel-label-1 --mount-point /var/rhn-sat-import

This conducts the following tasks in this order:

  1. Populating the tables describing common features for channels (channel families). This can also be accomplished individually by passing the --step=channel-families option to satellite-sync.

  2. Creating a particular channel in the database and importing the metadata describing the channel. Individually, use the --step=channels option.

  3. Moving the RPM packages from the temporary repository into their final location. Individually, use the --step=rpms option.

  4. Parsing the header metadata for each package in the channel, uploading the package data, and associating it with the channel. Individually, use the --step=packages option.

  5. Identifing Errata associated with the packages and including them in the repository. Individually, use the --step=errata option.

After running the preceding sample command, the population of the channel should be complete. All of the packages should have been moved out of the repository; this can be verified with the command cd /var/rhn-sat-import/; ls -alR | grep rpm. If all RPMs have been installed and moved to their permanent locations, then this count will be zero, and the administrator may safely remove the temporary repository (in this case, /var/rhn-sat-import/).