Difference between revisions of "Using Xen PV Drivers on HVM Guest"

From Xen
m (Reference)
m (Removed superfluous <nowiki></nowiki> tag pairs.)
Line 15: Line 15:
   
 
If you are specifying the disk as:
 
If you are specifying the disk as:
<pre><nowiki>
+
<pre>
 
disk = [ 'file:/system.img,hda,w', 'file:/disk1.img,sda,w', 'file:/disk2.img,xvda,w', ]
 
disk = [ 'file:/system.img,hda,w', 'file:/disk1.img,sda,w', 'file:/disk2.img,xvda,w', ]
</nowiki></pre>
+
</pre>
   
   
 
Then:
 
Then:
 
* hda will be emulated as an IDE device, which will be initialized by the ide driver of the Linux guest. The ide driver is often built into the Linux kernel. You can add the following kernel command line to prevent the kernel from initializing the device:
 
* hda will be emulated as an IDE device, which will be initialized by the ide driver of the Linux guest. The ide driver is often built into the Linux kernel. You can add the following kernel command line to prevent the kernel from initializing the device:
<pre><nowiki>
+
<pre>
 
ide0=noprobe
 
ide0=noprobe
</nowiki></pre>
+
</pre>
 
'''Note:''' for Linux kernel v2.6.25+, use "ide_core.noprobe=x.y" instead. "hdx=noprobe" and "idex=noprobe" have been removed.
 
'''Note:''' for Linux kernel v2.6.25+, use "ide_core.noprobe=x.y" instead. "hdx=noprobe" and "idex=noprobe" have been removed.
 
* sda will be emulated as a SCSI device, which will be initialized by the sym53c8xx driver. The sym53c8xx driver is often build as a kernel module. You can add the following line to /etc/modprobe.conf to prevent the module from auto-loading:
 
* sda will be emulated as a SCSI device, which will be initialized by the sym53c8xx driver. The sym53c8xx driver is often build as a kernel module. You can add the following line to /etc/modprobe.conf to prevent the module from auto-loading:
<pre><nowiki>
+
<pre>
 
alias sym53c8xx off
 
alias sym53c8xx off
</nowiki></pre>
+
</pre>
'''Note:''' if it doesn't work, you can get it by move the module out from <code><nowiki>/lib/modules/`uname -r`/</nowiki></code>.
+
'''Note:''' if it doesn't work, you can get it by move the module out from <code>/lib/modules/`uname -r`/</code>.
 
* xvda will nerver be emulated by qemu-dm. So no extra actions is needed. xvd device is always the best choice to use if you want use a PV driver. '''Note:''' as in http://www.lanana.org/docs/device-list/devices-2.6+.txt:
 
* xvda will nerver be emulated by qemu-dm. So no extra actions is needed. xvd device is always the best choice to use if you want use a PV driver. '''Note:''' as in http://www.lanana.org/docs/device-list/devices-2.6+.txt:
<pre><nowiki>
+
<pre>
 
202 block Xen Virtual Block Device
 
202 block Xen Virtual Block Device
 
0 = /dev/xvda First Xen VBD whole disk
 
0 = /dev/xvda First Xen VBD whole disk
Line 43: Line 43:
 
disks (see major number 3) except that the limit on
 
disks (see major number 3) except that the limit on
 
partitions is 15.
 
partitions is 15.
</nowiki></pre>
+
</pre>
 
The Xen VBD disk will always be xvdX under Linux.
 
The Xen VBD disk will always be xvdX under Linux.
   

Revision as of 23:48, 28 November 2011


This article describes how to use Xen para-virtualized drivers on HVM guest.

  • Host: Oracle VM Server 2.1.2
  • Guest: Oracle Enterprise Linux 5 (kernel 2.6.18)

Virtual Storage Devices

If the Linux guest initialed the qemu-dm emulated IDE/SCSI device, then Xen para-virtualized storage driver cannot initial it. So we should first prevent the guest from initial the emulated devices.

If you are specifying the disk as:

disk = [ 'file:/system.img,hda,w', 'file:/disk1.img,sda,w', 'file:/disk2.img,xvda,w', ]


Then:

  • hda will be emulated as an IDE device, which will be initialized by the ide driver of the Linux guest. The ide driver is often built into the Linux kernel. You can add the following kernel command line to prevent the kernel from initializing the device:
ide0=noprobe
Note: for Linux kernel v2.6.25+, use "ide_core.noprobe=x.y" instead. "hdx=noprobe" and "idex=noprobe" have been removed.
  • sda will be emulated as a SCSI device, which will be initialized by the sym53c8xx driver. The sym53c8xx driver is often build as a kernel module. You can add the following line to /etc/modprobe.conf to prevent the module from auto-loading:
alias sym53c8xx off
Note: if it doesn't work, you can get it by move the module out from /lib/modules/`uname -r`/.
202 block	Xen Virtual Block Device
		  0 = /dev/xvda       First Xen VBD whole disk
		  16 = /dev/xvdb      Second Xen VBD whole disk
		  32 = /dev/xvdc      Third Xen VBD whole disk
		    ...
		  240 = /dev/xvdp     Sixteenth Xen VBD whole disk

                Partitions are handled in the same way as for IDE
                disks (see major number 3) except that the limit on
                partitions is 15.
The Xen VBD disk will always be xvdX under Linux.

Reference