2012-05-16 01:34:59 +00:00
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
<section xmlns="http://docbook.org/ns/docbook"
|
|
|
|
xmlns:xi="http://www.w3.org/2001/XInclude"
|
|
|
|
xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0"
|
|
|
|
xml:id="qemu">
|
|
|
|
<?dbhtml stop-chunking?>
|
|
|
|
<title>QEMU</title>
|
|
|
|
<para>From the perspective of the Compute service, the QEMU hypervisor is very similar to the KVM
|
|
|
|
hypervisor. Both are controlled through libvirt, both support the same feature set, and all
|
|
|
|
virtual machine images that are compatible with KVM are also compatible with QEMU. The main
|
|
|
|
difference is that QEMU does not support native virtualization. Consequently, QEMU has worse
|
|
|
|
performance than KVM and is a poor choice for a production deployment.</para>
|
|
|
|
<para>The typical uses cases for QEMU are<itemizedlist>
|
|
|
|
<listitem>
|
2012-09-27 14:48:51 +00:00
|
|
|
<para>Running on older hardware that lacks
|
|
|
|
virtualization support.</para>
|
2012-05-16 01:34:59 +00:00
|
|
|
</listitem>
|
|
|
|
<listitem>
|
2012-09-27 14:48:51 +00:00
|
|
|
<para>Running the Compute service inside of a virtual
|
|
|
|
machine for development or testing purposes, where
|
|
|
|
the hypervisor does not support native
|
|
|
|
virtualization for guests.</para>
|
2012-05-16 01:34:59 +00:00
|
|
|
</listitem>
|
2012-09-27 14:48:51 +00:00
|
|
|
</itemizedlist></para>
|
2013-08-12 19:21:53 +00:00
|
|
|
<para>KVM requires hardware support for acceleration. If hardware support is
|
|
|
|
not available (e.g., if you are running Compute inside of a VM and the
|
|
|
|
hypervisor does not expose the required hardware support), you can use
|
|
|
|
QEMU instead. KVM and QEMU have the same level of support in OpenStack,
|
|
|
|
but KVM will provide better performance. To enable QEMU, add these
|
|
|
|
settings to
|
2013-08-26 19:38:58 +00:00
|
|
|
<filename>nova.conf</filename>:<programlisting language="ini">compute_driver=libvirt.LibvirtDriver
|
2012-07-31 14:36:09 +00:00
|
|
|
libvirt_type=qemu</programlisting></para>
|
2012-07-28 14:01:40 +00:00
|
|
|
<para>
|
2012-07-31 14:36:09 +00:00
|
|
|
For some operations you may also have to install the <command>guestmount</command> utility:</para>
|
2013-08-29 15:58:56 +00:00
|
|
|
<screen os="ubuntu"><prompt>$></prompt> <userinput>sudo apt-get install guestmount</userinput></screen>
|
|
|
|
<screen os="rhel;fedora;centos"><prompt>$></prompt> <userinput>sudo yum install libguestfs-tools</userinput></screen>
|
2012-07-30 00:32:00 +00:00
|
|
|
<para>The QEMU hypervisor supports the following virtual machine image formats:</para>
|
|
|
|
<itemizedlist>
|
2012-05-16 01:34:59 +00:00
|
|
|
<listitem>
|
|
|
|
<para>Raw</para>
|
|
|
|
</listitem>
|
|
|
|
<listitem>
|
|
|
|
<para>QEMU Copy-on-write (qcow2)</para>
|
|
|
|
</listitem>
|
|
|
|
<listitem>
|
|
|
|
<para>VMWare virtual machine disk format (vmdk)</para>
|
|
|
|
</listitem>
|
2012-07-31 14:36:09 +00:00
|
|
|
</itemizedlist>
|
2012-05-15 03:17:38 +00:00
|
|
|
<section xml:id="fixes-rhel-qemu" os="rhel;fedora;centos"><title>Tips and fixes for QEMU on RHEL</title>
|
2013-08-02 16:00:26 +00:00
|
|
|
<para>If you are testing OpenStack in a virtual machine, you need
|
2012-09-27 14:48:51 +00:00
|
|
|
to configure nova to use qemu without KVM and hardware
|
|
|
|
virtualization. The second command relaxes SELinux rules
|
|
|
|
to allow this mode of operation
|
2013-08-29 15:58:56 +00:00
|
|
|
(https://bugzilla.redhat.com/show_bug.cgi?id=753589). The
|
|
|
|
last two commands here work around a libvirt issue fixed in
|
2012-09-27 14:48:51 +00:00
|
|
|
RHEL 6.4. Note nested virtualization will be the much
|
|
|
|
slower TCG variety, and you should provide lots of memory
|
|
|
|
to the top level guest, as the OpenStack-created guests
|
2013-08-02 16:00:26 +00:00
|
|
|
default to 2GM RAM with no overcommit.</para>
|
2012-05-15 03:17:38 +00:00
|
|
|
<note><para>The second command, <command>setsebool</command>, may take a while.</para></note>
|
2013-08-01 21:28:45 +00:00
|
|
|
<screen><prompt>$></prompt> <userinput>sudo openstack-config --set /etc/nova/nova.conf DEFAULT libvirt_type qemu</userinput>
|
|
|
|
<prompt>$></prompt> <userinput>sudo setsebool -P virt_use_execmem on</userinput>
|
|
|
|
<prompt>$></prompt> <userinput>sudo ln -s /usr/libexec/qemu-kvm /usr/bin/qemu-system-x86_64</userinput>
|
|
|
|
<prompt>$></prompt> <userinput>sudo service libvirtd restart</userinput></screen>
|
2012-07-10 23:36:21 +00:00
|
|
|
|
|
|
|
|
2012-05-15 03:17:38 +00:00
|
|
|
</section>
|
2012-05-16 01:34:59 +00:00
|
|
|
</section>
|
2012-07-10 23:36:21 +00:00
|
|
|
|