By Rafael Folco, Advisory Software Engineer
UPDATE:
-
virtio driver issue with vhost_net is fixed on PowerKVM 2.2.1
- ibmveth (spapr-vlan) driver is now supported by OpenStack: https://review.openstack.org/#/c/106451/
In today's post we show an example on how to workaround virtio limitations and successfully spawn a little-endian instance in OpenStack. This post assumes you have an upstream version of OpenStack already installed with Nova (compute) and Glance (image) services up and running. Check Devstack for a quick way to deploy OpenStack on your system.
Currently, PowerKVM supports LE (Little-Endian) guests with Canonical’s Ubuntu Server 14.04 distribution. LE cloud images can be found at https://cloud-images.ubuntu.com/. This blog post has a good explanation about Little-Endian support on Power.
At the time of writing, there is a limitation for ppc64el images with the 'virtio' driver model, which doesn't work with vhost (kernelspace). OpenStack generates the libvirt XML for its guests using virtio settings with vhost. In other words, there is no way to use virtio without vhost in OpenStack. Default 'virtio' configuration (with vhost) adds "<model type='virtio'/>" to the guest libvirt settings.
The workarounds for this issue could be one of the following:
- Use ibmveth (spapr-vlan) driver (recommended)
- Disable vhost-net module
- Turn vhost mode off by using driver name='qemu' in the libvirt XML configuration
- Use virtio-net model type (not officially supported)
ibmveth (spapr-vlan) driver
ibmveth and ibmvscsi are legacy drivers derived from PowerVM and are now supported on PowerKVM, as explained in this blog post.
Currently, OpenStack upstream does not support ibmveth driver. This driver support in OpenStack is being addressed by https://review.openstack.org/#/c/106451/. You may need to manually apply this change until it gets merged upstream.
Disable vhost-net module
This workaround doesn't require any change in OpenStack. Disabling the vhost-net module you force vhost=off when qemu runs the virtual machine.
<driver name='qemu'>
This option uses qemu driver (userspace) instead of vhost (kernelspace) for the virtio model.
<model type='virtio-net'>
This model type has been 'accidentally' worked in my tests. Although it works, this is not officially supported and should not have be available for long-term usage. Here is an example of the 'virtio-net' model configuration in the libvirt xml:
<interface type='bridge'>
<mac address='fa:16:3e:dc:a4:83'/>
<source bridge='br100'/>
<target dev='vnet0'/>
<model type='virtio-net'/>
<filterref filter='nova-instance-instance-00000008-fa163edca483'/>
<alias name='net0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
</interface>
In order to boot a little-endian image in OpenStack, you first need to upload it to the image service component, Glance. The following commands download and upload the image to Glance:
$ wget https://cloud-images.ubuntu.com/trusty/current/trusty-server-cloudimg-ppc64el-disk1.img
$ glance image-create --name Little-Endian --file trusty-server-cloudimg-ppc64el-disk1.img --disk-format=qcow2 --container-format=bare --property hw_vif_model='spapr-vlan'
To spawn an instance of the Little-Endian image, run:
$ nova boot --image 7febf98f-93ac-48e7-9377-a17f2bfa2077 --key-name mykey --flavor 3 test
Log in to the guest using the key you provided, as shown below:
ssh -i mykey.pem ubuntu@10.0.0.2
The authenticity of host '10.0.0.2 (10.0.0.2)' can't be established.
ECDSA key fingerprint is d8:39:f4:32:cd:04:e9:3b:17:c1:f9:44:d6:91:1b:e0.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '10.0.0.2' (ECDSA) to the list of known hosts.
Welcome to Ubuntu 14.04 LTS (GNU/Linux 3.13.0-30-generic ppc64le)
* Documentation: https://help.ubuntu.com/
System information as of Mon Jul 14 22:21:54 UTC 2014
System load: 6.7 Memory usage: 2% Processes: 68
Usage of /: 58.3% of 1.32GB Swap usage: 0% Users logged in: 0
Graph this data and manage this system at:
https://landscape.canonical.com/
Get cloud support with Ubuntu Advantage Cloud Guest:
http://www.ubuntu.com/business/services/cloud
0 packages can be updated.
0 updates are security updates.
The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.
ubuntu@test:~$ uname -m
ppc64le
Confirm your network device is using ibmveth driver:
ubuntu@test:~$ find /sys/devices/vio/ -iname *eth*
/sys/devices/vio/1000/net/eth0
For more information about IBM PowerKVM refer to the Redbook.