3.4. Retiring the old Satellite 5 Server

This section shows how to retire the old Satellite 5 Server after you have performed the complete migration from Red Hat Satellite 5 Server to a new Satellite 6 Server and you do not need the old Satellite 5 Server anymore. If you have migrated your Satellite 5 to the new RHSM system, proceed to 「Migrating Subscriptions to the New Satellite 6」.

If you have not migrated your Satellite 5 to the new RHSM system, create new manifests as described in Managing Subscriptions in the Content Management Guide and add them to the new Satellite 6. Optionally, run the following Python script to delete the profile of the old Satellite from RHN:

#!/usr/bin/env python

import getpass
import os
import sys
import libxml2
import xmlrpclib
from optparse import OptionParser

DEFAULT_SERVERFQDN="xmlrpc.rhn.redhat.com"
parser = OptionParser()
parser.add_option("-l", "--login", dest="login", help="Login user for RHN Satellite/Hosted", metavar="LOGIN")
parser.add_option("-p", "--password", dest="password", help="Password for specified user. Will prompt if omitted", metavar="PASSWORD")
parser.add_option("-s", "--server", dest="serverfqdn", help="FQDN of satellite server - omit https:// (default: %s)" % DEFAULT_SERVERFQDN, metavar="SERVERFQDN", default=DEFAULT_SERVERFQDN)
(options, args) = parser.parse_args()

if not options.login:
    print "Must specify login option.  See usage:"
    parser.print_help()
    print "\nExample usage: ./decommissionServer.py -l admin -p password"
    sys.exit(1)
else:
    login = options.login
    password = options.password
    serverfqdn = options.serverfqdn

if not password: password = getpass.getpass("%s's password:" % login)

SATELLITE_URL = "https://%s/rpc/api" % serverfqdn
SATELLITE_LOGIN = login
SATELLITE_PASSWORD = password
SYSTEMID_FILE = "/etc/sysconfig/rhn/systemid"

# Check For root
# Have to be root to open the SYSTEMID_FILE which is chmod'd 0600
if os.getuid() != 0:
    print "This script requires root-level access to run."
    sys.exit(1)

# Log into Satellite and get an authentication token
client = xmlrpclib.Server(SATELLITE_URL, verbose=0)
key = client.auth.login(SATELLITE_LOGIN, SATELLITE_PASSWORD)

# Parse /etc/sysconfig/rhn/systemid to ge the system ID
# Use the systemid and delete the systems RHN profile
parsed_file = libxml2.parseDoc(file(SYSTEMID_FILE).read())
systemid = parsed_file.xpathEval('string(//member[* ="system_id"]/value/string)').split('-')[1]
print systemid
try:
    client.system.deleteSystems(key,int(systemid))
    print "The system with SystemID " + systemid + " was successfully deleted"
except xmlrpclib.Fault, e:
    print "XMLRPC fault \n\t%s" % e

# Logout of Satellite
client.auth.logout(key)

3.4.1. Migrating Subscriptions to the New Satellite 6

This section describes how to migrate subscriptions from the old Satellite 5 Server to the new Satellite 6 Server.

  1. Configure new subscriptions:

    1. Log in to the Customer Portal and go to SUBSCRIPTIONS.
    2. Navigate to Inventory and click Satellite Organizations.
    3. Select the check box to the left of the name of the old Satellite 5 Server and click Delete Selected. In the alert box that appears, click Delete to delete the unit.
    4. Click on the name of the new Satellite 6 Server and select the check box to the left of the name of the transition subscription. Click Remove selected. In the alert box click Remove to remove the subscription.
    5. Click Attach a subscription, select the real Satellite subscription, and click Attach selected.
    6. Run the following command on the new Satellite 6 Server to refresh subscription manager.

      # subscription-manager refresh
  2. Enable repositories on the new Satellite 6 Server

    1. On the old Satellite 5 Server use the following command to view what channels you had enabled.

      # spacewalk-channel -l
    2. On the new Satellite 6 Server use the following command to list enabled repositories for an organization:

      # hammer product list --organization "organization_name"
    3. Configure the new Satellite 6 Server to ensure all necessary repositories are enabled.

      For Web UI users

      Navigate to Content → Red Hat Repositories and select repositories to be enabled.

      For CLI Users

      Enable repositories using either the name or ID number. Optionally, include the release version and base architecture.

      # hammer repository-set enable \
      --product "product_name" \
      --name "repository_name" \
      --organization "org_name" \
      --releasever "" \
      --basearch "x86_64"