[openstack-dev] how to attach a physical disk to a qemu instance?

wk 304702903 at qq.com
Wed Jul 20 08:18:04 UTC 2016


hi:


   I want attach a physical disk to a qemu instance in devstack environment,But these methods have some problem.


   Method 1:
    step1
    reference  http://ronaldevers.nl/2012/10/14/adding-a-physical-disk-kvm-libvirt.html
      virsh edit instance-00000001


     you add the disk to the domain’s xml config file by hand. So open up /etc/libvirt/qemu/<your-vm>.xml in your favourite editor and add a <disk> section to the <devices> section:


    <disk type='block' device='disk'>
       <driver name='qemu' type='raw'/>
       <source dev='/dev/md/storage'/>
      <target dev='vdb' bus='virtio'/>
    </disk>
    This will make the host’s /dev/md/storage available in the guest as /dev/vdb

    step2
    guest os can not find the new physical disk. Then reboot guest os, the xml is reverted to before,and guest os can not find the new phyisical disk.


    Method 2:
    step 1
    [root at opentest ~]# virsh attach-disk instance-00000001 /dev/md/storage vdb --cache none --config --type disk
    Disk attached successfully

    step 2
    guest os can not find the new physical disk. Then reboot guest os, the xml is reverted to before,and guest os can not find the new phyisical disk.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20160720/b028e98d/attachment.html>


More information about the OpenStack-dev mailing list