The following provides an overview for a quick little project I threw together motivated by some inquiries in the ##xen IRC channel on Freenode.org. It involves a kernel module; full source is included.
Audience: Xen users/admins running linux in HVM context (without the pv-on-hvm kernel module in use) who have avoided paravirtualization for various reasons, yet require information about the underlying virtualization platform.
The following is directly excerpted from the README file.
This is a kernel module for use with linux virtual machines, running in HVM mode atop the Xen hypervisor.
In essence, it functions as a Xen hypercall skeleton for HVM guests, querying the hypervisor for information. Linux is rarely run in this mode unless there is some operational requirement imposing full hardware virtualization instead of paravirtualization. That said, it is occasionally useful for management purposes to obtain a VM UUID from within the guest rather than via the control plane.
Offers information via /proc/zentific including the uuid of the VM and major/minor version information from the underlying hypervisor.
Yes, /proc is 'deprecated.' It was convenient. :) I'll update this if anyone ever actually cares.
Instructions
---------------------------------------------------------------------------
1) Build the module
a) make sure kernel headers are installed
b) make sure a full development toolchain is installed
c) run 'make'
2) /sbin/insmod zentific.ko
2a) alternatively use modprobe if preference/requirement dictates.
3) run dmesg to see some status and initialization output
3) cat /proc/zentific/{uuid,xen_ver}
4) /sbin/rmmod zentific
Download: http://www.zentific.com/files/zentific-kernel.tar.gz