[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-users] Xen How to pass the whole physical hard disk (raw disk) to vm


  • To: Felix Kuperjans <felix@xxxxxxxxxxxxxxxxxx>, "mailing list xen.org" <xen-users@xxxxxxxxxxxxx>
  • From: Jason Yu <yugn@xxxxxx>
  • Date: Mon, 14 Apr 2014 22:58:57 +0930
  • Delivery-date: Mon, 14 Apr 2014 13:30:45 +0000
  • List-id: Xen user discussion <xen-users.lists.xen.org>
  • Thread-topic: [Xen-users] Xen How to pass the whole physical hard disk (raw disk) to vm

Thanks Felix! I can start the NAS vm with the /dev/sda with your method,
but I noticed that libvirt changed the bus ³virtio² to ³ide². Anyway, it
works now!

I updated xml with this:

<disk type='block' device='disk'>
<source dev='/dev/sda' />
<target dev='hdb' bus='virtio' />
</disk>


And I have got this after 'virsh edit':

<disk type='block' device='disk¹>
<driver name=?phy¹/>
<source dev='/dev/sda' />
<target dev='hdb' bus=?ide' />
</disk>


Virtio sounds to me a virtualised I/O bus. Does it mean I need to install
PV driver in the vm (it is OpenMediaVault based on Debian)?

And after passing the whole physical disk (either using ide or virtio
bus), can the vm still perform S.M.A.R.T or spin-down?



On 14-04-14 0:30, "Felix Kuperjans" <felix@xxxxxxxxxxxxxxxxxx> wrote:

>On 13.04.2014 05:03, Guangning YU wrote:
>> Thanks Miguel! I used very similar syntax as yours.
>>
>> This was what I used:
>>
>> /<disk type='block' device='disk'>/
>>
>> /<driver name='qemu' type='raw'/>/
>>
>> /<source dev='/dev/sda'/>/
>>
>> /<target dev=?hdb' bus='virtio'/>/
>>
>> /</disk>/
>>
>>
>> However , I couldn¹t start the vm with */virsh start/* with error I
>> described in the first thread. From my understanding, /*virsh edit*/
>> command will verify the syntax user enters and adjust accordingly. The
>> red text in my first thread was the final syntax that was gone through
>> to Xen. The syntax ³type=?raw¹ was gone for some reason.
>>
>> The xml guide that I referred to is URL
>> (http://libvirt.org/formatdomain.html#elementsHostDevSubsys).
>>
>> THE guide isn¹t clear enough. I tried device ?lun¹ as well, similar
>> error. (I can reproduce the change and provide log if required)
>>
>> The whole project is not as easy as I thought. I would rather pay a
>> reasonable amount of money to get this work on a reliable binary code.
>
>Hello,
>
>from the libvirt Domain.xml manual:
>|
>"driver|
>
>    The optional driver element allows specifying further details
>    related to the hypervisor driver used to provide the disk. Since 0.1.8
>
>      * If the hypervisor supports multiple backend drivers, then the
>        |name| attribute selects the primary backend driver name, while
>        the optional |type| attribute provides the sub-type. For
>        example, xen supports a name of "tap", "tap2", "phy", or "file",
>        with a type of "aio", while qemu only supports a name of "qemu",
>        but multiple types including "raw", "bochs", "qcow2", and "qed".
>
>"
>
>This explains that the driver section (which is anyway optional) does
>neither support name="qemu" on Xen nor type="raw". On Xen, you would
>have to use name="phy" for using host devices and e.g. name="tap2"
>type="aio" for disk image files with AIO access. But I think libvirt
>will figure this out automatically, so just leaving out the driver is
>maybe the best idea:
>
><disk type='block' device='disk'>
><source dev='/dev/sda' />
><target dev='hdb' bus='virtio' />
></disk>
>
>or
>
><disk type='block' device='disk'>
><driver name='phy' />
><source dev='/dev/sda' />
><target dev='hdb' bus='virtio' />
></disk>
>
>Best regards,
>Felix
>
>
>_______________________________________________
>Xen-users mailing list
>Xen-users@xxxxxxxxxxxxx
>http://lists.xen.org/xen-users



_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxx
http://lists.xen.org/xen-users


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.