We have a small fleet of KVM/libvirt hosts with a few hundred virtual machines on it, managed by a group of sysadmins in disparate locations. I've run into a problem where I am connected to a virtual machine by SSH, but I can't figure out the name of the bare metal host which owns it. Does anyone know a way to find the name of the bare metal host from inside a virtual machine?
If this isn't something KVM does out of the box, are there any examples of configurations we could apply on all our hypervisors to expose this information?
We do use inventory management software to keep track of our virtual machines & their bare metal hosts - however it has bugs, and from time to time we lose track of what host owns a virtual machine. I'll fix this problem - but the concept of finding a KVM host from inside a VM would be useful regardless.
I know this goes against many security principles employed in shared environments where each virtual machine is a product sold to a different customer - but in our environment where we own the hosts, the security is not an issue.