Why doesn't nova use virtio networking by default?

Created by Vish Ishaya
Keywords:
virtio kvm libvirt xml

We've realized that all instances booted with nova-compute on any node, are booted with 100Mb RTL interfaces, en we are seeing this line in libvirt.xml for any instance :

        <interface type='bridge'>
            <source bridge='br100'/>
            <mac address='02:16:3e:5a:ba:6f'/>
            <!-- <model type='virtio'/> CANT RUN virtio network right now --> <-- THIS LINE
            <filterref filter="nova-instance-instance-000000bf-02163e5aba6f">
                <parameter name="IP" value="172.16.144.24" />
                <parameter name="DHCPSERVER" value="172.16.144.1" />
            </filterref>
        </interface>

So, how to we enable virtio model or e1000 model for a performance boost on nova using kvm ??

You can remove the comments around the line. There are issues with nova-volume and virtio net and some older kernels. Specifically lucid and centos 5.5. If you are not using nova-volume or those guests you should be able to uncomment that line with no issues.

To change new instances, change virt/libvirt.xml.template

To change running instances, change the libvirt.xml file in the instance's directory (/var/lib/nova/instances/instance-xxxx/), then:
  virsh destroy instance-xxx
  virsh undefine instance-xxx
  virsh define libvirt.xml
  virsh start instance-xxx

Lucid guests will be fine as long as you don't try to dynamically attach a volume to them. If you need attachable volumes you have to use maverick+