[libvirt-users] Can a VM tell what host it's on?

Eric Blake eblake at redhat.com
Thu Feb 2 18:52:37 UTC 2012


On 02/02/2012 11:33 AM, Whit Blauvelt wrote:
> Is there a way internal to a KVM VM to know which host it's running on? 

No.  The ideal hypervisor is one where the guest doesn't even know it is
running as a virtual machine.  And consider live migration - a guest
might not be running on the same host over its lifetime.  Therefore,
there should be nothing that requires a guest to know which host it is
running on.

> 
> It could send a command via ssh to virsh on a host, and learn from that
> whether the host currently has it running. But is there something within the
> VM itself which will reveal this? 

Why do you think you need it?  Perhaps if you ask a better question
about what you are really trying to solve, we can give a better answer.

-- 
Eric Blake   eblake at redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 620 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20120202/821b6a8e/attachment.sig>


More information about the libvirt-users mailing list