Bookmark this page

Manage Hosts with Host Collections

Objectives

  • Organize registered hosts into host collections to manage them concurrently.

Configure Host Collections

In Red Hat Satellite 6, you can create a logical group of hosts called host collections for multiple content hosts with similar characteristics. Host collections simplify various aspects of host administration. Rather than performing actions separately on individual hosts, you can instead perform them on a host collection, which applies those actions to all hosts in that host collection. Actions that are performed on host collections include installing and updating packages, package groups, and errata.

You can create any number of host collections to organize hosts for repetitive actions that apply to various sets of hosts. Content hosts can simultaneously belong to multiple host collections. You can use host collections to group content hosts by function, department, or business unit.

Create a Host Collection

Host collections are defined at the organization level; you must select an organization before you create a host collection.

To create a host collection:

  • Navigate to HostsHost Collections.

  • Click Create Host Collection.

  • Enter a name for your host collection.

  • You can clear the Unlimited Hosts checkbox and set a maximum number of allowed hosts.

  • You can optionally add a brief description of the host collection.

To create a host collection via the CLI:

  • Run the hammer host-collection create command.

[root@satellite ~]# hammer host-collection create \
--name MyHostCollection \
--description "My host collection description" \
--organization MyOrganization

Note

Using an activation key that assigns hosts to a host collection will fail to assign the host if the host collection has already reached its maximum limit. Activation keys are covered later in this chapter.

Manage Host Collection Membership

A host must be registered to Red Hat Satellite to add it to a host collection.

  • Navigate to HostsHost Collections.

  • Click the name of the required host collection to display the details of that collection.

  • The Details tab displays information about the host collection, including the number of content hosts, and possible actions on content hosts.

  • The Hosts tab lists the hosts that are members of the host collection. In this tab, you can remove or add hosts to the host collection.

To add a host to a host collection via the CLI:

  • Run the hammer host-collection add-host command.

[root@satellite ~]# hammer host-collection add-host \
--name MyHostCollection \
--hosts MyHost \
--organization MyOrganization

To list the hosts from a host collection via the CLI:

  • Run the hammer host-collection hosts command.

[root@satellite ~]# hammer host-collection hosts \
--name MyHostCollection \
--organization MyOrganization
---|-------------
ID | NAME
---|-------------
2  | MyHost
---|-------------

To remove a host from a host collection via the CLI:

  • Run the hammer host-collection remove-host command.

[root@satellite ~]# hammer host-collection remove-host \
--name MyHostCollection \
--hosts MyHost \
--organization Operations
The host(s) has been removed.

Clone a Host Collection

You can clone an existing host collection to use it as a template for a new host collection.

After cloning, the new host collection has the same hosts as the source host collection. Because they are now separate collections, you can add or remove hosts in either collection without affecting the other host collection.

To clone a host collection:

  • Navigate to HostsHost Collections.

  • Click the name of the host collection to clone.

  • In the Select Action list, select Copy Host Collection.

  • Enter a name for the new host collection and click Create.

To clone a host collection via the CLI:

  • Run the hammer host-collection copy command.

[root@satellite ~]# hammer host-collection copy \
--name MyHostCollection \
--new-name MyOtherHC \
--organization MyOrganization
New host collection created.

Remove a Host Collection

Removing a host collection does not modify any content or registration configuration for the host members. The only change is that the hosts no longer belong to that removed collection.

To remove a host collection:

  • Navigate to HostsHost Collections.

  • Click the name of the host collection to remove.

  • In the Select Action list, select Remove.

  • Click Remove in the confirmation dialog box.

To remove a host collection via the CLI:

  • Use the hammer host-collection delete command.

[root@satellite ~]# hammer host-collection delete \
--name MyOtherHC \
--organization MyOrganization
Host collection deleted.

Manage Host Collection Content

You can use a host collection to add arbitrary hosts and to apply a specific configuration to them. This feature is useful to regularly apply a certain configuration to selected hosts. Ensure that the hosts that are added to the host collection fit the purpose of the collection. You can add or remove hosts at any time. Avoid many host collections with small variations, which can be hard to manage.

Consider the following example scenario. The development team of the Finance organization uses the webapp-dev1, webapp-dev2, and dbapp-dev1 hosts to develop an application. This team specified that the ksh shell must be installed in the hosts that they use. Other teams inside the Finance organization use the default bash shell only.

To satisfy this requirement, you create the FinanceDevTeam host collection and add the webapp-dev1, webapp-dev2, and dbapp-dev1 hosts.

[root@satellite ~]# hammer host-collection create \
--name FinanceDevTeam \
--description "Customizations for the Finance development team" \
--organization Operations
Host collection created.
[root@satellite ~]# hammer host list --fields THIN
---|--------------------------
ID | NAME
---|--------------------------
...output omitted...
2  | webapp-dev1
3  | webapp-dev2
4  | dbapp-dev1
...output omitted...
---|--------------------------
[root@satellite ~]# hammer host-collection add-host \
--name FinanceDevTeam \
--host-ids 2,3,4 \
--organization Operations
The host(s) has been added.

In the FinanceDevTeam host collection, you can use the Package Installation feature to install the ksh package in the hosts. You can use the hammer host-collection package install command to install the package in the host collection. However, if you use the CLI, then you might see the following message: "This command uses katello agent and will be removed in favor of remote execution in a future release."

Because of the previous warning message and because you can choose between different options and can use filters, it is recommended to use the GUI to use this feature.

From the HostsHost Collections menu, click FinanceDevTeam to view the details of the host collection. Click Package Installation, Removal, and Update and enter ksh in the Package Name text box. Then, click Install and click Yes to confirm the package installation.

The web page refreshes and shows an overview for the package installation.

Important

For the Package Installation and other features to work, you must configure SSH access from the Satellite Server to the target hosts. Package Installation uses a Satellite feature to run jobs on managed hosts. This feature is called Remote Execution and will be covered in a later chapter.

You can also use host collections to change the assigned lifecycle environment or content view, or to install product errata in the hosts.

From the same example, the dbapp-dev1 host can be part of a FinanceErrataDB host collection that installs the errata for database hosts in the Finance organization.

References

For more information, refer to the Configuring Host Collections chapter in the Red Hat Satellite 6.11 Managing Hosts Guide at https://access.redhat.com/documentation/en-us/red_hat_satellite/6.11/html-single/managing_hosts/index#Configuring_Host_Collections_managing-hosts

Revision: rh403-6.11-3ad886e