How to change Life Cycle Environment and Content Views for Content Hosts using hammer command line and from Satellite Web UI?

Solution Verified - Updated

Environment

  • Red Hat Satellite 6

Issue

  • What are the steps to change the Content View and Life Cycle Environment to another for a specific content host to fetch the repositories.?
  • How to change Life Cycle Environment and Content Views for Content Hosts using the hammer command line and from Satellite Web UI?

Resolution

  • On Red Hat Satellite 6

  • First, identify the available organizations, content views, and lifecycle environments. Replace the organization name in the examples with your own:

      # hammer organization list
    
      # hammer content-view list --organization=My_Organization
    
      # hammer lifecycle-environment list --organization=My_Organization
    
  • To change the Lifecycle Environment and Content View for a specific content host using the hammer command line, run:

    # hammer host update --name client.example.com --lifecycle-environment "ENV_NAME" --content-view "CV_NAME" --organization-id <ORG_ID>
    
  • Note : Parameter --organization ORG_NAME can be used in place of --organization-id ORG_ID if you wish to use organization name instead of ID.

  • To achieve the same through Satellite Web UI:

      To achieve the same through Satellite Web UI:
    
      Navigate to Hosts → Content Hosts
    
      Select the hosts to be changed
    
      Click on Select Action → Change Lifecycle environment
    
      Choose the environment and associated content view you want the system to get
    
      Click Assign → Yes
    
  • To Apply the Changes on the Content Host:

    • Once the Lifecycle Environment and Content View are updated in Satellite, refresh the client host to pull new repository details:
      # subscription-manager refresh
    
      # yum clean all
    
    • Optional (manual cache removal):
    # rm -rfv /var/cache/{yum,dnf}/* 
    

This ensures that stale metadata and cached packages are cleared, allowing the host to fetch the latest repositories from Satellite.

SBR
Product(s)
Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.