Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm working with a Xen host which is installed XenServer from Citrix by someone. He already installed a lot of CentOS 5.2 guests on the host. I wonder how to check those guests to know they are PV types or HVM types?

share|improve this question

2 Answers 2

up vote 3 down vote accepted

A quick note, there are actually 3 modes, not two when it comes to the drivers in use:

  • HVM: unmodified kernel and drivers using software emulated devices
  • PV-HVM: unmodified kernel with paravirtualized (Xen specific) disk and network drivers
  • PV: modified kernel and drivers

For a Xen guest/DomU you can do a very basic uname and lsmod with a grep to list the modules in use:

uname -a
lsmod | grep xen

If uname -a lists a kernel with the string "xen" in it, then you have a modified kernel and it's likely a PV guest, and you will see output from the lsmod command to confirm it. If you have output from the grep on lsmod but no sign of a modified kernel then you are PV-HVM. Without any sign of either, it's a straight HVM.

Note: Generally you can do more with VMs that have the PV tools installed, so that can be quite an obvious pointer, however you can fake the presence of the PV tools to allow suspend/resume etc. so you cannot rely on that in general.

share|improve this answer
    
Thanks @Adam. It's the clearest answer that I have found so far. –  Ha Son Hai May 30 '13 at 15:29

There is a better alternative to analyzing uname -a output from inside the guest domain. You should rather check the VM profile in the hypervisor itself.

With a standalone Xen installation, this could be achieved with xm list -l / xl list -l command:

# xm list
Name                 ID   Mem VCPUs    State   Time(s)
My-Virtual-Machine   13   259     1   -b----       8.0

# xm list --long My-Virtual-Machine
(domain
    (domid 13)
    (name My-Virtual-Machine)
    (image
        (linux
            (kernel ...)
            ...
        )
    )
    ...
)

Note the (linux) item in the (image) section — it corresponds to the builder configuration directive, where "linux" means "paravirtual" (rather than the actual system family), while "hvm" stands for "full virtualization".

With XenServer or XCP, you could use xe vm-list params=all command or something alike.

As for the virtualization modes, there is even more to come: Xen 4.3 introduced the new hybrid mode called PVH, which runs a fully PV system inside an HVM container without any hardware emulation. It's a special mode for 64-bit guests, the reason for this is that AMD64 architecture lacks some management features of i386 that Xen uses, which results in performance loss. It's not clear how PHV domains will be configured and how they will look in configuration dumps; my guess is that they may appear either as plain HVM domains (just like classic PV-on-HVM guests) or as a mixture HVM domain with some PV-specific directives.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.