openstack-manuals/doc/install-guide/section_nova-controller.xml
Diane Fleming 74eb0b24a4 Update sqlite -> SQLite
Closes-Bug: #1250511

backport: havana

Change-Id: Ic001b0d24a5d308e1ad8fea8ab6dda504616d625
author: diane fleming
2013-11-12 09:24:17 -06:00

254 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-controller">
<title>Install the Compute controller services</title>
<para>Compute is a collection of services that enable you to launch
virtual machine instances. You can configure these services to run
on separate nodes or the same node. In this guide, most services
run on the controller node and the service that launches virtual
machines runs on a dedicated compute node. This section shows you
how to install and configure these services on the controller
node.</para>
<procedure>
<step>
<para os="fedora;rhel;centos">Install the
<package>openstack-nova</package> meta-package, which
installs various Compute packages that are used on the
controller node.</para>
<screen os="fedora;rhel;centos"><prompt>#</prompt> <userinput>yum install openstack-nova python-novaclient</userinput></screen>
<para os="ubuntu;debian;opensuse;sles">Install these Compute
packages, which provide the Compute services that run on the
controller node.</para>
<screen os="ubuntu"><prompt>#</prompt> <userinput>apt-get install nova-novncproxy novnc nova-api \
nova-ajax-console-proxy nova-cert nova-conductor \
nova-consoleauth nova-doc nova-scheduler</userinput></screen>
<screen os="debian"><prompt>#</prompt> <userinput>apt-get install nova-consoleproxy nova-api \
nova-cert nova-conductor nova-consoleauth nova-scheduler</userinput></screen>
<screen os="opensuse;sles"><prompt>#</prompt> <userinput>zypper install openstack-nova-api openstack-nova-scheduler \
openstack-nova-cert openstack-nova-conductor openstack-nova-console \
openstack-nova-consoleauth openstack-nova-doc \
openstack-nova-novncproxy python-novaclient</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. The <command>nova-manage
db sync</command> command runs automatically.</para>
</step>
<step os="rhel;centos;fedora;opensuse;sles;ubuntu">
<para>Compute stores information in a database. The examples in
this guide use the MySQL database that is used by other
OpenStack services.</para>
<para>Configure the location of the database. Replace
<replaceable>NOVA_DBPASS</replaceable> with your Compute
service password:</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></screen>
<para os="ubuntu;debian">Edit the
<filename>/etc/nova/nova.conf</filename> file and add these
lines to the <literal>[database]</literal> section:</para>
<programlisting os="ubuntu;debian" language="ini">...
[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;opensuse;sles">
<para>Run the <command>openstack-db</command> command to create
the Compute service database and tables and a
<literal>nova</literal> database user.</para>
<screen os="fedora;rhel;centos;opensuse;sles"><prompt>#</prompt> <userinput>openstack-db --init --service nova --password <replaceable>NOVA_DBPASS</replaceable></userinput></screen>
</step>
<step os="ubuntu">
<para>By default, the Ubuntu packages create an SQLite database.
Delete the <filename>nova.sqlite</filename> file created in
the <filename>/var/lib/nova/</filename> directory so that it
does not get used by mistake.</para>
</step>
<step os="ubuntu">
<para>Use the password you created previously to log in as root.
Create a <literal>nova</literal> database user:</para>
<screen><prompt>#</prompt> <userinput>mysql -u root -p</userinput>
<prompt>mysql></prompt> <userinput>CREATE DATABASE nova;</userinput>
<prompt>mysql></prompt> <userinput>GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost' \
IDENTIFIED BY '<replaceable>NOVA_DBPASS</replaceable>';</userinput>
<prompt>mysql></prompt> <userinput>GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' \
IDENTIFIED BY '<replaceable>NOVA_DBPASS</replaceable>';</userinput></screen>
</step>
<step os="ubuntu">
<para>Create the tables for the Compute service:</para>
<screen><prompt>#</prompt> <userinput>nova-manage db sync</userinput></screen>
</step>
<step>
<para>Set the <literal>my_ip</literal>,
<literal>vncserver_listen</literal>, and
<literal>vncserver_proxyclient_address</literal>
configuration keys to the internal IP address of the
controller node:</para>
<screen os="fedora;rhel;centos;opensuse;sles"><prompt>#</prompt> <userinput>openstack-config --set /etc/nova/nova.conf DEFAULT my_ip 192.168.0.10</userinput>
<prompt>#</prompt> <userinput>openstack-config --set /etc/nova/nova.conf DEFAULT vncserver_listen 192.168.0.10</userinput>
<prompt>#</prompt> <userinput>openstack-config --set /etc/nova/nova.conf DEFAULT vncserver_proxyclient_address 192.168.0.10</userinput></screen>
<para os="ubuntu">Edit the
<filename>/etc/nova/nova.conf</filename> file and add these
lines to the <literal>[DEFAULT]</literal> section:</para>
<para os="debian">In Debian, the the <package>debconf</package>
package automatically sets up <literal>my_ip</literal>
parameter but you must edit the
<filename>/etc/nova/nova.conf</filename> file to configure
the <option>vncserver_listen</option> and
<option>vncserver_proxyclient_address</option> options,
which appear at the end of the file:</para>
<programlisting os="ubuntu;debian" language="ini">...
[DEFAULT]
...
my_ip=192.168.0.10
vncserver_listen=192.168.0.10
vncserver_proxyclient_address=192.168.0.10</programlisting>
</step>
<step os="rhel;centos;fedora;opensuse;sles;ubuntu">
<para>Create a <literal>nova</literal> user that Compute uses to
authenticate with the Identity Service. Use the
<literal>service</literal> tenant and give the user the
<literal>admin</literal> role:</para>
<screen><prompt>#</prompt> <userinput>keystone user-create --name=nova --pass=<replaceable>NOVA_PASS</replaceable> --email=<replaceable>nova@example.com</replaceable></userinput>
<prompt>#</prompt> <userinput>keystone user-role-add --user=nova --tenant=service --role=admin</userinput></screen>
</step>
<step os="rhel;centos;fedora;opensuse;sles;ubuntu">
<para>For Compute to use these credentials, you must edit the
<filename>nova.conf</filename> configuration file:</para>
<!-- FIXME don't think this is necessary - now happens in api-paste.ini -->
<screen os="fedora;rhel;centos;opensuse;sles"><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 DEFAULT auth_host <replaceable>controller</replaceable></userinput>
<prompt>#</prompt> <userinput>openstack-config --set /etc/nova/nova.conf DEFAULT admin_user nova</userinput>
<prompt>#</prompt> <userinput>openstack-config --set /etc/nova/nova.conf DEFAULT admin_tenant_name service</userinput>
<prompt>#</prompt> <userinput>openstack-config --set /etc/nova/nova.conf DEFAULT admin_password <replaceable>NOVA_PASS</replaceable></userinput></screen>
<para os="ubuntu;debian">Edit the
<filename>/etc/nova/nova.conf</filename> file and add these
lines to the <literal>[DEFAULT]</literal> section:</para>
<programlisting os="ubuntu;debian" language="ini">...
[DEFAULT]
...
auth_strategy=keystone</programlisting>
</step>
<step os="rhel;centos;fedora;opensuse;sles;ubuntu">
<para>Add the credentials to the
<filename>/etc/nova/api-paste.ini</filename> file. Add these
options to the <literal>[filter:authtoken]</literal>
section:</para>
<programlisting language="ini">[filter:authtoken]
paste.filter_factory=keystoneclient.middleware.auth_token:filter_factory
auth_host=<replaceable>controller</replaceable>
auth_uri=http://<replaceable>controller</replaceable>:5000
admin_tenant_name=service
admin_user=nova
admin_password=<replaceable>NOVA_PASS</replaceable></programlisting>
<note os="fedora;rhel;centos;opensuse;debian;sles">
<para>Ensure that the
<option>api_paste_config=/etc/nova/api-paste.ini</option>
option is set in the
<filename>/etc/nova/nova.conf</filename> file.</para>
</note>
</step>
<step os="rhel;centos;fedora;opensuse;sles;ubuntu">
<para>You must register Compute with the Identity Service so
that other OpenStack services can locate it. Register the
service and specify the endpoint:</para>
<screen><prompt>#</prompt> <userinput>keystone service-create --name=nova --type=compute \
--description="Nova Compute service"</userinput></screen>
</step>
<step os="rhel;centos;fedora;opensuse;sles;ubuntu">
<para>Use the <literal>id</literal> property that is returned to
create the endpoint.</para>
<screen><prompt>#</prompt> <userinput>keystone endpoint-create \
--service-id=<replaceable>the_service_id_above</replaceable> \
--publicurl=http://<replaceable>controller</replaceable>:8774/v2/%\(tenant_id\)s \
--internalurl=http://<replaceable>controller</replaceable>:8774/v2/%\(tenant_id\)s \
--adminurl=http://<replaceable>controller</replaceable>:8774/v2/%\(tenant_id\)s</userinput></screen>
</step>
<step os="fedora;rhel;centos">
<para>Set these configuration keys to configure Compute to use
the Qpid message broker:</para>
<screen><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>
</step>
<step os="ubuntu">
<para>Set these configuration keys to configure Compute to use
the RabbitMQ message broker. Add them to the
<literal>DEFAULT</literal> configuration group in the
<filename>/etc/nova/nova.conf</filename> file.</para>
<programlisting language="ini">rpc_backend = nova.rpc.impl_kombu
rabbit_host = controller</programlisting>
</step>
<step os="opensuse;sles">
<para>Set these configuration keys to configure Compute to use
the RabbitMQ message broker:</para>
<screen><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></screen>
</step>
<step os="rhel;centos;fedora;opensuse;sles;ubuntu">
<para os="centos;fedora;rhel;opensuse;sles">Start Compute
services and configure them to start when the system
boots:</para>
<para os="ubuntu">Restart Compute services:</para>
<screen os="ubuntu"><prompt>#</prompt> <userinput>service nova-api restart</userinput>
<prompt>#</prompt> <userinput>service nova-cert restart</userinput>
<prompt>#</prompt> <userinput>service nova-consoleauth restart</userinput>
<prompt>#</prompt> <userinput>service nova-scheduler restart</userinput>
<prompt>#</prompt> <userinput>service nova-conductor restart</userinput>
<prompt>#</prompt> <userinput>service nova-novncproxy restart</userinput></screen>
<screen os="centos;rhel;fedora;opensuse;sles"><prompt>#</prompt> <userinput>service openstack-nova-api start</userinput>
<prompt>#</prompt> <userinput>service openstack-nova-cert start</userinput>
<prompt>#</prompt> <userinput>service openstack-nova-consoleauth start</userinput>
<prompt>#</prompt> <userinput>service openstack-nova-scheduler start</userinput>
<prompt>#</prompt> <userinput>service openstack-nova-conductor start</userinput>
<prompt>#</prompt> <userinput>service openstack-nova-novncproxy start</userinput>
<prompt>#</prompt> <userinput>chkconfig openstack-nova-api on</userinput>
<prompt>#</prompt> <userinput>chkconfig openstack-nova-cert on</userinput>
<prompt>#</prompt> <userinput>chkconfig openstack-nova-consoleauth on</userinput>
<prompt>#</prompt> <userinput>chkconfig openstack-nova-scheduler on</userinput>
<prompt>#</prompt> <userinput>chkconfig openstack-nova-conductor on</userinput>
<prompt>#</prompt> <userinput>chkconfig openstack-nova-novncproxy on</userinput></screen>
</step>
<step>
<para>To verify your configuration, list available
images:</para>
<screen><prompt>#</prompt> <userinput>nova image-list</userinput>
<computeroutput>+--------------------------------------+-----------------+--------+--------+
| ID | Name | Status | Server |
+--------------------------------------+-----------------+--------+--------+
| acafc7c0-40aa-4026-9673-b879898e1fc2 | CirrOS 0.3.1 | ACTIVE | |
+--------------------------------------+-----------------+--------+--------+</computeroutput></screen>
</step>
</procedure>
</section>