a37b8d0c18
Quite a few people initially try OpenStack by running each node on a virtual machine. In some cases, either the hypervisor and/or CPU lack support for hardware acceleration required by KVM on the compute node. I added a step including how to test for hardware acceleration support within the virtual machine and change 'libvirt_type' from KVM to QEMU if the test fails. Change-Id: I519cdff8c2c1b6a8d1d2b9d5181b205362651b85 backport: havana Closes-Bug: #1264175
258 lines
14 KiB
XML
258 lines
14 KiB
XML
<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="nova-compute">
|
|
<title>Configure a Compute node</title>
|
|
<para>After you configure the Compute service on the controller
|
|
node, you must configure another system as a Compute node. The
|
|
Compute node receives requests from the controller node and hosts
|
|
virtual machine instances. You can run all services on a single
|
|
node, but the examples in this guide use separate systems. This
|
|
makes it easy to scale horizontally by adding additional Compute
|
|
nodes following the instructions in this section.</para>
|
|
<para>The Compute service relies on a hypervisor to run virtual
|
|
machine instances. OpenStack can use various hypervisors, but this
|
|
guide uses KVM.</para>
|
|
<procedure>
|
|
<step>
|
|
<para>Configure the system. Use the instructions in <xref
|
|
linkend="ch_basics"/>, but note the following differences
|
|
from the controller node:</para>
|
|
<itemizedlist>
|
|
<listitem>
|
|
<para>Use different IP addresses when you configure
|
|
<filename>eth0</filename>. This guide uses
|
|
<literal>192.168.0.11</literal> for the internal
|
|
network. Do not configure <literal>eth1</literal> with a
|
|
static IP address. The networking component of OpenStack
|
|
assigns and configures an IP address.</para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>Set the host name to <literal>compute1</literal>. To
|
|
verify, use the <code>uname -n</code> parameter. Ensure
|
|
that the IP addresses and host names for both nodes are
|
|
listed in the <filename>/etc/hosts</filename> file on each
|
|
system.</para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>Synchronize from the controller node. Follow the
|
|
instructions in <xref linkend="basics-ntp"/>.</para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>Install the MySQL client libraries. You do not need to
|
|
install the MySQL database server or start the MySQL
|
|
service.</para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>Enable the OpenStack packages for the distribution
|
|
that you are using. See <xref linkend="basics-packages"
|
|
/>.</para>
|
|
</listitem>
|
|
</itemizedlist>
|
|
</step>
|
|
<step>
|
|
<para>After you configure the operating system, install the
|
|
appropriate packages for the Compute service.</para>
|
|
<para os="ubuntu;debian">Run this command:</para>
|
|
<screen os="ubuntu;debian"><prompt>#</prompt> <userinput>apt-get install nova-compute-kvm python-guestfs</userinput></screen>
|
|
<para os="ubuntu;debian">When prompted to create a
|
|
<literal>supermin</literal> appliance, respond
|
|
<userinput>yes</userinput>.</para>
|
|
|
|
<note os="debian">
|
|
<para>To use the meta-packages and install other components on
|
|
your compute node, such as OVS Networking and Ceilometer
|
|
agents, run this command:</para>
|
|
<screen><prompt>#</prompt> <userinput>apt-get install openstack-compute-node</userinput></screen>
|
|
<para>The controller node has the
|
|
<package>openstack-proxy-node</package> and
|
|
<package>openstack-toaster</package> meta-packages that
|
|
install <package>openstack-proxy-node</package> and
|
|
<package>openstack-toaster</package> at the same
|
|
time.</para>
|
|
</note>
|
|
|
|
<screen os="centos;rhel;fedora"><prompt>#</prompt> <userinput>yum install openstack-nova-compute</userinput></screen>
|
|
<screen os="opensuse;sles"><prompt>#</prompt> <userinput>zypper install openstack-nova-compute kvm openstack-utils</userinput></screen>
|
|
</step>
|
|
<step os="debian">
|
|
<para>Respond to the prompts for <link
|
|
linkend="debconf-dbconfig-common">database
|
|
management</link>, <link linkend="debconf-keystone_authtoken"
|
|
><literal>[keystone_authtoken]</literal> settings</link>,
|
|
<link linkend="debconf-rabbitqm">RabbitMQ
|
|
credentials</link>, and <link linkend="debconf-api-endpoints"
|
|
>API endpoint</link> registration.</para>
|
|
</step>
|
|
<step os="ubuntu">
|
|
<para>For security reasons, the Linux kernel is not readable by
|
|
normal users which restricts hypervisor services such as qemu
|
|
and libguestfs. For details, see <link
|
|
xlink:href="https://bugs.launchpad.net/ubuntu/+source/linux/+bug/759725"
|
|
>this bug</link>. To make the current kernel readable, run:
|
|
|
|
<screen><prompt>#</prompt> <userinput>dpkg-statoverride --update --add root root 0644 /boot/vmlinuz-$(uname -r)</userinput></screen>
|
|
To also enable this override for all future kernel updates, create the
|
|
file <filename>/etc/kernel/postinst.d/statoverride</filename>
|
|
containing:<programlisting language="bash">#!/bin/sh
|
|
version="$1"
|
|
# passing the kernel version is required
|
|
[ -z "${version}" ] && exit 0
|
|
dpkg-statoverride --update --add root root 0644 /boot/vmlinuz-${version}</programlisting>
|
|
Remember to make the file executable:
|
|
<screen><prompt>#</prompt> <userinput>chmod +x /etc/kernel/postinst.d/statoverride</userinput></screen>
|
|
</para>
|
|
</step>
|
|
<step>
|
|
<para os="fedora;rhel;centos;opensuse;sles">Edit the
|
|
<filename>/etc/nova/nova.conf</filename> configuration file:
|
|
</para>
|
|
<screen os="fedora;rhel;centos;opensuse;sles"><prompt>#</prompt> <userinput>openstack-config --set /etc/nova/nova.conf database connection mysql://nova:<replaceable>NOVA_DBPASS</replaceable>@controller/nova</userinput>
|
|
<prompt>#</prompt> <userinput>openstack-config --set /etc/nova/nova.conf DEFAULT auth_strategy keystone</userinput>
|
|
<prompt>#</prompt> <userinput>openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_host <replaceable>controller</replaceable></userinput>
|
|
<prompt>#</prompt> <userinput>openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_protocol http</userinput>
|
|
<prompt>#</prompt> <userinput>openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_port 35357</userinput>
|
|
<prompt>#</prompt> <userinput>openstack-config --set /etc/nova/nova.conf keystone_authtoken admin_user nova</userinput>
|
|
<prompt>#</prompt> <userinput>openstack-config --set /etc/nova/nova.conf keystone_authtoken admin_tenant_name service</userinput>
|
|
<prompt>#</prompt> <userinput>openstack-config --set /etc/nova/nova.conf keystone_authtoken admin_password <replaceable>NOVA_PASS</replaceable></userinput></screen>
|
|
<para os="ubuntu;debian">Edit the
|
|
<filename>/etc/nova/nova.conf</filename> configuration file and add these
|
|
lines to the appropriate sections:</para>
|
|
<programlisting os="ubuntu;debian" language="ini">...
|
|
[DEFAULT]
|
|
...
|
|
auth_strategy=keystone
|
|
...
|
|
[database]
|
|
# The SQLAlchemy connection string used to connect to the database
|
|
connection = mysql://nova:NOVA_DBPASS@controller/nova</programlisting>
|
|
</step>
|
|
<step os="fedora;rhel;centos;ubuntu;opensuse;sles">
|
|
<para os="fedora;rhel;centos">Configure the Compute Service to use the
|
|
Qpid message broker by setting these configuration keys:</para>
|
|
<screen os="fedora;rhel;centos"><prompt>#</prompt> <userinput>openstack-config --set /etc/nova/nova.conf \
|
|
DEFAULT rpc_backend nova.openstack.common.rpc.impl_qpid</userinput>
|
|
<prompt>#</prompt> <userinput>openstack-config --set /etc/nova/nova.conf DEFAULT qpid_hostname <replaceable>controller</replaceable></userinput></screen>
|
|
<para os="ubuntu">Configure the Compute Service to use
|
|
the RabbitMQ message broker by setting these configuration
|
|
keys in the <literal>[DEFAULT]</literal> configuration group of
|
|
the <filename>/etc/nova/nova.conf</filename> file:</para>
|
|
<programlisting os="ubuntu" language="ini">rpc_backend = nova.rpc.impl_kombu
|
|
rabbit_host = controller
|
|
rabbit_password = <replaceable>RABBIT_PASS</replaceable></programlisting>
|
|
<para os="opensuse;sles">Configure the Compute Service to use the RabbitMQ message broker
|
|
by setting these configuration keys:</para>
|
|
<screen os="opensuse;sles"><prompt>#</prompt> <userinput>openstack-config --set /etc/nova/nova.conf \
|
|
DEFAULT rpc_backend nova.rpc.impl_kombu</userinput>
|
|
<prompt>#</prompt> <userinput>openstack-config --set /etc/nova/nova.conf DEFAULT rabbit_host controller</userinput>
|
|
<prompt>#</prompt> <userinput>openstack-config --set /etc/nova/nova.conf DEFAULT rabbit_password <replaceable>RABBIT_PASS</replaceable></userinput></screen>
|
|
</step>
|
|
|
|
<step>
|
|
<para>Configure Compute to provide remote console access to instances.</para>
|
|
<screen os="fedora;rhel;centos;opensuse;sles"><prompt>#</prompt> <userinput>openstack-config --set /etc/nova/nova.conf DEFAULT my_ip 192.168.0.11</userinput>
|
|
<prompt>#</prompt> <userinput>openstack-config --set /etc/nova/nova.conf DEFAULT vnc_enabled True</userinput>
|
|
<prompt>#</prompt> <userinput>openstack-config --set /etc/nova/nova.conf DEFAULT vncserver_listen 0.0.0.0</userinput>
|
|
<prompt>#</prompt> <userinput>openstack-config --set /etc/nova/nova.conf DEFAULT vncserver_proxyclient_address 192.168.0.11</userinput>
|
|
<prompt>#</prompt> <userinput>openstack-config --set /etc/nova/nova.conf \
|
|
DEFAULT novncproxy_base_url http://<replaceable>controller</replaceable>:6080/vnc_auto.html</userinput></screen>
|
|
<para os="ubuntu;debian">Edit
|
|
<filename>/etc/nova/nova.conf</filename> and add the following
|
|
keys under the
|
|
<literal>[DEFAULT]</literal>
|
|
section:</para>
|
|
<programlisting os="ubuntu;debian" language="ini">[DEFAULT]
|
|
...
|
|
my_ip=192.168.0.11
|
|
vnc_enabled=True
|
|
vncserver_listen=0.0.0.0
|
|
vncserver_proxyclient_address=192.168.0.11
|
|
novncproxy_base_url=http://<replaceable>controller</replaceable>:6080/vnc_auto.html</programlisting>
|
|
</step>
|
|
<step>
|
|
<para>Specify the host that runs the Image Service.<phrase
|
|
os="ubuntu;debian"> Edit
|
|
<filename>/etc/nova/nova.conf</filename> file and add
|
|
these lines to the <literal>[DEFAULT]</literal>
|
|
section:</phrase></para>
|
|
<screen os="fedora;rhel;centos;opensuse;sles"><prompt>#</prompt> <userinput>openstack-config --set /etc/nova/nova.conf DEFAULT glance_host <replaceable>controller</replaceable></userinput></screen>
|
|
<programlisting os="ubuntu;debian" language="ini">[DEFAULT]
|
|
...
|
|
glance_host=<replaceable>controller</replaceable></programlisting>
|
|
</step>
|
|
<step>
|
|
<para>If you install Compute on a virtual machine for testing
|
|
purposes, you must determine whether your hypervisor and/or CPU
|
|
support nested hardware acceleration using the following
|
|
command:</para>
|
|
<screen><prompt>#</prompt> <userinput>egrep -c '(vmx|svm)' /proc/cpuinfo</userinput></screen>
|
|
<para>If this command returns a value of
|
|
<emphasis>one or greater</emphasis>, your hypervisor and/or CPU
|
|
support nested hardware acceleration which requires no
|
|
additional configuration.</para>
|
|
<para os="ubuntu;debian">If this command returns a value of
|
|
<emphasis>zero</emphasis>, your hypervisor and/or CPU do not
|
|
support nested hardware acceleration and
|
|
<literal>libvirt</literal> must use QEMU instead of KVM. Edit
|
|
the <literal>[DEFAULT]</literal> section in the
|
|
<filename>/etc/nova/nova-compute.conf</filename> file to modify
|
|
this key:</para>
|
|
<programlisting os="ubuntu;debian" language="ini">[DEFAULT]
|
|
...
|
|
libvirt_type = qemu</programlisting>
|
|
<para os="rhel;centos;fedora;sles;opensuse">If this command returns
|
|
a value of <emphasis>zero</emphasis>, your hypervisor and/or CPU
|
|
do not support nested hardware acceleration and
|
|
<literal>libvirt</literal> must use QEMU instead of KVM.
|
|
Configure <literal>libvirt</literal> to use QEMU:</para>
|
|
<screen os="rhel;centos;fedora;sles;opensuse"><prompt>#</prompt> <userinput>openstack-config --set /etc/nova/nova.conf DEFAULT libvirt_type qemu</userinput></screen>
|
|
</step>
|
|
<step>
|
|
<para>Edit the <filename>/etc/nova/api-paste.ini</filename>
|
|
file to add the credentials to the
|
|
<literal>[filter:authtoken]</literal> section:</para>
|
|
<note><title>Use of .ini files</title>
|
|
<para>Files with the extension <filename>.ini</filename>
|
|
sometimes need to be edited during initial setup. However,
|
|
they should not be used for general configuration tasks.</para>
|
|
</note>
|
|
<programlisting language="ini">[filter:authtoken]
|
|
paste.filter_factory = keystoneclient.middleware.auth_token:filter_factory
|
|
auth_host = <replaceable>controller</replaceable>
|
|
auth_port = 35357
|
|
auth_protocol = http
|
|
admin_tenant_name = service
|
|
admin_user = nova
|
|
admin_password = <replaceable>NOVA_PASS</replaceable>
|
|
</programlisting>
|
|
<note os="fedora;rhel;centos;opensuse;sles">
|
|
<para>Ensure that the
|
|
<option>api_paste_config=/etc/nova/api-paste.ini</option>
|
|
option is set in <filename>/etc/nova/nova.conf</filename>
|
|
file.</para>
|
|
</note>
|
|
</step>
|
|
<step>
|
|
<para os="fedora;rhel;centos;opensuse;sles">Start the Compute
|
|
service and configure it to start when the system
|
|
boots.</para>
|
|
<para os="ubuntu;debian">Restart the Compute service.</para>
|
|
<screen os="ubuntu;debian"><prompt>#</prompt> <userinput>service nova-compute restart</userinput></screen>
|
|
<screen os="fedora;rhel;centos"><prompt>#</prompt> <userinput>service libvirtd start</userinput>
|
|
<prompt>#</prompt> <userinput>service messagebus start</userinput>
|
|
<prompt>#</prompt> <userinput>chkconfig libvirtd on</userinput>
|
|
<prompt>#</prompt> <userinput>chkconfig messagebus on</userinput>
|
|
<prompt>#</prompt> <userinput>service openstack-nova-compute start</userinput>
|
|
<prompt>#</prompt> <userinput>chkconfig openstack-nova-compute on</userinput></screen>
|
|
<screen os="opensuse;sles"><prompt>#</prompt> <userinput>service libvirtd start</userinput>
|
|
<prompt>#</prompt> <userinput>chkconfig libvirtd on</userinput>
|
|
<prompt>#</prompt> <userinput>service openstack-nova-compute start</userinput>
|
|
<prompt>#</prompt> <userinput>chkconfig openstack-nova-compute on</userinput></screen>
|
|
</step>
|
|
<step os="ubuntu">
|
|
<para>Remove the SQLite database created by the packages:</para>
|
|
<screen><prompt>#</prompt> <userinput>rm /var/lib/nova/nova.sqlite</userinput></screen>
|
|
</step>
|
|
</procedure>
|
|
</section>
|