Libvirt Disk Configuration

From Software Heritage Wiki
Jump to navigation Jump to search

Libvirt Disk Configuration

Storage issues

Disk configuration for maximum performance on Libvirt/Qemu guests is quite fiddly.

Uffizi (storage VM) suffered from the symptoms described in the following thread : http://www.spinics.net/lists/kvm/msg51361.html

Configuration Sources

The current configuration (which should be optimized for performance) originates from those pages:

Summary of the configuration

  • virtio-blk-pci
  • cache=directsync
  • io=native
  • scsi=off
  • config-wce=off
  • x-data-plane=on

XML configuration

<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
  [...]
  <devices>
    <disk type='block' device='disk'>
      <driver name='qemu' type='raw' cache='directsync' io='native'/>
      <source dev='/dev/vg-louvre/uffizi-root'/>
      <target dev='vda' bus='virtio'/>
    </disk>
    [...]
  </devices>
  [...]
  <qemu:commandline>
    <qemu:arg value='-set'/>
    <qemu:arg value='device.virtio-disk0.scsi=off'/>
    <qemu:arg value='-set'/>
    <qemu:arg value='device.virtio-disk0.config-wce=off'/>
    <qemu:arg value='-set'/>
    <qemu:arg value='device.virtio-disk0.x-data-plane=on'/>
    [...]
  </qemu:commandline>
</domain>