by Pradeep Kilambi
Note: This article assumes that you are already familiar with Red Hat® Network (RHN) Satellite server and its applications.
Red Hat Network Satellite server allows users to locally host subscribed content from Red Hat Network and custom content in user-managed channels. An example configuration could include a server syncing content updates directly from RHN, while another mission-critical server could be disconnected from the external network, yet still receive updates via manual syncing. In the latter case, these offline servers must be manually updated regularly. Since content updates cannot be synced directly from rhn.redhat.com, RHN Satellite provides two options for our users:
1. Channel dump ISOs hosted on RHN, per Satellite release.
2. RHN-Satellite-Exporter tool running locally on a RHN Satellite server
To Illustrate this, consider the following setup:
In purely disconnected environments, servers don’t have direct access to RHN to synchronize content. Channel dump media are the primary source for content updates in such cases. As a service to our disconnected RHN Satellite customers, Red Hat provides channel dump media with a base channel dump per channel, supplemented with an incremental dump for every release update. This content can either be sent to customers from Red Hat or downloaded from rhn.redhat.com.
RHN Satellite exporter
In an isolated Satellite environment, there is often a disconnected Satellite as well as a connected Satellite, as shown in the figure above. In this case, the user already has the updated content on their connected Satellite through Satellite-sync across the network. They don’t have to go to RHN to download channel dump ISOs and re-sync their disconnected satellites.
A tool called Satellite exporter extracts the content and generates its own local channel dumps. Exporter queries the connected Satellite database and exports all the content for a given channel from the database and file system on the Satellite server where the content resides. Content type supported includes channels, channel families, package metadata, RPMs, errata, kickstart files and kickstart trees.
For rhn-Satellite-exporter to work as expected, make sure that:
- the Satellite is set up successfully, connected, and has updated content from RHN.
- you have sufficient disk space to store the exported content.
Let’s work with an example to demonstrate how exporter can be utilized to its maximum potential.
I’m a Satellite administrator with two RHN Satellites. I choose one to be a connected server communicating with RHN and syncing content updates directly over the network. The other is a mission-critical server that I prefer to keep isolated—it is disconnected completely from the outside network for security reasons.
Exporting content from connected RHN Satellite
The goal as a Satellite Administrator is to keep the disconnected servers updated. To achieve this, you will make use of the connected Satellite server, which already has content synced from RHN.
First, find out what channel content is available for the connected server to pull down from the connected Satellite. List the channels available with the following command:
[root@connected ~]# rhn-satellite-exporter --list-channels --db=rhnsat/****@rhnsat Channel List: B = Base Channel C = Child Channel B rhel-i386-server-5 C rhel-i386-server-vt-5 C rhn-tools-rhel-i386-server-5 B rhel-i386-as-4 C rhn-tools-rhel-4-as-i386
The example above gives all available channels on the connected server that are being synced from RHN. Lets choose to export rhel-i386-server-5 and its child channels, rhel-i386-server-vt-5 and rhn-tools-rhel-i386-server-5.
Now export the base channel content for the specified channels. Each content type is categorized and dumped as shown below. Multiple channels can be exported at the same time with multiple -c or –channel options. This combines all the channel data and dumps it under the directory specified.
If –end-date is not specified, it defaults to the current export date as end-date. The –db option directs the tool to access the source Satellite database to extract the requested content.
1. Create a directory for all the exported content:
[root@connected ~]# mkdir /tmp/dumps
2. Export base channel content:
[root@connected ~]# rhn-satellite-exporter --db=rhnsat/*****@rhnsat --dir=/tmp/dumps -c rhel-i386-server-5 -c rhel-i386-server-vt-5 -c rhn-tools-rhel-i386-server-5 --debug=5
Exporting incremental channel content (new in Satellite 5.1):
[root@connected ~]# rhn-satellite-exporter --db=rhnsat/*****@rhnsat --dir=/tmp/dumps/ --start-date=20071206000000 --end-date=20080206000000 -c rhel-i386-server-5 -c rhel-i386-server-vt-5 -c rhn-tools-rhel-i386-server-5 --debug=5
So, from the given Satellite server, get all the content for channel rhel-i386-server-5 and its child channels and dumps it under the directory /tmp/dumps/. Content under the directory is dumped into different content types, like so:
[root@connected ~]# ls -l /tmp/dumps/total drwxr-xr-x 2 root root 4096 Nov 11 02:30 arches drwxr-xr-x 2 root root 4096 Nov 11 02:30 blacklists drwxr-xr-x 2 root root 4096 Nov 11 02:30 channel_families drwxr-xr-x 3 root root 4096 Nov 11 02:30 channels drwxr-xr-x 12 root root 4096 Nov 11 02:47 errata drwxr-xr-x 4 root root 4096 Nov 11 02:47 kickstart_files drwxr-xr-x 2 root root 4096 Nov 11 02:47 kickstart_trees drwxr-xr-x 102 root root 4096 Nov 11 02:44 packages drwxr-xr-x 102 root root 4096 Nov 11 02:30 packages_short drwxr-xr-x 102 root root 4096 Nov 11 02:31 rpms
3. To exclude specific content types from the content dump, use –no- option. This is available for rpms, packages, errata, and kickstart trees. For example, if you want to exclude rpms from the rhel-i386-server-5 dump:
[root@connected ~]# rhn-satellite-exporter -c rhel-i386-server-5 --dir /tmp/dumps --no-rpms
Packaging exported content (new in Satellite-5.1)
Once we have all the content exported to a directory, we have multiple ways to make this content accessible to our disconnected satellites. The most common method is to burn the exported content onto CD or DVD media and carry it to your remote disconnected Satellite servers. Exporter has options to package the content into ISOs suitable for burning on CD or DVD. This can be achieved using the –make-iso= option.
For CD ISOs:
[root@connected ~]# rhn-satellite-exporter --db=rhnsat/rhnsat@rhnsat --dir=/tmp/ --start-date=20060106000000 -c rhel-i386-server-5 --debug=5 --make-iso=cd
For DVD ISOs:
[root@connected ~]# rhn-satellite-exporter --db=rhnsat/rhnsat@rhnsat --dir=/tmp/ --start-date=20060106000000 -c rhel-i386-server-5 --debug=5 --make-iso=dvd
This should create a Satellite-isos/ directory under the –dir specified, dumping the ISOs into that directory along with MD5SUM manifest for all the ISOs.
[root@connected ~]# ls -ld /tmp/dumps/satellite-isos/* -rw-r--r-- 1 root root 63 Nov 15 16:46 /tmp/dumps/Satellite-isos/MD5SUM -rw-r--r-- 1 root root 656816128 Nov 15 16:43 /tmp/dumps/Satellite-isos/rhn-export-20071115.0-01.iso
Now that we have the CD ISOs, burn them onto a CD:
[root@connected ~]# cdrecord -v -pad speed=1 dev=0,0,0 /tmp/dumps/satellite-isos/rhn-export-20071115.0-01.iso
This process of generating the channel content essentially remains the same for any channel and any amount of content. Its easy to setup a cron job to generate this content as frequently as it is needed.
Populating disconnected Satellite servers
We can now move the channel content created on the connected Satellite onto the disconnected server.
1. Create a mount point to mount the media:
[root@disconnected ~]# mkdir /mnt/dumps
2. Mount the content onto the disk:
[root@disconnected ~]# mount -t iso9660,udf /dev/cdrom /mnt/dumps
3. Check to see if the mounted channel dumps have the correct content:
[root@disconnected ~]# satellite-sync --mount-point=/mnt/dumps –list-channels
4. Use Satellite-sync to point to the above mount point on disk and sync down the channel content from the dumps:
[root@disconnected ~]# satellite-sync --mount-point=/mnt/dumps -c rhel-i386-server-5
Satellite-sync may take some time to complete based on how much content is being synced. Once this step is finished, our disconnected Satellite is all set with the required updated content. Repeat this process as frequently as possible to keep the disconnected servers up-to-date.
This article gives an overview of the multiple ways to populate content on a disconnected RHN Satellite server. It demonstrates exporting content using rhn-Satellite-exporter, packaging content as ISO images, burning them to media, and populating disconnected satellites. Rhn-satellite-exporter is a very powerful tool with a diverse set of options that make content portability between Satellites simple and effective.
About the author
Pradeep Kilambi is a Software Engineer and RHCT/RHCE primarily working on RHN Satellite Client/Server Development. In his spare time, he’s also a dedicated Python hacker and open source advocate.