Using the "Filter Host Parents" and "Exclude Host Parents" Attributes with VMware Clusters

Solution Verified - Updated

Environment

  • Red Hat Satellite Server version 6
  • Red Hat Enterprise Linux VM's on VMware vSphere hypervisors
  • VMware vCenter

Issue

When configuring the virt-who configuration for a vSphere environment, the vSphere Cluster Name is not being recognized when entering it in either the "Filter Host Parents" or "Exclude Host Parents" fields in the UI or on the command-line causing the Red Hat Enterprise Linux (RHEL) VM's from being included or excluded in the Red Hat Satellite Server's inventory.

Resolution

Unlike other virtualization platforms, when attempting to use either the "Filter Host Parents" or "Exclude Host Parents" fields in the Satellite Server UI, or the filter_host_parent or exclude_host_parent arguments on the command-line when configuring virt-who the "Cluster ID" in vSphere is not the same as the "Cluster Name". The "Filter Host Parents" and "Exclude Host Parents" fields will not accept of recognize the "Cluster Name" of a vSphere cluster. Instead the "Cluster ID" is what is needed by virt-who.

To gather the "Cluster ID" of a single vSphere cluster, use PowerCLI to connect to your vCenter, run the following command to get the Cluster ID: Get-Cluster “FRIENDLY_CLUSTER_NAME” | Select ID

Example:

PS C:\blah\blah\blah> Get-Cluster “FRIENDLY_CLUSTER_NAME” | Select ID
ClusterComputeResource-domain-c6869

Alternatively, use PowerCLI to list the "Cluster Names" and their respective ID's with this command: Get-Cluster | Select Name, ID
Example:

PS C:\blah\blah\blah> Get-Cluster | Select Name, ID

Name                  Id
----                  --
Cluster1              ClusterComputeResource-domain-c6869
Cluster2              ClusterComputeResource-domain-c7
Cluster3              ClusterComputeResource-domain-c1235
Cluster4              ClusterComputeResource-domain-c65

The information needed for the "Filter Host Parents" and "Exclude Host Parents" attributes is what comes after the first - in the "Id" column.

For example, the Cluster ID for the cluster named Cluster1 would be domain-c6869. The Cluster ID domain-c6869 is what needs to be provided either in the UI or in the command-line argument in order for the "Filter Host Parents" and "Exclude Host Parents" attributes to work as expected.

In this example, once the correct ID for each of the respective clusters has been provided to the virt-who configuration, it can be reapplied and the VM's within that vSphere cluster should begin to appear in the Satellite Server's inventory, or be excluded from the inventory if the "Exclude Host Parents" attribute is being used.

Root Cause

The vSphere or vCenter API does not recognize the "Name" (friendly name) of the resources it manages. Instead the vSphere or vCenter API references its resources by the "ID" associated to them.

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.