3.7. Importing to Satellite 6
- Import organizations. This includes importing a manifest if one exists.
- Import users.
- Import system groups as host collections.
- Enable and synchronize repositories. This is referred to as repository discovery.
- Import repositories.
- Import custom channels and cloned channels as content views.
- Import activation keys.
- Import kickstart snippets as template snippets.
- Import configuration files to puppet modules.
- Import system profiles as content hosts.
Important
hammer import all --dry-run command to list the available entities and the order in which they should be imported.
Satellite 6 gives you the option of importing entities separately or all together. This section describes these two approaches.
# hammer shell hammer> import organization --csv-file=FILE hammer> import user --csv-file=FILE
/tmp/exports (the result, for example, of unpacking the output of spacewalk-export), you can use the following command to import everything:
# hammer import all --directory=/tmp/exports
3.7.1. Importing Organizations
users.csv file and recreate the Satellite 5 organizations listed within it. You can use the hammer import command on the command line or use the hammer interactive shell.
# hammer import organization --csv-file /tmp/exports/users.csv
--upload-manifests-from and --verbose options:
Example 3.2. Example of Interactive Import Session
# hammer shell hammer> import organization --csv-file /tmp/exports/users.csv --upload-manifests-from /root/manifests --verbose Importing from /tmp/exports/users.csv Creating new organization: RED HAT SATELLITE ENGINEERING Uploading manifest /root/manifests/RED_HAT_SATELLITE_ENGINEERING.zip to org-id 5 Waiting for the task [a231d19c-aee7-42b8-9566-07651ac029f4] ...... Organization [1->5] already imported. Organization [1->5] already imported. Organization [1->5] already imported. Organization [1->5] already imported. Creating new organization: SOE-ORG Uploading manifest /root/manifests/SOE-ORG.zip to org-id 6 Waiting for the task [5da6dd16-0bf6-4ad0-924f-a9d5e1802565] ...... Organization [7->6] already imported. Summary Found 5 organizations. Created 2 organizations. Uploaded 2 manifests.
hammer organization list command to list the organizations within Satellite 6.
# hammer organization list ---|-------------------------------|-------------------------------|------------ ID | NAME | LABEL | DESCRIPTION ---|-------------------------------|-------------------------------|------------ 5 | RED HAT SATELLITE ENGINEERING | RED_HAT_SATELLITE_ENGINEERING | 6 | Test Organization | Test_Organization | 3 | Satellite Documentation | Satellite_Documentation | ---|-------------------------------|-------------------------------|------------
user.csv file. The Satellite 5 organization IDs are mapped to new Satellite 6 organization IDs. This is illustrated by the "[1->5]" and similar entries in Example 3.2, “Example of Interactive Import Session”. Alternatively, you can use the hammer import organization --into-org-id org_id command to reduce all of the Satellite 5 organizations into a single, flat organization within Satellite 6. You can use the hammer organization list command to determine the correct organization ID.
Warning
~/.transition_data directory. This information is critical for any subsequent data imports. Do not modify the data in this directory.
/root/.foreman/history file, and any errors from hammer commands are stored in the /root/.foreman/log/hammer.log file.
hammer import command logs all output to the ~/import.log file. You can use the --logfile option to any hammer import subcommand to specify a different name and location for the log file.
3.7.1.1. Generating and Activating a Manifest
Procedure 3.1. To Activate the Manifest for Satellite 6:
- Log in to the Satellite 6 WebUI as an administrative user.
- Select the required organization from the main menu at the upper left.
- Click →
- On the Actions tab, under Upload New Manifest, click , navigate to and select the manifest file that you downloaded.
- In the Satellite 6 WebUI, click to upload the manifest to the Satellite 6 server.
3.7.2. Importing Users
users.csv file. User passwords cannot be copied from Satellite 5 to Satellite 6; instead, the process generates a new random password for each user that it imports. This information is saved in a CSV file, which as the administrator you can parse and send notifications to each user listed with their new password. You can use the hammer import command on the command line or use the hammer interactive shell.
hammer import user command multiple times, using different input files (CSV files). The import command recognizes user IDs it has already imported, and skips them on subsequent processes.
# hammer import user --csv-file /tmp/exports/users.csv \ --new-passwords /path/to/new/user/passwords.csv
Example 3.3. Example of Interactive Import Session
hammer> import user --csv-file /tmp/exports/users.csv --new-passwords /root/new-user-passwords.csv Summary Created 7 users.
# hammer user list ---|-------------------|-------------|------------------- ID | LOGIN | NAME | EMAIL ---|-------------------|-------------|------------------- 4 | sat5_admin | Admin Nimda | root@localhost 3 | admin | Admin User | root@milky.way 6 | normal | Morm Al | root@localhost 10 | testorg | Red Hat | root@localhost 7 | sysgroup | Red Hat | root@localhost 8 | suseadmin | SUSE Admin | root@localhost ---|-------------------|-------------|------------------- # hammer user list --search sat5_admin ---|------------|-------------|--------------- ID | LOGIN | NAME | EMAIL ---|------------|-------------|--------------- 4 | sat5_admin | Admin Nimda | root@localhost ---|------------|-------------|---------------
# head new-user-passwords.csv mail,login,password sat5admin@example.com,sat5_admin,sat5_admin_svenkmxf auser1@example.com,auser1,auser1_pwfnagdk auser2@example.com,auser2,auser2_rsgywazf
Note
admin user as the initial administrator. It is common for Satellite 5 customers to also create a generic administrative user; consequently, if the import process detects a Satellite 5 admin user, it renames that user to sat5_admin.
You can use the --delete option to delete the entities from the Satellite 6 instance based on information in the specified CSV file. The following example demonstrates the use of this option to delete imported users.
Example 3.4. Deleting Imported Users
$ hammer import user --csv-file /tmp/exports/users.csv --delete --verbose Deleting from /tmp/exports/users.csv Deleting imported user [1->4]. Deleting imported user [2->5]. Deleting imported user [3->6]. Deleting imported user [5->7]. Deleting imported user [6->8]. Deleting imported user [7->9]. Deleting imported user [4->10]. Summary Deleted 7 users.
3.7.3. Transitioning System Groups to Host Collections
# hammer import host-collection --csv-file /tmp/exports/system-groups.csv Summary Created 4 host_collections.
hammer host-collection list --organization-id ORG-ID to verify that the system groups have been recreated as host collections. Ensure you use the correct organization ID.
3.7.4. Enabling Yum Repositories
satellite-sync command synchronizes Red Hat channels from RHN into Satellite 5. In Satellite 6, everything is a yum repository and you filter the content from that repository that is exposed to the systems being managed by Satellite 6.
- Use the
hammer import repository --synchronizecommand to initiate repository synchronization in the background. - Use the
hammer import repository --synchronize --waitcommand to initiate repository synchronization in the background, but wait for each synchronization to complete before proceeding to the next repository. - Use the
hammer import repositorycommand with neither option and then synchronize the content manually using the WebUI orhammercommands.
The default behavior of the hammer import repository command is to not automatically synchronize content. Many of the following import operations require that synchronization be complete before they can run successfully. Synchronization is a time-consuming task, because it involves retrieving content from external sources into your Satellite 6 server.
hammer import command does not alter organizations that are not part of the overall transition process.
# hammer import repository-enable --synchronize --wait --no-async
repository-enable command is complete, run the following command to process local and custom repositories in a similar fashion.
# hammer import repository --synchronize --wait --no-async
Example 3.5. Example Session of Importing Repositories
# hammer import all --entities repository Import repository with arguments --csv-file /tmp/exports/repositories.csv [Foreman] Username: admin [Foreman] Password for admin: Summary Created 10 repositories. Created 5 products.
3.7.4.1. Enabling External Yum Repositories
--synchronize option to import and synchronize repositories.
Note
-v (verbose) option. The synchronization process can take a long time (several hours depending on the number of repositories, bandwidth, and other factors), during which no output is displayed.
Example 3.6. Importing and Synchronizing non-Red Hat Repositories
# hammer import repository --synchronize --wait --no-async --csv-file /tmp/exports/repositories.csv Summary No action taken.
Navigate to → in the Satellite 6 web UI to view the resulting products and repositories for your organization. Alternatively, use the following hammer commands:
# hammer organization list ---|-------------------------------|-------------------------------|------------ ID | NAME | LABEL | DESCRIPTION ---|-------------------------------|-------------------------------|------------ 5 | RED HAT SATELLITE ENGINEERING | RED_HAT_SATELLITE_ENGINEERING | 6 | Test Organization | Test_Organization | 3 | Satellite Documentation | Satellite_Documentation | ---|-------------------------------|-------------------------------|------------ # hammer product list --organization-id 5 ----|--------------|-------------|-------------------------------|--------------|------------------ ID | NAME | DESCRIPTION | ORGANIZATION | REPOSITORIES | SYNC STATE ----|--------------|-------------|-------------------------------|--------------|------------------ 131 | GOOGLE.COM | | RED HAT SATELLITE ENGINEERING | 1 | Syncing Complete. 133 | NOVELL.COM | | RED HAT SATELLITE ENGINEERING | 3 | Syncing Complete. 134 | OPENSUSE.ORG | | RED HAT SATELLITE ENGINEERING | 2 | Syncing Complete. 135 | PNL.GOV | | RED HAT SATELLITE ENGINEERING | 1 | Syncing Complete. 132 | REDHAT.COM | | RED HAT SATELLITE ENGINEERING | 3 | Syncing Complete. ----|--------------|-------------|-------------------------------|--------------|------------------
Important
hammer import repository command is to not automatically synchronize content, but rather only to enable the repositories listed in the repositories.csv file. Red Hat recommends that you use the --synchronize option to schedule a background synchronization of all content before proceeding.
3.7.4.2. Enabling Red Hat Repositories
hammer import command on Satellite 6 provides an option to review your Satellite 5 channels and enable the corresponding repositories in Satellite 6. This section guides you through the process of discovering and enabling the appropriate Red Hat repositories. This command provides the same --wait and --synchronize options for initiating the import of Red Hat content automatically. This needs to be completed before moving to the next step.
--synchronize option to enable and synchronize Red Hat repositories.
Example 3.7. Enabling and Synchronizing Red Hat Repositories
# hammer import repository-enable --csv-file /tmp/exports/channels.csv --synchronize Only repositories available to IMPORTED organizations will be enabled! Organization ACME_Corporation... Organization GLOBAL_SUPPORT_SERVI_RED_HAT__INC_... Enabling /content/dist/rhel/server/5/5Server/x86_64/os/Packages for channel rhel-x86_64-server-5 Sync started! Enabling /content/dist/rhel/server/5/5Server/x86_64/supplementary/os/Packages for channel rhel-x86_64-server-supplementary-5 Sync started! Enabling /content/dist/rhel/server/6/6Server/x86_64/rhn-tools/os/Packages for channel rhn-tools-rhel-x86_64-server-6 Sync started! Enabling /content/dist/rhel/server/6/6Server/x86_64/optional/os/Packages for channel rhel-x86_64-server-optional-6 Sync started! Enabling /content/dist/rhel/server/6/6Server/x86_64/os/Packages for channel rhel-x86_64-server-6 Sync started! Enabling /content/dist/rhel/server/5/5Server/x86_64/rhn-tools/os/Packages for channel rhn-tools-rhel-x86_64-server-5 Sync started!
3.7.5. Transitioning Custom and Cloned Channels to Content Views
--dir option to specify the appropriate export directory.
# hammer import content-view --csv-file /tmp/exports/CHANNELS/export.csv --dir /tmp/exports/CHANNELS
# hammer import content-view --csv-file /tmp/exports/CHANNELS/export.csv --synchronize
# hammer import content-view --csv-file /tmp/exports/CHANNELS/export.csv --dir /tmp/exports/CHANNELS --synchronize
Example 3.8. Importing Channels to Content Views
# hammer import content-view --csv-file /tmp/exports/CHANNELS/export.csv --dir /tmp/exports/CHANNELS Creating new product: Local-repositories Creating new local_repository: Local repository for clone-rhel-x86_64-server-5 No such content_view: 101 Repository Local_repository_for_clone-rhel-x86_64-server-5 is not (fully) synchronized. Retry once synchronization has completed. Product [1Local-repositories->118] already imported. Creating new local_repository: Local repository for clone-rhel-x86_64-server-6 No such content_view: 102 Product [1Local-repositories->118] already imported. Creating new local_repository: Local repository for custom-clone-master-puppet-rhel6-server-x86_64 Repository Local_repository_for_custom-clone-master-puppet-rhel6-server-x86_64 is not (fully) synchronized. Retry once synchronization has completed. Product [1Local-repositories->118] already imported. Creating new local_repository: Local repository for epel-puppet-rhel6-server-x86_64 Repository Local_repository_for_epel-puppet-rhel6-server-x86_64 is not (fully) synchronized. Retry once synchronization has completed.
Example 3.9. Synchronizing Imported Channels
# hammer import content-view --csv-file /tmp/exports/CHANNELS/export.csv --synchronize Product [1Local-repositories->118] already imported. Local_repository [1117->12] already imported. Sync started! No such content_view: 101 Repository Local_repository_for_clone-rhel-x86_64-server-5 is not (fully) synchronized. Retry once synchronization has completed. Product [1Local-repositories->118] already imported. Local_repository [1113->13] already imported. Sync started! No such content_view: 102 Repository Local_repository_for_clone-rhel-x86_64-server-6 is not (fully) synchronized. Retry once synchronization has completed. Product [1Local-repositories->118] already imported. Local_repository [1115->14] already imported. Sync started! Repository Local_repository_for_custom-clone-master-puppet-rhel6-server-x86_64 is not (fully) synchronized. Retry once synchronization has completed. Product [1Local-repositories->118] already imported. Local_repository [1125->21] already imported. Sync started!
Example 3.10. Combining Import and Synchronization of Channels
# hammer import content-view --csv-file /tmp/exports/CHANNELS/export.csv --dir /tmp/exports/CHANNELS --synchronize Product [1Local-repositories->98] already imported. Local_repository [1117->12] already imported. No such content_view: 101 Creating new content_view: Clone of Red Hat Enterprise Linux (v. 5 for 64-bit x86_64) Product [1Local-repositories->98] already imported. Local_repository [1113->13] already imported. No such content_view: 102 Creating new content_view: Clone of Red Hat Enterprise Linux Server (v. 6 for 64-bit x86_64) Product [1Local-repositories->98] already imported. Local_repository [1115->14] already imported. No such content_view: 103 Creating new content_view: Clone of RHEL Server Optional (v. 6 64-bit x86_64)
synchronize option more than once after previous steps have completed, before you see the content view being generated.
3.7.6. Importing Activation Keys
Example 3.11. Importing Activation Keys into Satellite 6
# hammer import activation-key --csv-file /tmp/exports/activation-keys.csv Activation key usage_limit: unlimited Creating new activation_key: 1-rhel5-puppet Associating activation key [1] with host collections [2] Creating new ak_content_view: ak_1 Publishing content view: 15 Associating activation key [1] with content view [15] Updating activation_key with id: 1 Creating new ak_content_view: ak_2 . . . Summary Skipped 2 activation_keys. Created 3 activation_keys.
hammer activation-key list --organization-id ORG-ID command to verify that the activation keys have been recreated. Ensure you use the correct organization ID.
Example 3.12. Verifying the Import of Activation Keys
# hammer activation-key list --organization-id 3 ---|------------------------------------|----------------|-----------------------|------------- ID | NAME | CONSUMED | LIFECYCLE ENVIRONMENT | CONTENT VIEW ---|------------------------------------|----------------|-----------------------|------------- 1 | 1-rhel6-puppet | 0 of Unlimited | |ak_1 3 | 1-rhel5-puppet | 0 of Unlimited | |ak_3 ---|------------------------------------|----------------|-----------------------|-------------
3.7.7. Transitioning Kickstart Profiles
The transition tools extract and export kickstart scripts from kickstart profiles as part of the overall export process on the Satellite 5 server. These scripts are stored in the kickstart-scripts.csv file in the export archive, which is copied to the Satellite 6 server.
When you extract the export archive onto the Satellite 6 server, the hammer import command uses the kickstart-scripts.csv file to create template snippets. These snippets are in the form of %pre and %post scripts that you can use with any new kickstart profiles in Satellite 6.
3.7.8. Transitioning Configuration Channels to Puppet Modules
- Generate Puppet modules for each Satellite 5 configuration channel.
- Map any Satellite 5 macros in the configuration files to whatever Puppet facts are found.
- Build the modules.
- Create a Satellite 6 repository for each configuration channel, and a product to hold those repositories.
- Upload the built Puppet modules into Satellite 6.
Table 3.1. Mapping of Satellite 5 Macros to Satellite 6 (Puppet) Facts
|
Satellite 5 Macro
|
Puppet Fact
|
|---|---|
|
rhn.system.sid
|
None
|
| rhn.system.profile_name | None |
| rhn.system.description | None |
| rhn.system.hostname | FQDN or host name |
| rhn.system.ip_address | ipaddress |
| rhn.system.custom_info(key_name) | None |
| rhn.system.net_interface.ip_address(eth_device) | ipaddress_{NETWORK INTERFACE} |
| rhn.system.net_interface.netmask(eth_device) | netmask_{NETWORK INTERFACE} |
| rhn.system.net_interface.broadcast(eth_device) | None |
| rhn.system.net_interface.hardware_address(eth_device) | macaddress_{NETWORK INTERFACE} |
| rhn.system.net_interface.driver_module(eth_device) | None |
The following example illustrates a simple use case for transitioning configuration channels to Puppet modules.
Example 3.13. Transitioning Configuration Channels and Files to Puppet Modules
# hammer import config-file --csv-file /tmp/exports/config-files-latest.csv Writing converted files Building and uploading puppet modules Successfully uploaded file 'redhatsatelliteengineering-test_channel-1.0.0.tar.gz'. Summary Uploaded 1 puppet module. Wrote 1 puppet module. Wrote 4 puppet_files. Created 1 puppet repository. Created 1 product.
3.7.9. Transitioning System Profiles to Content Hosts
hammer import all command, or by specifically importing them, using the hammer import all --entities content-host command.
Before you can transition your Satellite 5 systems to Satellite 6, you need to build the required RPM file. The hammer import all command displays instructions on how to do this, tailored to your specific environment, after you have successfully transitioned system profiles to content hosts.
Example 3.14. Example Instructions for Building a System Profile Transition RPM File
To build the system-profile-transition rpm, run: cd /root/rpm-working-dir/SPECS && rpmbuild -ba --define "_topdir /root/rpm-working-dir" system-profile-transition-myhost.example.com-1410140956-0.0.1.spec Then find your system-profile-transition-myhost.example.com-1410140956 package in /root/rpm-working-dir/RPMS/noarch/ directory.
3.7.10. Transitioning Systems
- Ensure that each Satellite 5 client is registered to a new Satellite 6 instance, with as much of the existing Satellite 5 setup maintained as possible.
- Help customers stay in compliance with their Red Hat Enterprise Linux usage. The process removes the Satellite 5 entitlements used by a given system when that system is registered to Satellite 6.
3.7.10.1. Prerequisites
- An existing, up-to-date Satellite 5.6 or 5.7 server. In this example, this system is called "SAT5x".
- An existing, up-to-date Red Hat Enterprise Linux client systems registered to SAT5x.
- An existing, up-to-date Satellite 6 server. In this example, this system is called "SAT6".
- Manifests created for each Organization on SAT5x, downloaded to username@SAT6:/tmp/manifests, and renamed to
ORG_NAME.zip, to match the names of your organizations.
3.7.10.2. Assumptions
- The
hammer import content-hostcommand has completed successfully. - An RPM file containing a mapping between Satellite 5 SIDs and matching Satellite 6 content-host UUIDs has been created.
- The above-mentioned RPM file has been installed on the Satellite 5 server.
- The sat5to6 package and dependencies have been installed on each client system. This package provides the
sat5to6command, which performs the following tasks on the system where it is run:- Queries its Satellite 5 parent for a consumer ID.
- Loads the appropriate PEM files onto the client machine, based on the Satellite 5 channels to which the machine is subscribed.
- Registers the host on which it is run to a specified Satellite 6 server, attaching it to the content host UUID specified by its Satellite 5 parent.
- Manages the "retired" Satellite 5 profile in one of three ways, as specified by the user:
keep: Do nothing. Retain the Satellite 5 profile in its original state.unentitle: Retain the Satellite 5 profile but remove all subscriptions and entitlements (default).purge: Delete the Satellite 5 profile completely.
3.7.10.3. Performing the Transition
- You have successfully used the
spacewalk-exportcommand on your Satellite 5 server to export all required entities. - You have copied the resulting
spacewalk_export.tar.gzfile to the/tmpdirectory on your Satellite 6 server, and extracted it into the same directory. - You have successfully run the
hammer import allcommand on the Satellite 6 server, and followed the resulting instructions to build the required RPM file. - You have the necessary system transition packages installed on the Satellite 5 server. To ensure these packages are installed, run the following command:
# yum install /tmp/system-profile-transition-*.rpm
This process assumes that your client is already subscribed to the appropriate RHN Tools channel. This channel provides access to the sat5to6 RPM file and its dependencies. For each client that is registered to your Satellite 5 server, run the following commands:
- Install the sat5to6 package and its dependencies:
# yum install sat5to6
- Install the Public Certificate for Satellite's Certificate Authority. This also configures
subscription-managerwith the correct URL so that the system can properly register via the Satellite 6.x instance. In this example, $FQDN represents the fully qualified domain name of the Satellite or Satellite Capsule.Important
Ensure you use HTTP and not HTTPS for this installation; the Satellite 6 CA certificate is not yet installed and so HTTPS will fail.# yum install http://$FQDN/pub/katello-ca-consumer-latest.noarch.rpm
- Update the yum and openssl packages.
# yum update yum openssl
- Use the
sat5to6command to register your client to your Satellite 6 instance, and attach it to the content host created for it by the import process.# sat5to6 --registration-state unentitle \ --legacy-user admin --legacy-password password \ --destination-user admin --destination-password changeme
- Enable the Satellite Tools repository which contains the katello-agent and puppet packages.
# subscription-manager repos --enable=rhel-*-server-satellite-tools-6-rpms
- Install the katello-agent and puppet packages
# yum install katello-agent puppet
- Configure the
goferdandpuppetservices to start on boot.# chkconfig goferd on # chkconfig puppet on
- Configure puppet with the host name of the Satellite or Satellite Capsule that will manage its configuration. In this example, $FQDN represents the fully qualified domain name of the Satellite or Satellite Capsule.
# echo "server=$FQDN" >> /etc/puppet/puppet.conf
- Restart the
goferdandpuppetservices.# service goferd restart # service puppet restart
Note
/etc/rhsm/rhsm.conf file. This enables SSL and also means you do not need to specify the --destination-url parameter as part of the sat5to6 command.
Example 3.15. Example Session of a System Transition
# sat5to6 --registration-state=unentitle --legacy-user=admin --legacy-password=password --destination-user=admin --destination-password=changeme Org: MY ENGINEERING ORG Environment: Library Retrieving existing legacy subscription information... +-----------------------------------------------------+ System is currently subscribed to these legacy channels: +-----------------------------------------------------+ rhel-x86_64-server-6 +-----------------------------------------------------+ Installing product certificates for these legacy channels: +-----------------------------------------------------+ rhel-x86_64-server-6 Product certificates installed successfully to /etc/pki/product. Attempting to register system to destination server... WARNING This system has already been registered with Red Hat using RHN Classic. Your system is being registered again using Red Hat Subscription Management. Red Hat recommends that customers only register once. To learn how to unregister from either service please consult this Knowledge Base Article: https://access.redhat.com/kb/docs/DOC-45563 The system has been registered with ID: ac063466-0abc-1bb3-abc0-33abf6c1dd3a Installed Product Current Status: Product Name: Red Hat Enterprise Linux Server Status: Subscribed System 'dhcp1234.example.com' successfully registered.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.