Red Hat Training

A Red Hat training course is available for Red Hat Satellite

Chapter 2. Cloning Satellite Server

When you upgrade Satellite Server, you can optionally create a clone of your Satellite to ensure that you do not lose any data while you upgrade. After your upgrade is complete, you can then decommission the earlier version of Satellite Server.

Use the following procedures to clone your Satellite instances to preserve your environments in preparation for upgrade.

The Satellite clone tool does not support migrating a Capsule Server to Red Hat Enterprise Linux 7. Instead you must backup the existing Capsule Server, restore it on Red Hat Enterprise Linux 7, then reconfigure the Capsule Server.

Terminology

Ensure that you understand the following terms:

Source server: the server that you clone

Target server: the new server that you copy files to and clone the source server to.

2.1. Cloning Process Overview

  1. Back up the source server.
  2. Clone the source server to the target server.
  3. Power off the source server.
  4. Update the network configuration on the target server to match the target server’s IP address with its new host name.
  5. Restart goferd in Content hosts and Capsules to refresh the connection.
  6. Test the new target server.

2.2. Prerequisites

To clone Satellite Server, ensure that you have the following resources available:

  • A minimal install of Red Hat Enterprise Linux 7 server to become the target server. Do not install Red Hat Enterprise Linux 7 software groups, or third-party applications. Ensure that your server complies with all the specifications of Preparing your Environment for Installation in Installing Satellite Server from a Connected Network.
  • A backup from Satellite versions 6.1, 6.2, or 6.3 that you make using the katello-backup script. You can use a backup with or without Pulp data.
  • A Satellite subscription for the target server.

Before you begin cloning, ensure the following conditions exist:

  • The target server is on an isolated network. This avoids unwanted communication with Capsule Servers and hosts
  • The target server has the capacity to store all your backup files from the source server.

2.3. Pulp Data Considerations

You can clone Satellite server without including Pulp data. However, for your cloned environment to work, you do require Pulp data. If the target server does not have Pulp data. it is not a fully working Satellite.

To transfer Pulp data to a target server, you have two options:

  • Clone using backup with Pulp data
  • Clone using backup without Pulp data and copy /var/lib/pulp manually from source server.

If your pulp_data.tar file is greater than 500 GB, or if you use a slow storage system, such as NFS, and your pulp_data.tar file is greater than 100 GB, do not include pulp_data.tar in the backup because this can cause memory errors during extraction. Copy the pulp_data.tar file from the source server to the target server.

To back up without Pulp data

Follow the steps in the procedure in Section 2.4, “Cloning Satellite Server” and replace the steps that involve cloning with Pulp data with the following steps:

  1. Perform a backup with MongoDB and PostgreSQL databases active excluding the Pulp data:

    # katello-service stop
    # katello-service start --only mongod,postgresql
    # katello-backup --skip-pulp-content /var/backup --assumeyes
  2. Stop and disable all Satellite services

    # katello-service stop
    # for i in $(katello-service list| awk '{print $1}'|grep service); \
    do systemctl disable $i ;done
  3. Copy the Pulp data to the target server:

    # rsync --archive --partial --progress --compress \
    /var/lib/pulp target_server.example.com:/var/lib/pulp

Proceed to Section 2.4.2, “Cloning to the Target Server”.

2.4. Cloning Satellite Server

Use the following procedures to clone Satellite Server. Note that because of the high volume of data that you must copy and transfer as part of these procedures, it can take a significant amount of time to complete.

2.4.1. Preparing the source server for cloning

On the source server, complete the following steps:

  1. Verify the Pool ID of your Satellite subscription:

    # subscription-manager list --consumed \
    --matches 'Red Hat Satellite'|grep "Pool ID:"|awk '{print $3}'
  2. Remove the Red Hat Satellite subscription.

    # subscription-manager remove --serial=$(subscription-manager list \
    --consumed \
    --matches 'Red Hat Satellite'|grep "Serial:"|awk '{print $2}')
  3. Determine the size of the Pulp data:

    # du -sh /var/lib/pulp/
  4. If you have less than 500 GB of Pulp data, perform a backup with MongoDB and PostgreSQL databases active including the Pulp data. If you have more than 500 GB of Pulp data, skip the following steps and complete the steps in Section 2.3, “Pulp Data Considerations” before you continue.

    # katello-service stop
    # katello-service start --only mongod,postgresql
    # katello-backup /var/backup --assumeyes
  5. Stop and disable all Satellite services:

    # katello-service stop
    # for i in $(katello-service list| awk '{print $1}'|grep service); \
    do systemctl disable $i ;done

Proceed to Section 2.4.2, “Cloning to the Target Server”.

2.4.2. Cloning to the Target Server

To clone your server, complete the following steps on your target server:

  1. The satellite-clone tool defaults to using /backup/ as the backup folder. If you copy to a different folder, update the backup_dir variable in the /etc/satellite-clone/satellite-clone-vars.yml file.
  2. Place the backup files from the source Satellite in the /backup/ folder on the target server. You can either mount the shared storage or copy the backup files to the /backup/ folder on the target server.
  3. Power off the source server.
  4. Enter the following commands to register to the Customer Portal, attach subscriptions, and enable only the required subscriptions:

    # subscription-manager register your_customer_portal_credentials
    # subscription-manager attach --pool=pool_ID
    # subscription-manager repos --disable=*
    # subscription-manager repos \
    --enable=rhel-7-server-rpms \
    --enable=rhel-server-rhscl-7-rpms \
    --enable=rhel-7-server-satellite-maintenance-6-rpms \
    --enable=rhel-7-server-satellite-6.3-rpms
  5. Install the satellite-clone package

    # yum install satellite-clone

    After you install the satellite-clone tool, you can adjust any configuration to suit your own deployment in the /etc/satellite-clone/satellite-clone-vars.yml file.

  6. Run the satellite-clone tool.

    # satellite-clone
  7. Reconfigure DHCP, DNS, TFTP and remote execution services. The cloning process disables these services on the target Satellite Server to avoid conflict with the source Satellite Server.
  8. Reconfigure and enable DHCP, DNS, TFTP in the Satellite web UI. For more information, see Configuring DNS, DHCP, and TFTP on Satellite Server in Installing Satellite Server from a Connected Network.
  9. Enable remote execution:

    # satellite-installer --scenario satellite \
    --enable-foreman-plugin-remote-execution \
    --enable-foreman-proxy-plugin-remote-execution-ssh
  10. Log on to the Satellite web UI, with the username admin and the password changeme. Immediately update the admin password to secure credentials.
  11. Ensure that the correct organization is selected.
  12. Navigate to Content > Subscriptions, then click Manage Manifest.
  13. Click the Refresh button, then click Close to return to the list of subscriptions.
  14. Verify that the available subscriptions are correct.
  15. Follow the instructions in the /usr/share/satellite-clone/logs/reassociate_capsules.txt file to restore the associations between Capsules and their lifecycle environments.
  16. Update your network configuration, for example, DNS, to match the target server’s IP address with its new host name. The satellite-clone tool changes the hostname to the source server’s hostname. If you want to change the hostname to something different, you can use the satellite-change-hostname tool. For more information, see Renaming a Satellite or Capsule Server in Administrating Red Hat Satellite.
  17. If the source server uses the virt-who daemon, install and configure it on the target server. Copy all the virt-who configuration files in the /etc/virt-who.d/ directory from the source server to the same directory on the target server. For more information, see Virt-who Installation and Configuration Overview in the Virtual instances Guide.

After you perform an upgrade using the following chapters, you can safely decommission the source server.