Using Alternate Content Sources With Satellite 6.12 (Tech Preview)
Alternate Content Sources
-
Alternate content sources (ACS) are Pulp objects that define alternate paths (filesystem or network) for content to be downloaded from at sync time. Alternate content sources can speed up both repository and capsule synchronization when configured with content located on the same filesystem or a nearby network.
-
Red Hat Satellite 6.12 can make setting up alternate content sources easy thanks to new API, Hammer, and UI options. This article will go over basic ACS setup and walk through two key use cases: syncing CDN repositories from the filesystem and syncing capsules from RHUI.
-
Please note that Alternate Content Sources are considered tech preview for Satellite 6.12. The feature is not complete and the feature documentation is not complete. If defects are found, please file a Bugzilla issue for Red Hat Satellite under the Alternate Content Sources component.
ACS Basics In Red Hat Satellite 6.12
-
All alternate content sources in Red Hat Satellite represent any number of Pulp alternate content sources spread across a Red Hat Satellite's capsules. When creating an ACS of any type, the user will select a name, source type, content type, any number of smart proxies, and then type-specific configuration options. The only available content types are "yum" and "file".
-
In Red Hat Satellite 6.12, the only available ACS type is "Custom". For the Custom type, the user must define all attributes of the ACS. The attributes are as follows:
Capsules: the capsules that an alternate content source should be deployed to.
Base URL: a filesystem (file://) or web (https://) path that represents the base location for content. For example, if the content is in /mnt/backups/repoA and /mnt/backups/repoB, the Base URL could be /mnt/backups.
Subpaths: a comma-separated list of subpaths that end with a forward slash. Following the example above, the Subpaths could be repoA/, repoB/.
Credentials: basic authentication or SSL certificate credentials for a web-based alternate content source. SSL certificates must be created first as content credentials (Content -> Content Credentials) . A CA certificate may also be entered as necessary regardless of chosen the authentication type.
Highlighted Use Case 1: Sync a Capsule From an Alternate Source
- In some cases, a Capsule may have a geographically closer mirror than the Satellite to sync from. Example scenario: a Capsule has a quicker connection to a private RHUI instance than it does to the Satellite. The largest repositories to sync to the capsule are RHEL 8 BaseOS and Appstream. How can an Alternate Content Source be used to download RPMs from this faster connection?
- Enable "Experimental Labs" via Settings -> General tab -> Show Experimental Labs -> Yes.
- Retrieve certificates and repository information from RHUI:
- On the RHUA Instance, check the available repositories:
rhui-manager repo list
- Generate certificates for the chosen repositories:
rhui-manager client cert --name rhui-sat-acs-test-certs --days 365 --dir /root --repo_label rhel-8-for-x86_64-appstream-rhui-rpms-8,rhel-8-for-x86_64-baseos-rhui-rpms-8
- Create content credentials in Satellite with the created SSL certificate and key via Content -> Content Credentials.
- Find the relative paths for the repositories:
rhui-manager repo info --repo_id rhel-8-for-x86_64-baseos-rhui-rpms-8
rhui-manager repo info --repo_id rhel-8-for-x86_64-appstream-rhui-rpms-8
- Create the alternate content source in Satellite with the following parameters:
- Capsule: the capsules that should sync from RHUI
- Base URL:
https://rhui-server.example.com/pulp/content - Subpaths:
content/dist/rhel8/rhui/8/x86_64/appstream/os/, content/dist/rhel8/rhui/8/x86_64/baseos/os/ - Credentials: Select "Content credentials" and select the SSL client certificate and SSL client key content credentials
-
Refresh the alternate content source by selecting "Refresh" in the alternate content source's kebab menu on the right
-
After the refresh is complete, the capsule will download matching content from the alternate content source.
Highlighted Use Case 2: Sync Content From a Local Backup
- Alternate content sources can be configured to point to filesystem locations. If, for example, a fresh Satellite installation needs RHEL 8 AppStream and there is a local backup available, those files can be used to quickly populate the Satellite's AppStream repository. For the sake of this example, the backup will exist within
/mnt/backup
- Add
/mnt/backupto Pulp's allowed "import paths". Without this, a sync or refresh from the filesystem at/mnt/backupwill fail.
satellite-installer --foreman-proxy-content-pulpcore-additional-import-paths /mnt/backup
- Create an alternate content source in Satellite with the following parameters:
- Capsule: the capsule that resides on the Satellite server
- Base URL:
file:///mnt/backup - Subpaths:
dist/rhel8/x86_64/appstream/ - Credentials: None
-
Refresh the alternate content source by selecting "Refresh" in the alternate content source's kebab menu on the right
-
Enable the RHEL 8 AppStream repository and sync it. To import all content immediately, use the "Immediate" download policy.
-
If the "Immediate" download policy was used, the backup drive can now be unmounted and the ACS can be deleted.