[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

I'm not very familiar with virsh, I mostly use xl/xl.cfg files, but from the guide I see this:

 <disk type='block' device='disk'>
      <driver name='qemu' type='raw'/>
      <source dev='/dev/sdb'/>

Basically adds the "type='raw'"

Does that work?

On Sat, Apr 12, 2014 at 1:18 PM, Guangning YU <yugn@xxxxxx> wrote:

I recently started my project to build a home server using Xen. The idea is that one vm runs openmediavault (debian) for NAS and another vm runs Win7 (with gnu passthrough) for media player.

I managed to passthrough two WD 3TB disk (full of media files, one GPT partition, no boot) to the NAS vm. But I couldn’t find a working solution.
I searched the net and find the following using libvirt. Libvirt works quite well in my system. And I hardly have any problem to create vm while xm toolstack gave me a lot of trouble.

=== hard disks to be passed as raw ===

/dev/sda is for WD3TB01 (ext4)

/dev/sdb is for WD3TB02 (ext4)

Here is the part of the NAS-OMV.xml to define a HVM windows to passthrough two hard disks. I updated the vm using 

EDIT=nano virsh edit NAS-OMV

And I entered the following

<disk type='block' device='disk'>

  <driver name='qemu' type='raw'/>

  <source dev='/dev/sda'/>

  <target dev=‘hdb' bus='virtio'/>


<disk type='block' device='disk'>

  <driver name='qemu' type='raw'/>

  <source dev='/dev/sdb'/>

  <target dev=‘hdc' bus='virtio'/>


Error after “virsh start NAS-OMV”

error: Failed to start domain NAS-OMV
error: POST operation failed: xend_post: error from xen daemon: (xend.err 'Block device type "qemu" is invalid.’)

virsh dumpxml NAS-OMV  (Note: libvirt would examine the grammar and change accordingly. See the text in red after virsh edit.)

<domain type='xen'>



  <memory unit='KiB'>1048576</memory>

  <currentMemory unit='KiB'>1048576</currentMemory>

  <vcpu placement='static'>2</vcpu>




    <boot dev='hd'/>







  <clock offset='variable' adjustment='0' basis='utc'>

    <timer name='hpet' present='no'/>







    <disk type='file' device='disk'>

      <driver name='file'/>

      <source file='/etc/xen/images/NAS-OMV.img'/>

      <target dev='hda' bus='ide'/>


    <disk type='file' device='cdrom'>

      <target dev='hde' bus='ide'/>



    <disk type='block' device='disk'>

      <driver name='qemu'/>

      <source dev='/dev/sda'/>

      <target dev='hdb' bus='ide'/>


    <disk type='block' device='disk'>

      <driver name='qemu'/>

      <source dev='/dev/sdb'/>

      <target dev='hdc' bus='ide'/>


    <interface type='bridge'>

      <mac address='00:16:3e:d5:5b:9a'/>

      <source bridge='xenbr1'/>

      <script path='/etc/xen/scripts/vif-bridge'/>

      <model type='e1000'/>


    <serial type='pty'>

      <target port='0'/>


    <console type='pty'>

      <target type='serial' port='0'/>


    <input type='tablet' bus='usb'/>

    <input type='mouse' bus='ps2'/>

    <graphics type='vnc' port='-1' autoport='yes' keymap='en-us'/>



Could anyone point me to the right direction? I have to use whole physical disk passthrough to NAS vm because I don’t want to change my disk content (it is total > 4TB content). 

Thanks in advance!!


Xen-users mailing list

Xen-users mailing list



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