Chapter 2. Administering Hosts

This chapter describes creating, registering, administering, and removing hosts.

2.1. Creating a Host in Red Hat Satellite

Use this procedure to create a host in Red Hat Satellite.

Procedure

  1. In the Satellite web UI, click Hosts > Create Host.
  2. On the Host tab, enter the required details.
  3. Click the Ansible Roles tab, and from the Ansible Roles list, select one or more roles that you want to add to the host. Use the arrow icon to manage the roles that you add or remove.
  4. On the Puppet Classes tab, select the Puppet classes you want to include.
  5. On the Interfaces tab:

    1. For each interface, click Edit in the Actions column and configure the following settings as required:

      • Type — For a Bond or BMC interface, use the Type list and select the interface type.
      • MAC address — Enter the MAC address.
      • DNS name — Enter the DNS name that is known to the DNS server. This is used for the host part of the FQDN.
      • Domain — Select the domain name of the provisioning network. This automatically updates the Subnet list with a selection of suitable subnets.
      • IPv4 Subnet — Select an IPv4 subnet for the host from the list.
      • IPv6 Subnet — Select an IPv6 subnet for the host from the list.
      • IPv4 address — If IP address management (IPAM) is enabled for the subnet, the IP address is automatically suggested. Alternatively, you can enter an address. The address can be omitted if provisioning tokens are enabled, if the domain does not mange DNS, if the subnet does not manage reverse DNS, or if the subnet does not manage DHCP reservations.
      • IPv6 address — If IP address management (IPAM) is enabled for the subnet, the IP address is automatically suggested. Alternatively, you can enter an address.
      • Managed — Select this check box to configure the interface during provisioning to use the Capsule provided DHCP and DNS services.
      • Primary — Select this check box to use the DNS name from this interface as the host portion of the FQDN.
      • Provision — Select this check box to use this interface for provisioning. This means TFTP boot will take place using this interface, or in case of image based provisioning, the script to complete the provisioning will be executed through this interface. Note that many provisioning tasks, such as downloading RPMs by anaconda, Puppet setup in a %post script, will use the primary interface.
      • Virtual NIC — Select this check box if this interface is not a physical device. This setting has two options:

        • Tag — Optionally set a VLAN tag. If unset, the tag will be the VLAN ID of the subnet.
        • Attached to — Enter the device name of the interface this virtual interface is attached to.
    2. Click OK to save the interface configuration.
    3. Optionally, click Add Interface to include an additional network interface. See Chapter 4, Adding Network Interfaces for details.
    4. Click Submit to apply the changes and exit.
  6. On the Operating System tab, enter the required details. For Red Hat operating systems, select Synced Content for Media Selection. If you want to use non Red Hat operating systems, select All Media, then select the installation media from the Media Selection list. You can select a partition table from the list or enter a custom partition table in the Custom partition table field. You cannot specify both.
  7. On the Parameters tab, click Add Parameter to add any parameter variables that you want to pass to job templates at run time. This includes all Puppet Class, Ansible playbook parameters and host parameters that you want to associate with the host. To use a parameter variable with an Ansible job template, you must add a Host Parameter.

    When you create a Red Hat Enterprise Linux 8 host, you can set system purpose attributes. System purpose attributes define what subscriptions to attach automatically on host creation. In the Host Parameters area, enter the following parameter names with the corresponding values. For the list of values, see Configuring system purpose in the Performing a standard RHEL installation guide.

    • syspurpose_role
    • syspurpose_sla
    • syspurpose_usage
    • syspurpose_addons
  8. On the Additional Information tab, enter additional information about the host.
  9. Click Submit to complete your provisioning request.

For CLI Users

To create a host associated to a host group, enter the following command:

# hammer host create \
--name "host_name" \
--hostgroup "hostgroup_name" \
--interface="primary=true, \
            provision=true, \
            mac=mac_address, \
            ip=ip_address" \
--organization "Your_Organization" \
--location "Your_Location" \
--ask-root-password yes

This command prompts you to specify the root password. It is required to specify the host’s IP and MAC address. Other properties of the primary network interface can be inherited from the host group or set using the --subnet, and --domain parameters. You can set additional interfaces using the --interface option, which accepts a list of key-value pairs. For the list of available interface settings, enter the hammer host create --help command.

2.2. Editing the System Purpose of a Host

You can edit the system purpose attributes of Red Hat Enterprise Linux 8 hosts. System purpose attributes define which subscriptions to attach automatically to hosts. For more information about system purpose, see Configuring system purpose in the Performing a standard RHEL installation guide.

Procedure

  1. In the Satellite web UI, navigate to Hosts > Content Hosts and click the name of the Red Hat Enterprise Linux 8 host that you want to edit.
  2. In the System Purpose area, click the Edit or Remove icon for the system purpose attributes that you want to edit, add, or remove.
  3. Click Save.
  4. Click the Subscriptions tab and select Subscriptions.
  5. Click Run Auto-Attach to attach subscriptions to your host automatically.
  6. Refresh the page to verify that the subscriptions list contains the correct subscriptions.

