Using A Physical Storage Device In A KVM

It is possible to attach a physical storage device directly to a kernel virtual machine but it cannot be done through the virt-manager GUI tool, it has to be handed-coded.

  1. Shut down the KVM.
  2. Edit the domain configuration XML. This can be done in the virt-manager UI or by directly editing the domain XML file. KVM XML files are located in /etc/libvirt/qemu on Fedora-based systems.
  3. Add the following stanza in the <devices> section. Adjust the source and target dev attributes appropriately.
      <disk type="block" device="disk">
        <driver name="qemu" type="raw"/>
        <source dev="/dev/sdX"/>
        <target dev="vdX" bus="virtio"/>
      </disk>

      dlk

      Leave a Reply

      Your email address will not be published. Required fields are marked *

      This site uses Akismet to reduce spam. Learn how your comment data is processed.