VM Feature Identification: Difference between revisions

From Xen
Jump to navigationJump to search
No edit summary
 
(8 intermediate revisions by the same user not shown)
Line 3: Line 3:
== MODE DETECTION ==
== MODE DETECTION ==


The output of the <pre>dmesg</pre> command contains many useful bits of information about the processor mode:
The output of the <b>dmesg</b> command contains many useful bits of information about the processor mode:


=== HVM-type: ===
=== HVM-type: ===
Line 11: Line 11:
[ 0.000000] Hypervisor detected: Xen HVM
[ 0.000000] Hypervisor detected: Xen HVM
</pre>
</pre>
and:
<pre>
[ 0.000000] Booting paravirtualized kernel on Xen HVM
</pre>

If it is actually PVHVM, you could see messages like:
<pre>
[ 0.127240] Xen: using vcpuop timer interface
</pre>
or:
<pre>
[ 1.424040] Initialising Xen virtual ethernet driver.
</pre>
or:
<pre>
[ 0.000000] Xen HVM callback vector for event delivery is enabled
</pre>
indicating that PV drivers are being utilized within the HVM machine.

Also, some newer versions might have:
<pre>
[ 0.000000] xen: PV spinlocks enabled
</pre>
indicating that PV spinlocks are used, so an HVM VM with this message must be PVHVM.


=== PV-type: ===
=== PV-type: ===
Line 17: Line 41:
[ 0.000000] Booting paravirtualized kernel on Xen
[ 0.000000] Booting paravirtualized kernel on Xen
</pre>
</pre>
Note the lack of reference to HVM, as seen in the messages above.


This message indicates that PV timers are in use:
This message indicates that PV timers are in use:
Line 23: Line 48:
</pre>
</pre>


If PV network drivers are in use, you might see:
== REFERENCES ==
<pre>
[ 0.432488] Initialising Xen virtual ethernet driver.
</pre>

=== OTHER HINTS ===
* Disk names: names in the format <b>xvdXN</b> (e.g., xvda1, or xvdc3) indicates that the PV disk driver is in use.
* Network drivers: a network driver of <b>vif</b> is a PV driver

=== DECODE INDIVIDUAL FEATURES ===
Brendan Gregg has written a Perl-based script called <b>xen-features.pl</b> which can be retrieved from git [https://github.com/brendangregg/Misc/blob/master/xen/xen-features.pl here].

It takes the value stored in <b>/sys/hypervisor/properties/features</b> and decodes it into output like:
<pre>
Xen features: 00000705
enabled: writable_page_tables
enabled: auto_translated_physmap
enabled: hvm_callback_vector
enabled: hvm_safe_pvclock
enabled: hvm_pirqs
</pre>

=== REFERENCES ===
* A [http://www.brendangregg.com/blog/2014-05-09/xen-feature-detection.html truly great article] by Brendan Gregg
* A [http://www.brendangregg.com/blog/2014-05-09/xen-feature-detection.html truly great article] by Brendan Gregg

Latest revision as of 17:24, 13 October 2014

When you control your own hypervisor, you are aware of the features you are using, since you have configured the system and the VMs. However, if you are using a service provider for your hosting or cloud, you need to do some detective work to determine the hypervisor mode and features employed.

MODE DETECTION

The output of the dmesg command contains many useful bits of information about the processor mode:

HVM-type:

If your VM is either HVM or PVHVM, look for:

[    0.000000] Hypervisor detected: Xen HVM

and:

[    0.000000] Booting paravirtualized kernel on Xen HVM

If it is actually PVHVM, you could see messages like:

[    0.127240] Xen: using vcpuop timer interface

or:

[    1.424040] Initialising Xen virtual ethernet driver.

or:

[    0.000000] Xen HVM callback vector for event delivery is enabled

indicating that PV drivers are being utilized within the HVM machine.

Also, some newer versions might have:

[    0.000000] xen: PV spinlocks enabled

indicating that PV spinlocks are used, so an HVM VM with this message must be PVHVM.

PV-type:

If your VM is PV or PVH, look for:

[    0.000000] Booting paravirtualized kernel on Xen

Note the lack of reference to HVM, as seen in the messages above.

This message indicates that PV timers are in use:

[    0.000000] Xen: using vcpuop timer interface

If PV network drivers are in use, you might see:

[    0.432488] Initialising Xen virtual ethernet driver.

OTHER HINTS

  • Disk names: names in the format xvdXN (e.g., xvda1, or xvdc3) indicates that the PV disk driver is in use.
  • Network drivers: a network driver of vif is a PV driver

DECODE INDIVIDUAL FEATURES

Brendan Gregg has written a Perl-based script called xen-features.pl which can be retrieved from git here.

It takes the value stored in /sys/hypervisor/properties/features and decodes it into output like:

Xen features: 00000705
enabled: writable_page_tables
enabled: auto_translated_physmap
enabled: hvm_callback_vector
enabled: hvm_safe_pvclock
enabled: hvm_pirqs

REFERENCES