For CLI Users

  1. Log in to the host and edit the required system purpose attributes. For example, set the usage type to Production, the role to Red Hat Enterprise Linux Server, and add the addon add on. For the list of values, see Configuring system purpose in the Performing a standard RHEL installation guide.

    # syspurpose set-usage Production
    # syspurpose set-role Red Hat Enterprise Linux Server
    # syspurpose add-addons 'your_addon'
  2. Verify the system purpose attributes for this host:

    # syspurpose show
  3. Automatically attach subscriptions to this host:

    # subscription-manager attach --auto
  4. Verify the system purpose status for this host:

    # subscription-manager status

2.3. Changing a Module Stream for a Host

If you have a Red Hat Enterprise Linux 8 host, you can modify the module stream for the repositories you install.

After you create the host, you can enable, disable, install, update, and remove module streams from your host in the Satellite web UI.

Procedure

  1. In the Satellite web UI, navigate to Hosts > Content Hosts and click the name of the host that contains the modules you want to change.
  2. Click the Module Streams tab.
  3. From the Available Module Streams list, locate the module that you want to change. You can use the Filter field to refine the list entries. You can also use the Filter Status list to search for modules with a specific status.
  4. From the Actions list, select the change that you want to make to the module.
  5. In the Job Invocation window, ensure that the job information is accurate. Change any details that you require, and then click Submit.

2.4. Creating a Host Group

If you create a high volume of hosts, many of the hosts can have common settings and attributes. Adding these settings and attributes for every new host is time consuming. If you use host groups, you can apply common attributes to hosts that you create.

A host group functions as a template for common host settings, containing many of the same details that you provide to hosts. When you create a host with a host group, the host inherits the defined settings from the host group. You can then provide additional details to individualize the host.

Host Group Hierarchy

You can create a hierarchy of host groups. Aim to have one base level host group that represents all hosts in your organization and provide general settings, and then nested groups to provide specific settings. For example, you can have a base level host group that defines the operating system, and two nested host groups that inherit the base level host group:

  • Hostgroup: Base (Red Hat Enterprise Linux 7.6)

    • Hostgroup: Webserver (applies the httpd Puppet class)

      • Host: webserver1.example.com (web server)
      • Host: webserver2.example.com (web server)
    • Hostgroup: Storage (applies the nfs Puppet class)

      • Host: storage1.example.com (storage server)
      • Host: storage2.example.com (storage server)
    • Host: custom.example.com (custom host)

In this example, all hosts use Red Hat Enterprise Linux 7.6 as their operating system because of their inheritance of the Base host group. The two web server hosts inherit the settings from the Webserver host group, which includes the httpd Puppet class and the settings from the Base host group. The two storage servers inherit the settings from the Storage host group, which includes the nfs Puppet class and the settings from the Base host group. The custom host only inherits the settings from the Base host group.

Procedure

  1. In the Satellite web UI, navigate to Configure > Host Groups and click Create Host Group.
  2. If you have an existing host group that you want to inherit attributes from, you can select a host group from the Parent list. If you do not, leave this field blank.
  3. Enter a Name for the new host group.
  4. Enter any further information that you want future hosts to inherit.
  5. Click the Ansible Roles tab, and from the Ansible Roles list, select one or more roles that you want to add to the host. Use the arrow icon to manage the roles that you add or remove.
  6. Click the additional tabs and add any details that you want to attribute to the host group.

    Note

    Puppet fails to retrieve the Puppet CA certificate while registering a host with a host group associated with a Puppet environment created inside a Production environment.

    To create a suitable Puppet environment to be associated with a host group, manually create a directory and change the owner:

    # mkdir /etc/puppetlabs/code/environments/example_environment
    # chown apache /etc/puppetlabs/code/environments/example_environment
  7. Click Submit to save the host group.

For CLI Users

Create the host group with the hammer hostgroup create command. For example:

# hammer hostgroup create --name "Base" \
--lifecycle-environment "Production" --content-view "Base" \
--puppet-environment "production" --content-source-id 1 \
--puppet-ca-proxy-id 1 --puppet-proxy-id 1 --domain "example.com" \
--subnet `ACME's Internal Network` --architecture "x86_64" \
--operatingsystem "RedHat 7.2" --medium-id 9 \
--partition-table "Kickstart default" --root-pass "p@55w0rd!" \
--locations "New York" --organizations "ACME"

2.5. Creating a Host Group for Each LifeCycle Environment

Use this procedure to create a host group for the Library lifecycle environment and add nested host groups for other lifecycle environments.

Procedure

To create a host group for each life cycle environment, run the following Bash script:

MAJOR="7"
ARCH="x86_64"
ORG="Your Organization"
LOCATIONS="Your Location"
PTABLE_NAME="Kickstart default"
DOMAIN="example.com"

