Configuring Compute nodes - Gargravarr2112/kvm-vdi GitHub Wiki

Ubuntu:

In order for libvirt to use VDI-wrapper instead of directly executing Qemu emulator,
we need to do some configuration on each Compute node.

Install VDI wrapper:

cp -r OpenStack/compute_node/etc/kvm-vdi/ /etc/
mkdir /usr/local/VDI
cp OpenStack/compute_node/vdi-wrapper /usr/local/VDI/
ln -s /usr/local/VDI/vdi-wrapper /usr/local/VDI/qemu-system-x86_64

Configure AppArmor

Copy apparmor policy additions:

cp -r OpenStack/compute_node/etc/apparmor.d/ /etc/

Open /etc/apparmor.d/abstractions/libvirt-qemu and add following lines after
line 21 (after network inet6 stream):

/etc/kvm-vdi/ r,
/etc/kvm-vdi/* r,
/usr/local/lib/python2.7/ r,
/usr/local/lib/python2.7/** r,
/usr/local/VDI/ r,
/usr/local/VDI/* r,
/usr/bin/python rmix,
/usr/local/VDI/qemu-system-x86_64 rmix,
/usr/local/VDI/vdi-wrapper rmix,
/proc/** r,
/etc/python2.7/** r,
/sbin/ldconfig rmix,
/sbin/ldconfig-real rmix,
/tmp/* wr,
/sbin/ldconfig.real rmix,
/var/tmp/* rw,
/usr/share/pyshared/** r,

Reload AppArmor: invoke-rc.d apparmor reload

Configure libvirtd systemd service file

Systemd ignores default system environment variables, so we need to explicitly set them
in libvirtd service file.
Open /etc/systemd/system/libvirt-bin.service and add folowing line after [Service] tag:

EnvironmentFile=/etc/kvm-vdi/environment

Reload systemd service: systemctl daemon-reload

Configure VDI wrapper

Edit /etc/kvm-vdi/kvm-vdi.cfg file to fit your setup.

Restart services

systemctl restart libvirtd
systemctl restart nova-compute

If configuration was successful, you should see qemu-system-x86_64 emulator in /usr/local/VDI path:

virsh capabilities|grep emulator

<emulator>/usr/bin/qemu-system-arm</emulator>
<emulator>/usr/bin/qemu-system-aarch64</emulator>
<emulator>/usr/bin/qemu-system-i386</emulator>
<emulator>/usr/bin/qemu-system-i386</emulator>
<emulator>/usr/bin/qemu-system-ppc</emulator>
<emulator>/usr/bin/qemu-system-ppc64</emulator>
<emulator>/usr/bin/qemu-system-ppc64le</emulator>
<emulator>/usr/bin/qemu-system-ppcemb</emulator>
<emulator>/usr/local/VDI/qemu-system-x86_64</emulator>
⚠️ **GitHub.com Fallback** ⚠️