Extract a list of virtual guests and corresponding "Virtual Host" (Hypervisor)
I have a list of virtual content hosts and I need to produce a list of their corresponding hypervisors. I have been trying to leverage hammer to no effect. I would imagine this could be produced by using,
hammer fact list --search
or
hammer host list --search
but I have yet to find the proper "fact" or field to search for. One can see the desired information on the Satellite UI, under the details for each host, listed as "Virtual Host", when the content host in question is a VM and is identified as a guest on a hypervisor.
Any insights? I am running Satellite 6.2.14.
Thanks.
Responses
Take a look at Subscription-manager for the former Red Hat Network User: Part 12 - Subscription Reporting Tools
An example command would be
hammer csv content-hosts \
--export \
--file content-hosts-export.csv \
--itemized-subscriptions \
--verbose \
--organization Example
A workaround is using the api instead. Involves looping all host records so it´s quite heavy ...then again that´s what hammer csv content-hosts does anyway ...
- Get all host records using /api/hosts
- Get details for each host using /api/hosts/%numeric-id-of-host% and you will get:
{
"subscription_facet_attributes" => {
"compliance_reasons" => [],
"virtual_host" => {
"name" => "name-of-virtual-host",
"id" => 1234
}
}
}
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
