Jump to: navigation, search


Libvirt Custom Hardware Configuration

Currently libvirt will determine the disk / cdrom / nic device models based on the configured hypervisor type (libvirt_type in /etc/nova/nova.conf). For sake of optimal performance, it will default to using virtio for both disk and nic models. The downside of this approach is that it is not possible to run operating systems which lack virtio drivers. eg BSD, Solaris, old Linux, old Windows.

Just changing the defaults won't help because, even ignoring the performance implications of pocking a non-virtio model, there is no single disk / nic model that will satisfy every operating system. Thus there needs to be a way to request custom hardware models.

Image metadata properties

Glance has the ability to store arbitrary metadata properties against images. This provides a way to let the user request specific hardware models

It is anticipated that the user will be allowed three properties

  • disk_bus - specify the type of disk controller to attach disk devices to - one of scsi, virtio, uml, xen, ide, usb
  • cdrom_bus - specify the type of disk controller to attach cdrom devices to - one of scsi, virtio, uml, xen, ide, usb
  • nic_model - specify the model of the network interface device - one of 'e1000', 'rtl8139', 'xen', 'virtio', 'uml'

These can be set at time of image upload to glance, or after the fact.

# glance image-update \
    --property hw_disk_bus=scsi \
    --property hw_cdrom_bus=ide \
    --property hw_vif_model=e1000 \

The property names and values were chosen such that they can be applicable to other non-libvirt hypervisors. This avoids the mess that would entail from multiple properties like 'libvirt_disk_bus', 'xenapi_disk_bus', 'vmware_disk_bus'. Any hypervisor can interpret values like 'ide', 'scsi', etc into something sensible