hammer --output csv --no-headers lifecycle-environment list --organization "${ORG}" | cut -d ',' -f 2 | while read LC_ENV; do
  [[ ${LC_ENV} == "Library" ]] && continue

  hammer hostgroup create --name "rhel-${MAJOR}server-${ARCH}-${LC_ENV}" \
    --architecture "${ARCH}" \
    --partition-table "${PTABLE_NAME}" \
    --domain "${DOMAIN}" \
    --organizations "${ORG}" \
    --query-organization "${ORG}" \
    --locations "${LOCATIONS}" \
    --lifecycle-environment "${LC_ENV}"
done

2.6. Changing the Group of a Host

Use this procedure to change the group of a host.

Procedure

  1. In the Satellite web UI, navigate to Hosts > All hosts.
  2. Select the check box of the host you want to change.
  3. From the Select Action list, select Change Group. A new option window opens.
  4. From the Host Group list, select the group that you want for your host.
  5. Click Submit.

2.7. Changing the Environment of a Host

Use this procedure to change the environment of a host.

Procedure

  1. In the Satellite web UI, navigate to Hosts > All hosts.
  2. Select the check box of the host you want to change.
  3. From the Select Action list, select Change Environment. A new option window opens.
  4. From the Environment list, select the new environment for your host.
  5. Click Submit.

2.8. Changing the Managed Status of a Host

Hosts provisioned by Satellite are Managed by default. When a host is set to Managed, you can configure additional host parameters from Satellite Server. These additional parameters are listed on the Operating System tab. If you change any settings on the Operating System tab, they will not take effect until you set the host to build and reboot it.

If you need to obtain reports about configuration management on systems using an operating system not supported by Satellite, set the host to Unmanaged.

Use this procedure to switch a host between Managed and Unmanaged status.

Procedure

  1. In the Satellite web UI, navigate to Hosts > All hosts.
  2. Select the host.
  3. Click Edit.
  4. Click Manage host or Unmanage host to change the host’s status.
  5. Click Submit.

2.9. Assigning a Host to a Specific Organization

Use this procedure to assign a host to a specific organization. For general information about organizations and how to configure them, see Managing Organizations in the Content Management Guide.

Procedure

  1. In the Satellite web UI, navigate to Hosts > All hosts.
  2. Select the check box of the host you want to change.
  3. From the Select Action list, select Assign Organization. A new option window opens.
  4. From the Select Organization list, select the organization that you want to assign your host to. Select the check box Fix Organization on Mismatch.

    Note

    A mismatch happens if there is a resource associated with a host, such as a domain or subnet, and at the same time not associated with the organization you want to assign the host to. The option Fix Organization on Mismatch will add such a resource to the organization, and is therefore the recommended choice. The option Fail on Mismatch will always result in an error message. For example, reassigning a host from one organization to another will fail, even if there is no actual mismatch in settings.

  5. Click Submit.

2.10. Assigning a Host to a Specific Location

Use this procedure to assign a host to a specific location. For general information about locations and how to configure them, see Creating a Location in the Content Management Guide.

Procedure

  1. In the Satellite web UI, navigate to Hosts > All hosts.
  2. Select the check box of the host you want to change.
  3. From the Select Action list, select Assign Location. A new option window opens.
  4. Navigate to the Select Location list and choose the location that you want for your host. Select the check box Fix Location on Mismatch.

    Note

    A mismatch happens if there is a resource associated with a host, such as a domain or subnet, and at the same time not associated with the location you want to assign the host to. The option Fix Location on Mismatch will add such a resource to the location, and is therefore the recommended choice. The option Fail on Mismatch will always result in an error message. For example, reassigning a host from one location to another will fail, even if there is no actual mismatch in settings.

  5. Click Submit.

2.11. Removing a Host from Red Hat Satellite

Use this procedure to remove a host from Red Hat Satellite.

Procedure

  1. In the Satellite web UI, navigate to Hosts > All hosts or Hosts > Content Hosts. Note that there is no difference from what page you remove a host, from All hosts or Content Hosts. In both cases, Satellite removes a host completely.
  2. Select the hosts that you want to remove.
  3. From the Select Action list, select Delete Hosts.
  4. Click Submit to remove the host from Red Hat Satellite permanently.
Warning

If a host record that is associated with a virtual machine is deleted, the virtual machine will be deleted as well. To avoid deleting the virtual machine in this situation, disassociate the virtual machine from Satellite without removing it from the hypervisor.

Disassociating A Virtual Machine from Satellite without Removing it from a Hypervisor

  1. In the Satellite web UI, navigate to Hosts > All Hosts and select the check box to the left of the hosts to be disassociated.
  2. From the Select Action list, select the Disassociate Hosts button.
  3. Optionally, select the check box to keep the hosts for future action.
  4. Click Submit.