2013-06-29 15:40:12 -04:00

143 lines
6.1 KiB
XML

<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % BOOK_ENTITIES SYSTEM "qig.ent">
%BOOK_ENTITIES;
]>
<!-- Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<chapter id="chap-qig-KVM">
<title>KVM Setup and installation</title>
<para>
KVM is the hypervisor we'll be using - we will recover the initial setup
which has already been done on the hypervisor host and cover installation
of the agent software, you can use the same steps to add additional KVM
nodes to your CloudStack environment.
</para>
<section id="sect-qig-KVM-Prerequisites">
<title>Prerequisites</title>
<para>
We explicitly are using the management server as a compute node as well,
which means that we have already performed many of the prerequisite steps
when setting up the management server, but we will list them here for
clarity. Those steps are:
<orderedlist>
<listitem>
<para>
<xref linkend="sect-qig-Environment-operatingsys-network" />
</para>
</listitem>
<listitem>
<para>
<xref linkend="sect-qig-Environment-operatingsys-hostname" />
</para>
</listitem>
<listitem>
<para>
<xref linkend="sect-qig-Environment-operatingsys-selinux" />
</para>
</listitem>
<listitem>
<para>
<xref linkend="sect-qig-Environment-operatingsys-ntp" />
</para>
</listitem>
<listitem>
<para>
<xref linkend="sect-qig-Environment-operatingsys-repoconfig" />
</para>
</listitem>
</orderedlist>
</para>
<para>
You shouldn't need to do that for the management server, of course, but
any additional hosts will need for you to complete the above steps.
</para>
</section>
<section id="sect-qig-KVM-Installation">
<title>Installation</title>
<para>Installation of the KVM agent is trivial with just a single command, but afterwards we'll need to configure a few things.</para>
<screen><prompt># </prompt><userinput><command>yum</command> -y install cloud-agent</userinput></screen>
<section id="sect-qig-KVM-Configuration">
<title>KVM Configuration</title>
<para>We have two different parts of KVM to configure, libvirt, and QEMU.</para>
<section id="sect-qig-KVM-Configuration-qemu">
<title>QEMU Configuration</title>
<para>
KVM configuration is relatively simple at only a single item. We need to
edit the QEMU VNC configuration. This is done by editing
<filename>/etc/libvirt/qemu.conf</filename> and ensuring the following
line is present and uncommented.
<screen>vnc_listen=0.0.0.0</screen>
</para>
</section>
<section id="sect-qig-KVM-Configuration-libvirt">
<title>Libvirt Configuration</title>
<para>
CloudStack uses libvirt for managing virtual machines. Therefore it
is vital that libvirt is configured correctly. Libvirt is a dependency
of cloud-agent and should already be installed.
</para>
<orderedlist>
<listitem>
<para>In order to have live migration working libvirt has to listen
for unsecured TCP connections. We also need to turn off libvirts
attempt to use Multicast DNS advertising. Both of these settings
are in <filename>/etc/libvirt/libvirtd.conf</filename>
</para>
<para>Set the following paramaters:</para>
<programlisting>listen_tls = 0</programlisting>
<programlisting>listen_tcp = 1</programlisting>
<programlisting>tcp_port = "16059"</programlisting>
<programlisting>auth_tcp = "none"</programlisting>
<programlisting>mdns_adv = 0</programlisting>
</listitem>
<listitem>
<para>Turning on "listen_tcp" in libvirtd.conf is not enough, we have to change the parameters as well:</para>
<para>On RHEL or CentOS modify <filename>/etc/sysconfig/libvirtd</filename>:</para>
<para>Uncomment the following line:</para>
<programlisting>#LIBVIRTD_ARGS="--listen"</programlisting>
<para>On Ubuntu: modify <filename>/etc/init/libvirt-bin.conf</filename></para>
<para>Change the following line (at the end of the file):</para>
<programlisting>exec /usr/sbin/libvirtd -d</programlisting>
<para>to (just add -l)</para>
<programlisting>exec /usr/sbin/libvirtd -d -l</programlisting>
</listitem>
<listitem>
<para>Restart libvirt</para>
<para>In RHEL or CentOS:</para>
<programlisting><command>$ service libvirtd restart</command></programlisting>
<para>In Ubuntu:</para>
<programlisting><command>$ service libvirt-bin restart</command></programlisting>
</listitem>
</orderedlist>
</section>
<section id="sect-qig-KVM-Configuration-finish">
<title>KVM configuration complete</title>
<para>
That concludes our installation and configuration of KVM, and we'll now move to using the CloudStack UI
for the actual configuration of our cloud.
</para>
</section>
</section>
</section>
</chapter>