How to filter hypervisors by their hostnames using virt-who in Red Hat Satellite 6
Environment
- Red Hat Satellite 6.2.x
- Red hat Enterprise Linux 7.x
- Red hat Enterprise Linux 6.x
- virt-who-0.18-3.elx.noarch (or newer virt-who versions)
Issue
- How to filter the
hypervisor hostswhich are reported byvirt-who, by their hostnames? - How make sure that only the required
hosts/hypervisorsare reported on satellite 6 usingvirt-who?
Resolution
- Edit the
virt-whoconfiguration file/etc/sysconfig/virt-whoand ensure that the below parameter have been enabled:
VIRTWHO_SATELLITE6=1
- For example, for VMware virtualization backend, create a new configuration file for
virt-whoinside/etc/virt-who.d/.
[root@localhost ~]# vi /etc/virt-who.d/esx.conf
[config]
type=<hypervisor_type>
server=<vcenter/esx host>
username=<vcenter/esx_username>
owner=<org_label>
env=Library
hypervisor_id=hostname
filter_hosts="host1.example.com","host2.example.com","host3.example.com" `OR`
exclude_hosts=host1.example.com,host2.example.com,host3.example.com
NOTE: The org_label entry in the /etc/virt-who.d/ configuration file is provided by executing the below command on the Satellite 6.
[root@localhost ~]# hammer organization list
- Identify which organization you want the virtual hosts to be assigned to, and use the matching entry in the
LABELcolumn
NOTE: Use any one from filter_hosts or exclude_hosts
filter_hosts - If provided, only hosts with hostnames in this list will be reported,
exclude_hosts - If provided, do not report hosts with hostnames in this list.
Hypervisor Type:
- The hypervisor type can be libvirt, vdsm, esx, rhevm and hyperv.
Restart virt-who Service:
- Restart the virt-who service after the configuration change.
[root@localhost ~]# service virt-who restart
Note: For additional information regarding the virt-who configuration steps please see Virtual Instances Guide
For more KB articles/solutions related to Virt-who and Virtual Datacenter (VDC) Subscriptions Issues, please refer to the Consolidated Troubleshooting Article for Virt-who and Virtual Datacenter (VDC) Subscriptions Issues
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.