[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: Miguel Clara <miguelmclara@xxxxxxxxx>
  • From: Guangning YU <yugn@xxxxxx>
  • Date: Sun, 13 Apr 2014 12:33:48 +0930
  • Cc: "mailing list xen.org" <xen-users@xxxxxxxxxxxxx>
  • Delivery-date: Sun, 13 Apr 2014 03:05:21 +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 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. 


From: Miguel Clara <miguelmclara@xxxxxxxxx>
Date: Sat, 12 Apr 2014 18:57:07 +0100
To: Guangning YU <yugn@xxxxxx>
Cc: "mailing list xen.org" <xen-users@xxxxxxxxxxxxx>
Subject: 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:
Hi, 

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>


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

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

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

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

</disk>


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'>

  <name>NAS-OMV</name>

  <uuid>d20932ff-51cb-ecc5-989d-4f76a8d665d9</uuid>

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

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

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

  <os>

    <type>hvm</type>

    <loader>/usr/lib/xen-4.1/boot/hvmloader</loader>

    <boot dev='hd'/>

  </os>

  <features>

    <acpi/>

    <apic/>

    <pae/>

  </features>

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

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

  </clock>

  <on_poweroff>destroy</on_poweroff>

  <on_reboot>restart</on_reboot>

  <on_crash>restart</on_crash>

  <devices>

    <emulator>/usr/lib/xen-4.1/bin/qemu-dm</emulator>

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

      <driver name='file'/>

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

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

    </disk>

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

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

      <readonly/>

    </disk>

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

      <driver name='qemu'/>

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

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

    </disk>

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

      <driver name='qemu'/>

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

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

    </disk>

    <interface type='bridge'>

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

      <source bridge='xenbr1'/>

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

      <model type='e1000'/>

    </interface>

    <serial type='pty'>

      <target port='0'/>

    </serial>

    <console type='pty'>

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

    </console>

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

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

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

  </devices>

</domain>


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!!

Jason


_______________________________________________
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®.