How to filter VMware clusters with virt-who?

Solution Verified - Updated -

Environment

  • Red Hat Satellite 6
  • Red Hat Enterprise Linux
  • VMware ESX

Issue

  • How to filter VMware clusters instead of hosts/hypervisors in virt-who?
  • How to make sure that only the required clusters are reporting to satellite 6 using virt-who?
  • How to exclude some ESX clusters from getting reported to Satellite 6 when using virt-who?

Resolution

  • Edit the configuration file and add the paramters:

    # vi /etc/virt-who.d/config.conf
    [config]
    type=hypervisor_type
    server=vcenter/esx_host
    username=vcenter/esx_username
    owner=owner
    env=Library
    filter_host_parents=domain-xx,domain-yy OR
    exclude_host_parents=domain-zz,domain-xx
    

    NOTE: Use either filter_host_parents or exclude_host_parents.

    filter_host_parents => Clusters to be reported.
    exclude_host_parents => Clusters not to be reported.

Supported Hypervisor Environment:

  • ESX

    • PowerCLI command to find the Cluster Names in Vmware:


      > Get-Cluster Name HAEnabled HAFailover DrsEnabled DrsAutomationLevel Level ---- --------- ---------- ---------- ------------------ Cluster-ESXA-00X False 1 True FullyAutomated Cluster-ESXB-00X True 1 True FullyAutomated
    • PowerCLI command to find the Cluster ID in Vmware:

      > Get-Cluster "ClusterName" | Select ID
      
    • Replace the ClusterName with the actual ClusterName and execute the query:

      For example:-
      > Get-Cluster "Cluster-ESXA-00X" | Select ID
      

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.

2 Comments

Hi. Just to mention that this configuration only worked if the ID of the vCluster is specified. The name didn't work.

Not only this, but also the ID has to be stripped from the initial part, leaving only "domain-XXXXX".

For instance, cluster with ID "ClusterComputeResource-domain-c6979" had to be specified as "domain-c6979" for the filters to work.

I cannot make it work at all. Names, full IDs, stripped IDs, nothing works. It either scans everything in vSphere or nothing.