Add KVM config info to the Install Guide
Add KVM config info from Config Reference Update Enabling KVM in the native file Update the references to QEMU and Xen Create Enabling KVM section and use it from both Config Reference and Install Guide Add reference to amd and intel subsections Change-Id: I103ec048cceefb336026823a16257d88671bf969 Closes-Bug: #1238256 Author: Nermina Miller
This commit is contained in:
parent
b558315550
commit
e1587dfd0a
@ -5,248 +5,199 @@
|
|||||||
xml:id="kvm">
|
xml:id="kvm">
|
||||||
<?dbhtml stop-chunking?>
|
<?dbhtml stop-chunking?>
|
||||||
<title>KVM</title>
|
<title>KVM</title>
|
||||||
<para>KVM is configured as the default hypervisor for Compute. <note>
|
<para>KVM is configured as the default hypervisor for
|
||||||
<para>There are several sections about hypervisor
|
Compute.</para>
|
||||||
selection in this document. If you are reading this
|
<note>
|
||||||
document linearly, you do not want to load the KVM
|
<para>This document contains several sections about hypervisor
|
||||||
module prior to installing <systemitem class="service">nova-compute</systemitem>. The
|
selection. If you are reading this document linearly, you
|
||||||
<systemitem class="service">nova-compute</systemitem> service depends on qemu-kvm which
|
do not want to load the KVM module before you install
|
||||||
installs
|
<systemitem class="service">nova-compute</systemitem>.
|
||||||
<filename>/lib/udev/rules.d/45-qemu-kvm.rules</filename>,
|
The <systemitem class="service">nova-compute</systemitem>
|
||||||
which sets the correct permissions on the /dev/kvm
|
service depends on qemu-kvm, which installs
|
||||||
device node.</para>
|
<filename>/lib/udev/rules.d/45-qemu-kvm.rules</filename>,
|
||||||
</note></para>
|
which sets the correct permissions on the /dev/kvm device
|
||||||
|
node.</para>
|
||||||
|
</note>
|
||||||
<para>To enable KVM explicitly, add the following configuration
|
<para>To enable KVM explicitly, add the following configuration
|
||||||
options
|
options to the <filename>/etc/nova/nova.conf</filename>
|
||||||
<filename>/etc/nova/nova.conf</filename>:<programlisting language="ini">compute_driver=libvirt.LibvirtDriver
|
file:</para>
|
||||||
|
<programlisting language="ini">compute_driver=libvirt.LibvirtDriver
|
||||||
libvirt_type=kvm</programlisting>
|
libvirt_type=kvm</programlisting>
|
||||||
The KVM hypervisor supports the following virtual machine
|
<para>The KVM hypervisor supports the following virtual machine
|
||||||
image formats:<itemizedlist>
|
image formats:</para>
|
||||||
<listitem>
|
<itemizedlist>
|
||||||
<para>Raw</para>
|
<listitem>
|
||||||
</listitem>
|
<para>Raw</para>
|
||||||
<listitem>
|
</listitem>
|
||||||
<para>QEMU Copy-on-write (qcow2)</para>
|
<listitem>
|
||||||
</listitem>
|
<para>QEMU Copy-on-write (qcow2)</para>
|
||||||
<listitem>
|
</listitem>
|
||||||
<para>QED Qemu Enhanced Disk</para>
|
<listitem>
|
||||||
</listitem>
|
<para>QED Qemu Enhanced Disk</para>
|
||||||
<listitem>
|
</listitem>
|
||||||
<para>VMWare virtual machine disk format (vmdk)</para>
|
<listitem>
|
||||||
</listitem>
|
<para>VMWare virtual machine disk format (vmdk)</para>
|
||||||
</itemizedlist></para>
|
</listitem>
|
||||||
<para>The rest of this section describes how to enable KVM on your system. You may also wish to
|
</itemizedlist>
|
||||||
consult distribution-specific documentation:<itemizedlist>
|
<para>This section describes how to enable KVM on your system. For
|
||||||
<listitem>
|
more information, see the following distribution-specific
|
||||||
<para><link
|
documentation:</para>
|
||||||
xlink:href="http://fedoraproject.org/wiki/Getting_started_with_virtualization"
|
<itemizedlist>
|
||||||
>Fedora: Getting started with virtualization</link> from the Fedora project
|
<listitem>
|
||||||
wiki.</para>
|
<para><link
|
||||||
</listitem>
|
xlink:href="http://fedoraproject.org/wiki/Getting_started_with_virtualization"
|
||||||
<listitem>
|
>Fedora: Getting started with
|
||||||
<para><link xlink:href="https://help.ubuntu.com/community/KVM/Installation">Ubuntu:
|
virtualization</link> from the Fedora project
|
||||||
KVM/Installation</link> from the Community Ubuntu documentation.</para>
|
wiki.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para><link
|
<para><link
|
||||||
xlink:href="http://static.debian-handbook.info/browse/stable/sect.virtualization.html#idp11279352"
|
xlink:href="https://help.ubuntu.com/community/KVM/Installation"
|
||||||
>Debian: Virtualization with KVM</link> from the Debian handbook.</para>
|
>Ubuntu: KVM/Installation</link> from the
|
||||||
</listitem>
|
Community Ubuntu documentation.</para>
|
||||||
<listitem>
|
</listitem>
|
||||||
<para><link
|
<listitem>
|
||||||
xlink:href="http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Virtualization_Host_Configuration_and_Guest_Installation_Guide/sect-Virtualization_Host_Configuration_and_Guest_Installation_Guide-Host_Installation-Installing_KVM_packages_on_an_existing_Red_Hat_Enterprise_Linux_system.html"
|
<para><link
|
||||||
>RHEL: Installing virtualization packages on
|
xlink:href="http://static.debian-handbook.info/browse/stable/sect.virtualization.html#idp11279352"
|
||||||
an existing Red Hat Enterprise Linux
|
>Debian: Virtualization with KVM</link> from the
|
||||||
system</link> from the Red Hat Enterprise
|
Debian handbook.</para>
|
||||||
Linux Virtualization Host Configuration and Guest
|
</listitem>
|
||||||
Installation Guide.</para>
|
<listitem>
|
||||||
</listitem>
|
<para><link
|
||||||
<listitem>
|
xlink:href="http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Virtualization_Host_Configuration_and_Guest_Installation_Guide/sect-Virtualization_Host_Configuration_and_Guest_Installation_Guide-Host_Installation-Installing_KVM_packages_on_an_existing_Red_Hat_Enterprise_Linux_system.html"
|
||||||
<para><link
|
>RHEL: Installing virtualization packages on an
|
||||||
xlink:href="http://doc.opensuse.org/documentation/html/openSUSE/opensuse-kvm/cha.kvm.requires.html#sec.kvm.requires.install"
|
existing Red Hat Enterprise Linux system</link>
|
||||||
>openSUSE: Installing KVM</link> from the openSUSE Virtualization with KVM
|
from the <citetitle>Red Hat Enterprise Linux
|
||||||
manual.</para>
|
Virtualization Host Configuration and Guest
|
||||||
</listitem>
|
Installation Guide</citetitle>.</para>
|
||||||
<listitem>
|
</listitem>
|
||||||
<para><link
|
<listitem>
|
||||||
xlink:href="http://doc.opensuse.org/products/draft/SLES/SLES-kvm_sd_draft/cha.kvm.requires.html#sec.kvm.requires.install"
|
<para><link
|
||||||
>SLES: Installing KVM</link> from the SUSE
|
xlink:href="http://doc.opensuse.org/documentation/html/openSUSE/opensuse-kvm/cha.kvm.requires.html#sec.kvm.requires.install"
|
||||||
Linux Enterprise Server Virtualization with KVM
|
>openSUSE: Installing KVM</link> from the openSUSE
|
||||||
manual.</para>
|
Virtualization with KVM manual.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</itemizedlist></para>
|
<listitem>
|
||||||
<section xml:id="checking-kvm">
|
<para><link
|
||||||
<title>Checking for hardware virtualization support</title>
|
xlink:href="http://doc.opensuse.org/products/draft/SLES/SLES-kvm_sd_draft/cha.kvm.requires.html#sec.kvm.requires.install"
|
||||||
<para>The processors of your compute host need to support virtualization technology (VT)
|
>SLES: Installing KVM</link> from the SUSE Linux
|
||||||
(mainly Intel <emphasis role="italic">VT -x</emphasis> or AMD <emphasis role="italic"
|
Enterprise Server Virtualization with KVM
|
||||||
>AMD-v</emphasis> technologies) to use KVM.</para>
|
manual.</para>
|
||||||
<para>In order to check if your processor has VT support (which has to be enabled in the
|
</listitem>
|
||||||
BIOS), follow on Ubuntu these steps:</para>
|
</itemizedlist>
|
||||||
<itemizedlist>
|
|
||||||
<listitem>
|
|
||||||
<para>Issue as root on Ubuntu:</para>
|
|
||||||
<screen><prompt>#</prompt> <userinput>apt-get install cpu-checker</userinput>
|
|
||||||
<prompt>#</prompt> <userinput>kvm-ok</userinput></screen>
|
|
||||||
</listitem>
|
|
||||||
<listitem>
|
|
||||||
<para>If KVM is supported, the output should look something like:</para>
|
|
||||||
<screen><computeroutput>INFO: /dev/kvm exists
|
|
||||||
KVM acceleration can be used</computeroutput></screen>
|
|
||||||
</listitem>
|
|
||||||
<listitem>
|
|
||||||
<para>If KVM is supported, the output should look something like:</para>
|
|
||||||
<screen><computeroutput>INFO: /dev/kvm exists
|
|
||||||
KVM acceleration can be used</computeroutput></screen>
|
|
||||||
</listitem>
|
|
||||||
</itemizedlist>
|
|
||||||
<para>On other distributions, follow these steps:</para>
|
|
||||||
<itemizedlist>
|
|
||||||
<listitem>
|
|
||||||
<para>Run the following as user:</para>
|
|
||||||
<screen><prompt>$</prompt> <userinput>egrep '(vmx|svm)' --color=always /proc/cpuinfo</userinput></screen>
|
|
||||||
</listitem>
|
|
||||||
<listitem>
|
|
||||||
<para>If KVM is supported, the output should look something like:</para>
|
|
||||||
<screen><computeroutput>flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 popcnt lahf_lm arat dtherm tpr_shadow vnmi flexpriority ept vpid</computeroutput></screen>
|
|
||||||
</listitem>
|
|
||||||
<listitem>
|
|
||||||
<para>If KVM is not supported, you should get no output.</para>
|
|
||||||
</listitem>
|
|
||||||
</itemizedlist>
|
|
||||||
<note><para>Some systems require that you enable VT support in the system BIOS. If you believe
|
|
||||||
your processor supports hardware acceleration but the above command produced no output,
|
|
||||||
you may need to reboot your machine, enter the system BIOS, and enable the VT
|
|
||||||
option.</para></note>
|
|
||||||
|
|
||||||
<para>In the case that KVM acceleration is not supported, Compute should be configured to
|
<xi:include href="section_kvm_enable.xml"/>
|
||||||
use a different hypervisor, such as <link linkend="qemu">QEMU</link> or <link
|
|
||||||
linkend="introduction-to-xen">Xen</link>.</para>
|
|
||||||
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<section xml:id="enabling-kvm">
|
|
||||||
<title>Enabling KVM</title>
|
|
||||||
<para>KVM requires the <literal>kvm</literal> and either <literal>kvm-intel</literal> or
|
|
||||||
<literal>kvm-amd</literal> modules to be loaded. This may have been configured
|
|
||||||
automatically on your distribution when KVM is installed.</para>
|
|
||||||
<para>You can check that they have been loaded using <command>lsmod</command>, as follows,
|
|
||||||
with expected output for Intel-based
|
|
||||||
processors:<screen><prompt>$</prompt> <userinput>lsmod | grep kvm</userinput>
|
|
||||||
<computeroutput>kvm_intel 137721 9
|
|
||||||
kvm 415459 1 kvm_intel</computeroutput></screen>The
|
|
||||||
following sections describe how to load the kernel modules for Intel-based and AMD-based
|
|
||||||
processors if they were not loaded automatically by your distribution's KVM installation
|
|
||||||
process.</para>
|
|
||||||
|
|
||||||
<section xml:id="kvm-intel">
|
|
||||||
<title>Intel-based processors</title>
|
|
||||||
<para>If your compute host is Intel-based, run the following as root to load the kernel
|
|
||||||
modules:<screen><prompt>#</prompt> <userinput>modprobe kvm</userinput>
|
|
||||||
<prompt>#</prompt> <userinput>modprobe kvm-intel</userinput></screen>
|
|
||||||
Add the following lines to <filename>/etc/modules</filename> so that these modules
|
|
||||||
will load on reboot:<programlisting>kvm
|
|
||||||
kvm-intel</programlisting></para>
|
|
||||||
</section>
|
|
||||||
<section xml:id="kvm-amd">
|
|
||||||
<title>AMD-based processors</title>
|
|
||||||
<para>If your compute host is AMD-based, run the following as root to load the kernel
|
|
||||||
modules:<screen><prompt>#</prompt> <userinput>modprobe kvm</userinput>
|
|
||||||
<prompt>#</prompt> <userinput>modprobe kvm-amd</userinput></screen>
|
|
||||||
Add the following lines to <filename>/etc/modules</filename> so that these modules
|
|
||||||
will load on reboot:<programlisting>kvm
|
|
||||||
kvm-amd</programlisting></para>
|
|
||||||
</section>
|
|
||||||
</section>
|
|
||||||
<section xml:id="libvirt-xml-cpu-model">
|
<section xml:id="libvirt-xml-cpu-model">
|
||||||
<title>Specifying the CPU model of KVM guests</title>
|
<title>Specify the CPU model of KVM guests</title>
|
||||||
<para>The Compute service allows you to control the guest CPU model that is exposed to KVM
|
<para>The Compute service enables you to control the guest CPU
|
||||||
virtual machines. Use cases include:<itemizedlist>
|
model that is exposed to KVM virtual machines. Use cases
|
||||||
<listitem>
|
include:</para>
|
||||||
<para>To maximize performance of virtual machines by exposing new host CPU
|
<itemizedlist>
|
||||||
features to the guest</para>
|
<listitem>
|
||||||
</listitem>
|
<para>To maximize performance of virtual machines by
|
||||||
<listitem>
|
exposing new host CPU features to the guest</para>
|
||||||
<para>To ensure a consistent default CPU across all machines, removing reliance
|
</listitem>
|
||||||
of variable QEMU defaults</para>
|
<listitem>
|
||||||
</listitem>
|
<para>To ensure a consistent default CPU across all
|
||||||
</itemizedlist></para>
|
machines, removing reliance of variable QEMU
|
||||||
<para>In libvirt, the CPU is specified by providing a base CPU model name (which is a
|
defaults</para>
|
||||||
shorthand for a set of feature flags), a set of additional feature flags, and the
|
</listitem>
|
||||||
topology (sockets/cores/threads). The libvirt KVM driver provides a number of standard
|
</itemizedlist>
|
||||||
CPU model names. These models are defined in the file
|
<para>In libvirt, the CPU is specified by providing a base CPU
|
||||||
<filename>/usr/share/libvirt/cpu_map.xml</filename>. Check this file to determine
|
model name (which is a shorthand for a set of feature
|
||||||
which models are supported by your local installation.</para>
|
flags), a set of additional feature flags, and the
|
||||||
<para>There are two Compute configuration options that determine the type of CPU model
|
topology (sockets/cores/threads). The libvirt KVM driver
|
||||||
exposed to the hypervisor when using KVM, <literal>libvirt_cpu_mode</literal> and
|
provides a number of standard CPU model names. These
|
||||||
|
models are defined in the
|
||||||
|
<filename>/usr/share/libvirt/cpu_map.xml</filename>
|
||||||
|
file. Check this file to determine which models are
|
||||||
|
supported by your local installation.</para>
|
||||||
|
<para>Two Compute configuration options define which type of
|
||||||
|
CPU model is exposed to the hypervisor when using KVM:
|
||||||
|
<literal>libvirt_cpu_mode</literal> and
|
||||||
<literal>libvirt_cpu_model</literal>.</para>
|
<literal>libvirt_cpu_model</literal>.</para>
|
||||||
<para>The <literal>libvirt_cpu_mode</literal> option can take one of four values:
|
<para>The <literal>libvirt_cpu_mode</literal> option can take
|
||||||
<literal>none</literal>, <literal>host-passthrough</literal>,
|
one of the following values: <literal>none</literal>,
|
||||||
<literal>host-model</literal> and <literal>custom</literal>.</para>
|
<literal>host-passthrough</literal>,
|
||||||
|
<literal>host-model</literal>, and
|
||||||
|
<literal>custom</literal>.</para>
|
||||||
<simplesect>
|
<simplesect>
|
||||||
<title>Host model (default for KVM & QEMU)</title>
|
<title>Host model (default for KVM & QEMU)</title>
|
||||||
<para>If your <filename>nova.conf</filename> contains
|
<para>If your <filename>nova.conf</filename> file contains
|
||||||
<literal>libvirt_cpu_mode=host-model</literal>, libvirt will identify the CPU
|
<literal>libvirt_cpu_mode=host-model</literal>,
|
||||||
model in <filename>/usr/share/libvirt/cpu_map.xml</filename> which most closely
|
libvirt identifies the CPU model in
|
||||||
matches the host, and then request additional CPU flags to complete the match. This
|
<filename>/usr/share/libvirt/cpu_map.xml</filename>
|
||||||
should give close to maximum functionality/performance, which maintaining good
|
file that most closely matches the host, and requests
|
||||||
reliability/compatibility if the guest is migrated to another host with slightly
|
additional CPU flags to complete the match. This
|
||||||
different host CPUs.</para>
|
configuration provides the maximum functionality and
|
||||||
|
performance and maintains good reliability and
|
||||||
|
compatibility if the guest is migrated to another host
|
||||||
|
with slightly different host CPUs.</para>
|
||||||
</simplesect>
|
</simplesect>
|
||||||
<simplesect>
|
<simplesect>
|
||||||
<title>Host passthrough</title>
|
<title>Host pass through</title>
|
||||||
<para>If your <filename>nova.conf</filename> contains
|
<para>If your <filename>nova.conf</filename> file contains
|
||||||
<literal>libvirt_cpu_mode=host-passthrough</literal>, libvirt will tell KVM to
|
<literal>libvirt_cpu_mode=host-passthrough</literal>,
|
||||||
passthrough the host CPU with no modifications. The difference to host-model,
|
libvirt tells KVM to pass through the host CPU with no
|
||||||
instead of just matching feature flags, every last detail of the host CPU is
|
modifications. The difference to host-model, instead
|
||||||
matched. This gives absolutely best performance, and can be important to some apps
|
of just matching feature flags, every last detail of
|
||||||
which check low level CPU details, but it comes at a cost with respect to migration:
|
the host CPU is matched. This gives absolutely best
|
||||||
the guest can only be migrated to an exactly matching host CPU.</para>
|
performance, and can be important to some apps which
|
||||||
|
check low level CPU details, but it comes at a cost
|
||||||
|
with respect to migration: the guest can only be
|
||||||
|
migrated to an exactly matching host CPU.</para>
|
||||||
</simplesect>
|
</simplesect>
|
||||||
<simplesect>
|
<simplesect>
|
||||||
<title>Custom</title>
|
<title>Custom</title>
|
||||||
<para>If your <filename>nova.conf</filename> file contains <literal>libvirt_cpu_mode=custom</literal>, you can
|
<para>If your <filename>nova.conf</filename> file contains
|
||||||
explicitly specify one of the supported named model using the libvirt_cpu_model
|
<literal>libvirt_cpu_mode=custom</literal>, you
|
||||||
configuration option. For example, to configure the KVM guests to expose Nehalem
|
can explicitly specify one of the supported named
|
||||||
CPUs, your nova.conf should contain:</para>
|
model using the libvirt_cpu_model configuration
|
||||||
<para>
|
option. For example, to configure the KVM guests to
|
||||||
<programlisting language="ini">libvirt_cpu_mode=custom
|
expose Nehalem CPUs, your
|
||||||
|
<filename>nova.conf</filename> file should
|
||||||
|
contain:</para>
|
||||||
|
<programlisting language="ini">libvirt_cpu_mode=custom
|
||||||
libvirt_cpu_model=Nehalem</programlisting>
|
libvirt_cpu_model=Nehalem</programlisting>
|
||||||
</para>
|
|
||||||
</simplesect>
|
</simplesect>
|
||||||
<simplesect>
|
<simplesect>
|
||||||
<title>None (default for all libvirt-driven hypervisors other than KVM &
|
<title>None (default for all libvirt-driven hypervisors
|
||||||
QEMU)</title>
|
other than KVM & QEMU)</title>
|
||||||
<para>If your <filename>nova.conf</filename> contains
|
<para>If your <filename>nova.conf</filename> file contains
|
||||||
<literal>libvirt_cpu_mode=none</literal>, then
|
<literal>libvirt_cpu_mode=none</literal>, libvirt
|
||||||
libvirt will not specify any CPU model at all. It will
|
does not specify a CPU model. Instead, the hypervisor
|
||||||
leave it up to the hypervisor to choose the default
|
chooses the default model. This setting is equivalent
|
||||||
model. This setting is equivalent to the Compute
|
to the Compute service behavior prior to the Folsom
|
||||||
service behavior prior to the Folsom release.</para>
|
release.</para>
|
||||||
</simplesect>
|
</simplesect>
|
||||||
</section>
|
</section>
|
||||||
<section xml:id="kvm-performance">
|
<section xml:id="kvm-performance">
|
||||||
<title>KVM Performance Tweaks</title>
|
<title>KVM Performance Tweaks</title>
|
||||||
<para>A recommended resource to help you improve
|
<para>The <link
|
||||||
the performance of KVM is
|
xlink:href="http://www.linux-kvm.org/page/VhostNet"
|
||||||
the <link xlink:href="http://www.linux-kvm.org/page/VhostNet">VHostNet</link>
|
>VHostNet</link> kernel module improves network
|
||||||
kernel module. This module improves network performance. To load the
|
performance. To load the kernel module, run the following
|
||||||
kernel module, as root:
|
command as root:</para>
|
||||||
<screen><prompt>#</prompt> <userinput>modprobe vhost_net</userinput></screen></para>
|
<screen><prompt>#</prompt> <userinput>modprobe vhost_net</userinput></screen>
|
||||||
</section>
|
</section>
|
||||||
<section xml:id="kvm-troubleshooting">
|
<section xml:id="kvm-troubleshooting">
|
||||||
<title>Troubleshooting</title>
|
<title>Troubleshooting</title>
|
||||||
<para>Trying to launch a new virtual machine instance fails
|
<para>Trying to launch a new virtual machine instance fails
|
||||||
with the <literal>ERROR</literal> state, and the following
|
with the <literal>ERROR</literal>state, and the following
|
||||||
error appears in
|
error appears in the
|
||||||
<filename>/var/log/nova/nova-compute.log</filename><screen><computeroutput>libvirtError: internal error no supported architecture for os type 'hvm'</computeroutput></screen>
|
<filename>/var/log/nova/nova-compute.log</filename>
|
||||||
This is a symptom that the KVM kernel modules have not
|
file:</para>
|
||||||
been loaded.</para>
|
<screen><computeroutput>libvirtError: internal error no supported architecture for os type 'hvm'</computeroutput></screen>
|
||||||
|
<para>This message indicates that the KVM kernel modules were
|
||||||
|
not loaded.</para>
|
||||||
<para>If you cannot start VMs after installation without
|
<para>If you cannot start VMs after installation without
|
||||||
rebooting, it's possible the permissions are not correct.
|
rebooting, the permissions might not be correct. This can
|
||||||
This can happen if you load the KVM module before you've
|
happen if you load the KVM module before you install
|
||||||
installed <systemitem class="service">nova-compute</systemitem>. To check the permissions, run
|
<systemitem class="service">nova-compute</systemitem>.
|
||||||
<userinput>ls -l /dev/kvm</userinput> to see whether
|
To check whether the group is set to kvm, run:</para>
|
||||||
the group is set to kvm. If not, run <userinput>sudo
|
<screen><prompt>#</prompt> <userinput>ls -l /dev/kvm</userinput></screen>
|
||||||
udevadm trigger</userinput>.</para>
|
<para>If it is not set to kvm, run:</para>
|
||||||
|
<screen><prompt>#</prompt> <userinput>sudo udevadm trigger</userinput></screen>
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
|
101
doc/common/section_kvm_enable.xml
Normal file
101
doc/common/section_kvm_enable.xml
Normal file
@ -0,0 +1,101 @@
|
|||||||
|
<?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="section_kvm_enable">
|
||||||
|
<title>Enabling KVM</title>
|
||||||
|
<para>To perform the following steps, you must be logged in as
|
||||||
|
the <systemitem>root</systemitem> user.</para>
|
||||||
|
<procedure>
|
||||||
|
<step>
|
||||||
|
<para>To determine whether the <literal>svm</literal>
|
||||||
|
or <literal>vmx</literal> CPU extensions are
|
||||||
|
present, run the following command:</para>
|
||||||
|
<screen><prompt>#</prompt> <userinput>grep -E 'svm|vmx' /proc/cpuinfo</userinput></screen>
|
||||||
|
<para>This command generates output if the CPU is
|
||||||
|
hardware-virtualization capable. Even if output is
|
||||||
|
shown, you may still need to enable virtualization
|
||||||
|
in the system BIOS for full support.</para>
|
||||||
|
<para>If no output appears, consult your system
|
||||||
|
documentation to ensure that your CPU and
|
||||||
|
motherboard support hardware virtualization.
|
||||||
|
Verify that any relevant hardware virtualization
|
||||||
|
options are enabled in the system BIOS.</para>
|
||||||
|
<para>Each manufacturer's BIOS is different. If you need to enable virtualization in
|
||||||
|
the BIOS, look for an option containing the words "virtualization", "VT", "VMX", or
|
||||||
|
"SVM." </para>
|
||||||
|
</step>
|
||||||
|
<step>
|
||||||
|
<para>To list the loaded kernel modules and verify
|
||||||
|
that the <literal>kvm</literal> modules are
|
||||||
|
loaded, run the following command:</para>
|
||||||
|
<screen><prompt>#</prompt> <userinput>lsmod | grep kvm</userinput></screen>
|
||||||
|
<para>If the output includes <systemitem>kvm_intel</systemitem> or
|
||||||
|
<systemitem>kvm_amd</systemitem>, the <systemitem>kvm</systemitem> hardware
|
||||||
|
virtualization modules are loaded and your kernel meets the module requirements for
|
||||||
|
OpenStack Compute.</para>
|
||||||
|
<para>If the output does not show that the kvm module
|
||||||
|
is loaded, run the following command to load
|
||||||
|
it:</para>
|
||||||
|
<screen><prompt>#</prompt> <userinput>modprobe -a kvm</userinput></screen>
|
||||||
|
<para>Run the command for your CPU. For Intel, run
|
||||||
|
this command:</para>
|
||||||
|
<screen><prompt>#</prompt> <userinput>modprobe -a kvm-intel</userinput></screen>
|
||||||
|
<para>For AMD, run this command:</para>
|
||||||
|
<screen><prompt>#</prompt> <userinput>modprobe -a kvm-amd</userinput></screen>
|
||||||
|
<para>Because a KVM installation can change user group
|
||||||
|
membership, you might need to log in again for
|
||||||
|
changes to take effect.</para>
|
||||||
|
<para>If the kernel modules do not load automatically, please use the procedures listed
|
||||||
|
in the subsections below.</para>
|
||||||
|
</step>
|
||||||
|
</procedure>
|
||||||
|
<para>This completes the required checks to ensure that
|
||||||
|
hardware virtualization support is available and enabled,
|
||||||
|
and that the correct kernel modules are loaded.</para>
|
||||||
|
<para>If the checks indicate that required hardware
|
||||||
|
virtualization support or kernel modules are disabled or
|
||||||
|
not available, you must either enable this support on the
|
||||||
|
system or find a system with this support.</para>
|
||||||
|
<note>
|
||||||
|
<para>Some systems require that you enable VT support in
|
||||||
|
the system BIOS. If you believe your processor
|
||||||
|
supports hardware acceleration but the previous
|
||||||
|
command did not produce output, you might need to
|
||||||
|
reboot your machine, enter the system BIOS, and enable
|
||||||
|
the VT option.</para>
|
||||||
|
</note>
|
||||||
|
<para>If KVM acceleration is not supported, configure Compute
|
||||||
|
to use a different hypervisor, such as <link
|
||||||
|
xlink:href="http://docs.openstack.org/trunk/config-reference/content/qemu.html"
|
||||||
|
>QEMU</link> or <link
|
||||||
|
xlink:href="http://docs.openstack.org/trunk/config-reference/content/introduction-to-xen.html"
|
||||||
|
>Xen</link>.</para>
|
||||||
|
<para>The following procedures will help you load the kernel modules for Intel-based and
|
||||||
|
AMD-based processors if they did not load automatically during KVM installation.</para>
|
||||||
|
<section xml:id="kvm-intel">
|
||||||
|
<title>Intel-based processors</title>
|
||||||
|
<para>If your compute host is Intel-based, run the
|
||||||
|
following command as root to load the kernel
|
||||||
|
modules:</para>
|
||||||
|
<screen><prompt>#</prompt> <userinput>modprobe kvm</userinput>
|
||||||
|
<prompt>#</prompt> <userinput>modprobe kvm-intel</userinput></screen>
|
||||||
|
<para>Add the following lines to the
|
||||||
|
<filename>/etc/modules</filename> file so that
|
||||||
|
these modules load on reboot:</para>
|
||||||
|
<programlisting>kvm
|
||||||
|
kvm-intel</programlisting>
|
||||||
|
</section>
|
||||||
|
<section xml:id="kvm-amd">
|
||||||
|
<title>AMD-based processors</title>
|
||||||
|
<para>If your compute host is AMD-based, run the following
|
||||||
|
command as root to load the kernel modules:</para>
|
||||||
|
<screen><prompt>#</prompt> <userinput>modprobe kvm</userinput>
|
||||||
|
<prompt>#</prompt> <userinput>modprobe kvm-amd</userinput></screen>
|
||||||
|
<para>Add the following lines to
|
||||||
|
<filename>/etc/modules</filename> file so that
|
||||||
|
these modules load on reboot:</para>
|
||||||
|
<programlisting>kvm
|
||||||
|
kvm-amd</programlisting>
|
||||||
|
</section>
|
||||||
|
</section>
|
@ -4,79 +4,11 @@
|
|||||||
version="5.0"
|
version="5.0"
|
||||||
xml:id="nova-kvm">
|
xml:id="nova-kvm">
|
||||||
<title>Enabling KVM on the Compute Node</title>
|
<title>Enabling KVM on the Compute Node</title>
|
||||||
<para>
|
|
||||||
The OpenStack Compute Service requires hardware virtualization support
|
<para>OpenStack Compute requires hardware virtualization support and certain kernel modules. To
|
||||||
and certain kernel modules. Follow this procedure to determine whether
|
determine whether your system has hardware virtualization support and the correct kernel
|
||||||
your system has hardware virtualization support and the correct kernel
|
modules available and to enable KVM, use the following procedure. In many cases, this is
|
||||||
modules available. In many cases, this is installed for you by your
|
installed for you by your distribution and you do not need to perform any additional action.</para>
|
||||||
distribution and you do not need to perform any additional action.
|
<xi:include href="../common/section_kvm_enable.xml"/>
|
||||||
</para>
|
|
||||||
<para>
|
|
||||||
All steps listed must be performed while logged into the system as the
|
|
||||||
<systemitem>root</systemitem> user.
|
|
||||||
</para>
|
|
||||||
<procedure>
|
|
||||||
<step>
|
|
||||||
<para>
|
|
||||||
Use the <command>grep</command> command to check for the
|
|
||||||
presence of the <literal>svm</literal> or <literal>vmx</literal>
|
|
||||||
CPU extensions by inspecting the <filename>/proc/cpuinfo</filename>
|
|
||||||
file generated by the kernel:
|
|
||||||
</para>
|
|
||||||
<screen><prompt>#</prompt> <userinput><command>grep -E 'svm|vmx' /proc/cpuinfo</command></userinput></screen>
|
|
||||||
<para>
|
|
||||||
If any output is shown after running this command then the CPU
|
|
||||||
is hardware virtualization capable. Even if output is shown,
|
|
||||||
you may still need to enable virtualization in the system BIOS
|
|
||||||
for full support.
|
|
||||||
</para>
|
|
||||||
<para>
|
|
||||||
If output is <emphasis>not</emphasis> shown then consult your
|
|
||||||
system documentation to ensure that your CPU and motherboard
|
|
||||||
support hardware virtualization. Verify that any relevant
|
|
||||||
hardware virtualization options are enabled in the system BIOS.
|
|
||||||
</para>
|
|
||||||
<para>
|
|
||||||
Each manufacturer's BIOS is different. If you need to enable
|
|
||||||
virtualization in the BIOS, look for an option containing the
|
|
||||||
words "virtualization", "VT", "VMX", or "SVM".
|
|
||||||
</para>
|
|
||||||
</step>
|
|
||||||
<step>
|
|
||||||
<para>
|
|
||||||
Use the <command>lsmod</command> command to list the loaded
|
|
||||||
kernel modules and verify that the <literal>kvm</literal>
|
|
||||||
modules are loaded:
|
|
||||||
</para>
|
|
||||||
<screen><prompt>#</prompt> <userinput><command>lsmod | grep kvm</command></userinput></screen>
|
|
||||||
<para>
|
|
||||||
If the output includes <systemitem>kvm_intel</systemitem> or
|
|
||||||
<systemitem>kvm_amd</systemitem> then the <systemitem>kvm</systemitem>
|
|
||||||
hardware virtualization modules are loaded and your kernel meets
|
|
||||||
the module requirements for the OpenStack Compute Service.
|
|
||||||
</para>
|
|
||||||
<para>If the output does not appear to have the kvm module loaded,
|
|
||||||
you should be able to load it with:</para>
|
|
||||||
<screen><prompt>#</prompt> <userinput><command>modprobe -a kvm</command></userinput></screen>
|
|
||||||
<para>then for your particular CPU, choose either intel:
|
|
||||||
<screen><prompt>#</prompt> <userinput><command>modprobe -a kvm-intel</command></userinput></screen>
|
|
||||||
or amd:</para>
|
|
||||||
<screen><prompt>#</prompt> <userinput><command>modprobe -a kvm-amd</command></userinput></screen>
|
|
||||||
<para>However, as kvm installation may change the groups your user is
|
|
||||||
a member of, you may need to re-login for changes to take effect.
|
|
||||||
</para>
|
|
||||||
</step>
|
|
||||||
</procedure>
|
|
||||||
<para>
|
|
||||||
This completes the required checks to ensure hardware virtualization
|
|
||||||
support is available and enabled, and that you have the correct kernel
|
|
||||||
modules loaded.
|
|
||||||
</para>
|
|
||||||
<para>
|
|
||||||
If the checks indicated that either hardware virtualization support or
|
|
||||||
the required kernel modules are not available or not enabled then you
|
|
||||||
must take action to either find a system that does have the required
|
|
||||||
hardware virtualization support and modules, or enable it on the system
|
|
||||||
that failed the checks.
|
|
||||||
</para>
|
|
||||||
</section>
|
</section>
|
||||||
|
Loading…
Reference in New Issue
Block a user