Updated Compute installation and added instance-boot procedure

nova-controller:Turned steps into procedure. Added note to make
 api_paste.ini visible. Fixed endpoint-create parameters.
nova-compute: Turned steps into procedure. Fixed typo. Added note
 to make api_paste.ini visible.
nova-boot: New page/procedure for launching an instance.

Change-Id: I081e163243cbb3b2a00b30f4fece1ab09f0df9ad
This commit is contained in:
Summer Long 2013-10-10 13:38:29 +10:00 committed by Tom Fifield
parent 65cb51f9cb
commit 1d6875de40
3 changed files with 230 additions and 105 deletions

View File

@ -5,5 +5,136 @@
xml:id="nova-boot">
<title>Booting an Image</title>
<para>FIXME</para>
<para>After you've configured the Compute service, you
can now launch an instance. An instance is a virtual machine provisioned by
OpenStack on one of the Compute servers. Use the procedure below to launch a
low-resource instance using an image you've already downloaded.</para>
<note>
<para>This procedure assumes you have:
<itemizedlist>
<listitem><para>Appropriate environment
variables set to specify your credentials (see
<xref linkend="keystone-verify"/>
</para></listitem>
<listitem><para>Downloaded an image (see <xref linkend="glance-verify"/>).
</para></listitem>
<listitem><para>Configured networking (see <xref linkend="nova-network"/>).
</para></listitem>
</itemizedlist>
</para>
</note>
<procedure>
<title>Launch a Compute instance</title>
<step><para>Generate a keypair consisting of a private key and a public key to be able to launch instances
on OpenStack. These keys are injected into the instances to make
password-less SSH access to the instance. This depends on the way the
necessary tools are bundled into the images. For more details, see
"Manage instances" in the
<link xlink:href="http://docs.openstack.org/user-guide-admin/content/cli_manage_images.html">Administration User Guide</link>.</para>
<screen><prompt>$</prompt> <userinput>ssh-keygen</userinput>
<prompt>$</prompt> <userinput>cd .ssh</userinput>
<prompt>$</prompt> <userinput>nova keypair-add --pub_key id_rsa.pub mykey</userinput></screen>
<para>You have just created a new keypair called mykey. The private key id_rsa is
saved locally in ~/.ssh which can be used to connect to an instance
launched using mykey as the keypair. You can view available keypairs
using the <command>nova keypair-list</command> command.</para>
<screen><prompt>$</prompt> <userinput>nova keypair-list</userinput>
<computeroutput>+-------+-------------------------------------------------+
| Name | Fingerprint |
+-------+-------------------------------------------------+
| mykey | b0:18:32:fa:4e:d4:3c:1b:c4:6c:dd:cb:53:29:13:82 |
| mykey2 | b0:18:32:fa:4e:d4:3c:1b:c4:6c:dd:cb:53:29:13:82 |
+-------+-------------------------------------------------+</computeroutput></screen>
</step>
<step><para>To launch an instance using OpenStack, you must specify the ID for the flavor you want to use
for the instance. A flavor is a resource allocation profile. For
example, it specifies how many virtual CPUs and how much RAM your
instance will get. To see a list of the available profiles, run the
<command>nova flavor-list</command> command.</para>
<screen><prompt>$</prompt> <userinput>nova flavor-list</userinput>
<computeroutput>+----+-----------+-----------+------+-----------+------+-------+-------------+-----------+
| ID | Name | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public |
+----+-----------+-----------+------+-----------+------+-------+-------------+-----------+
| 1 | m1.tiny | 512 | 1 | 0 | | 1 | 1.0 | True |
| 2 | m1.small | 2048 | 20 | 0 | | 1 | 1.0 | True |
| 3 | m1.medium | 4096 | 40 | 0 | | 2 | 1.0 | True |
| 4 | m1.large | 8192 | 80 | 0 | | 4 | 1.0 | True |
| 5 | m1.xlarge | 16384 | 160 | 0 | | 8 | 1.0 | True |
+----+-----------+-----------+------+-----------+------+-------+-------------+-----------+</computeroutput></screen>
</step>
<step>
<para>Get the ID of the image you would like to use for the instance using the
<command>nova image-list</command> command.</para>
<screen><prompt>$</prompt> nova image-list
<computeroutput>+--------------------------------------+--------------+--------+--------+
| ID | Name | Status | Server |
+--------------------------------------+--------------+--------+--------+
| 9e5c2bee-0373-414c-b4af-b91b0246ad3b | CirrOS 0.3.1 | ACTIVE | |
+--------------------------------------+--------------+--------+--------+</computeroutput></screen>
</step>
<step><para>Create the instance using the <command>nova boot</command>.
<screen><prompt>$</prompt> <userinput>nova boot --flavor <replaceable>flavorType</replaceable> --key_name <replaceable>keypairName</replaceable> --image <replaceable>ID</replaceable> <replaceable>newInstanceName</replaceable></userinput> </screen>Create
an instance using flavor 1 or 2, for example:</para>
<screen><prompt>$</prompt> <userinput>nova boot --flavor 1 --key_name mykey --image 9e5c2bee-0373-414c-b4af-b91b0246ad3b cirrOS</userinput>
<computeroutput>+--------------------------------------+--------------------------------------+
| Property | Value |
+--------------------------------------+--------------------------------------+
| OS-EXT-STS:task_state | scheduling |
| image | CirrOS 0.3.1 |
| OS-EXT-STS:vm_state | building |
| OS-EXT-SRV-ATTR:instance_name | instance-00000001 |
| OS-SRV-USG:launched_at | None |
| flavor | m1.tiny |
| id | 3bdf98a0-c767-4247-bf41-2d147e4aa043 |
| security_groups | [{u'name': u'default'}] |
| user_id | 530166901fa24d1face95cda82cfae56 |
| OS-DCF:diskConfig | MANUAL |
| accessIPv4 | |
| accessIPv6 | |
| progress | 0 |
| OS-EXT-STS:power_state | 0 |
| OS-EXT-AZ:availability_zone | nova |
| config_drive | |
| status | BUILD |
| updated | 2013-10-10T06:47:26Z |
| hostId | |
| OS-EXT-SRV-ATTR:host | None |
| OS-SRV-USG:terminated_at | None |
| key_name | mykey |
| OS-EXT-SRV-ATTR:hypervisor_hostname | None |
| name | cirrOS |
| adminPass | DWCdW6FnsKNq |
| tenant_id | e66d97ac1b704897853412fc8450f7b9 |
| created | 2013-10-10T06:47:23Z |
| os-extended-volumes:volumes_attached | [] |
| metadata | {} |
+--------------------------------------+--------------------------------------+</computeroutput></screen>
<note><para>If there is not enough RAM available for the instance, Compute will create the instance, but
will not start it (status 'Error').</para></note>
</step>
<step><para>After the instance has been created, it will show up in the output of <command>nova
list</command> (as the instance is booted up, the status will change from 'BUILD' to
'ACTIVE').</para>
<screen><prompt>$</prompt> <userinput>nova list</userinput>
<computeroutput>+--------------------------------------+--------+--------+----------------------+
| ID | Name | Status | Networks |
+--------------------------------------+--------+--------+----------------------+
| 3bdf98a0-c767-4247-bf41-2d147e4aa043 | cirrOS | BUILD | demonet=192.168.0.11 |
+--------------------------------------+--------+--------+----------------------+</computeroutput>
<prompt>$</prompt> <userinput>nova list</userinput>
<computeroutput>+--------------------------------------+--------+--------+----------------------+
| ID | Name | Status | Networks |
+--------------------------------------+--------+--------+----------------------+
| 3bdf98a0-c767-4247-bf41-2d147e4aa043 | cirrOS | ACTIVE | demonet=192.168.0.11 |
+--------------------------------------+--------+--------+----------------------+</computeroutput>
</screen>
<note><para>You can also retrieve additional details about the specific instance using the
<command>nova show</command> command.</para>
<screen><prompt>$</prompt> <userinput>nova show 3bdf98a0-c767-4247-bf41-2d147e4aa043</userinput></screen></note>
</step>
<step><para>Once enough time has passed so that the instance is fully booted and initialized,
you can <command>ssh</command> into the instance. You can obtain the IP address of the instance from the
output of <command>nova list</command>.</para>
<screen><prompt>$</prompt> ssh -i mykey root@192.168.0.11</screen></step>
</procedure>
</section>

View File

@ -3,102 +3,89 @@
xmlns:xlink="http://www.w3.org/1999/xlink"
version="5.0"
xml:id="nova-compute">
<title>Installing a Compute Node</title>
<title>Configuring a Compute Node</title>
<para>After configuring the Compute Services on the controller node,
configure a second system to be 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 this guide uses separate
systems. This makes it easy to scale horizontally by adding additional
compute nodes following the instructions in this section.</para>
<para>After configuring the Compute Services on the controller node, configure a second system to
be 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 this guide uses 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>
<para>Begin by configuring the system using the instructions in
<xref linkend="ch_basics"/>. Note the following differences from the
controller node:</para>
<itemizedlist>
<listitem>
<para>Use different IP addresses when editing the files
<filename>ifcfg-eth0</filename> and <filename>ifcfg-eht1</filename>.
This guide uses <literal>192.168.0.11</literal> for the internal network
and <literal>10.0.0.11</literal> for the external network.</para>
</listitem>
<listitem>
<para>Set the hostname to <literal>compute1</literal>. Ensure that the
IP addresses and hostnames for both nodes are listed in the
<filename>/etc/hosts</filename> file on each system.</para>
</listitem>
<listitem>
<para>Do not run the NTP server. Follow the instructions in
<xref linkend="basics-ntp"/> to synchronize from the controller node.</para>
</listitem>
<listitem>
<para>You do not need to install the MySQL database server or start
the MySQL service. Just install the client libraries.</para>
</listitem>
<listitem>
<para>You do not need to install a messaging queue server.</para>
</listitem>
</itemizedlist>
<para>After configuring the operating system, install the appropriate
packages for the compute service.</para>
<screen os="ubuntu;debian"><prompt>#</prompt> <userinput>apt-get install nova-compute-kvm</userinput></screen>
<screen os="centos;rhel;fedora"><prompt>#</prompt> <userinput>yum install openstack-nova-compute</userinput></screen>
<screen os="opensuse"><prompt>#</prompt> <userinput>zypper install openstack-nova-compute kvm</userinput></screen>
<para>Either copy the file <filename>/etc/nova/nova.conf</filename> from the
controller node, or run the same configuration commands.</para>
<screen><prompt>#</prompt> <userinput>openstack-config --set /etc/nova/nova.conf \
<procedure>
<title>Configure a Compute Node</title>
<step><para>Begin by configuring the system using the instructions in
<xref linkend="ch_basics"/>. Note the following differences from the
controller node:</para>
<itemizedlist>
<listitem>
<para>Use different IP addresses when editing the files <filename>ifcfg-eth0</filename>
and <filename>ifcfg-eth1</filename>. This guide uses <literal>192.168.0.11</literal> for
the internal network and <literal>10.0.0.11</literal> for the external network.</para>
</listitem>
<listitem>
<para>Set the hostname to <literal>compute1</literal>. Ensure that the
IP addresses and hostnames for both nodes are listed in the
<filename>/etc/hosts</filename> file on each system.</para>
</listitem>
<listitem>
<para>Do not run the NTP server. Follow the instructions in
<xref linkend="basics-ntp"/> to synchronize from the controller node.</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>
</itemizedlist>
<note><para>You do not need to install a messaging queue server.</para>
</note></step>
<step><para>After configuring the operating system, install the appropriate
packages for the compute service.</para>
<screen os="ubuntu;debian"><prompt>#</prompt> <userinput>apt-get install nova-compute-kvm</userinput></screen>
<screen os="centos;rhel;fedora"><prompt>#</prompt> <userinput>yum install openstack-nova-compute</userinput></screen>
<screen os="opensuse"><prompt>#</prompt> <userinput>zypper install openstack-nova-compute kvm</userinput></screen>
</step>
<step><para>Either copy the file <filename>/etc/nova/nova.conf</filename> from the
<replaceable>controller</replaceable> node, or run the same configuration commands.</para>
<screen><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 DEFAULT auth_host controller</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>
<!-- FIXME: ubuntu -->
<screen os="fedora;rhel;centos"><prompt>#</prompt> <userinput>openstack-config --set /etc/nova/nova.conf \
<!-- FIXME: ubuntu -->
<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 controller</userinput></screen>
<para>Set the configuration keys <literal>my_ip</literal>,
<literal>vncserver_listen</literal>, and
<literal>vncserver_proxyclient_address</literal> to the IP address of the
compute node on the internal network.</para>
<screen><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 qpid_hostname <replaceable>controller</replaceable></userinput></screen></step>
<step><para>Set the configuration keys <literal>my_ip</literal>,
<literal>vncserver_listen</literal>, and
<literal>vncserver_proxyclient_address</literal> to the IP address of the
compute node on the internal network.</para>
<screen><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 vncserver_listen 192.168.0.11</userinput>
<prompt>#</prompt> <userinput>openstack-config --set /etc/nova/nova.conf DEFAULT vncserver_proxyclient_address 192.168.0.11</userinput></screen>
<para>Copy the file <filename>/etc/nova/api-paste.ini</filename> from the
controller node, or edit the file to add the credentials in the
<literal>[filter:authtoken]</literal> section.</para>
<programlisting language="ini">[filter:authtoken]
<prompt>#</prompt> <userinput>openstack-config --set /etc/nova/nova.conf DEFAULT vncserver_proxyclient_address 192.168.0.11</userinput></screen></step>
<step><para>Copy the file <filename>/etc/nova/api-paste.ini</filename> from the
<replaceable>controller</replaceable> node, or edit the file to add the credentials in the
<literal>[filter:authtoken]</literal> section.</para>
<programlisting language="ini">[filter:authtoken]
paste.filter_factory=keystoneclient.middleware.auth_token:filter_factory
auth_host=controller
admin_user=nova
admin_tenant_name=service
admin_password=<replaceable>NOVA_PASS</replaceable>
</programlisting>
<!-- FIXME: kvm stuff -->
<para>Finally, start the compute service and configure it to start when
the system boots.</para>
<screen os="ubuntu;debian"><prompt>#</prompt> <userinput>service nova-compute start</userinput>
<note><para>Ensure that <filename>api_paste_config=/etc/nova/api-paste.ini</filename> is set in
<filename>/etc/nova/nova.conf</filename>.</para></note>
<!-- FIXME: kvm stuff --></step>
<step><para>Start the Compute service and configure it to start when the system boots.</para>
<screen os="ubuntu;debian"><prompt>#</prompt> <userinput>service nova-compute start</userinput>
<prompt>#</prompt> <userinput>chkconfig nova-compute on</userinput></screen>
<screen os="centos;rhel;fedora"><prompt>#</prompt> <userinput>service openstack-nova-compute start</userinput>
<screen os="centos;rhel;fedora"><prompt>#</prompt> <userinput>service openstack-nova-compute start</userinput>
<prompt>#</prompt> <userinput>chkconfig openstack-nova-compute on</userinput></screen>
<screen os="opensuse"><prompt>#</prompt> <userinput>systemctl start openstack-nova-compute</userinput>
<prompt>#</prompt> <userinput>systemctl enable openstack-nova-compute</userinput></screen>
</section>
<screen os="opensuse"><prompt>#</prompt> <userinput>systemctl start openstack-nova-compute</userinput>
<prompt>#</prompt> <userinput>systemctl enable openstack-nova-compute</userinput></screen></step>
</procedure>
</section>

View File

@ -12,9 +12,10 @@
node to run the service that launches virtual machines. This section
details the installation and configuration on the controller node.</para>
<procedure>
<title>Install the Nova Controller Services</title>
<step>
<para os="fedora;rhel;centos;opensuse">Install the <literal>openstack-nova</literal>
meta-package. This package will install all of the various Nova packages, most of
meta-package. This package installs all of the various Compute packages, most of
which will be used on the controller node in this guide.</para>
<screen os="fedora;rhel;centos"><prompt>#</prompt> <userinput>yum install openstack-nova</userinput></screen>
@ -61,7 +62,7 @@ IDENTIFIED BY 'NOVA_DBPASS';</userinput></screen>
</step>
<step os="fedora;rhel;centos;opensuse">
<para>You now have to tell the Compute Service to use that database.</para>
<para>Tell the Compute Service to use the created database.</para>
<screen><prompt>#</prompt> <userinput>openstack-config --set /etc/nova/nova.conf \
database connection mysql://nova:<replaceable>NOVA_DBPASS</replaceable>@controller/nova</userinput></screen>
@ -77,6 +78,7 @@ IDENTIFIED BY 'NOVA_DBPASS';</userinput></screen>
<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>
</step>
<step>
<para>Create a user called <literal>nova</literal> that the Compute Service
can use to authenticate with the Identity Service. Use the
@ -87,68 +89,73 @@ IDENTIFIED BY 'NOVA_DBPASS';</userinput></screen>
<prompt>#</prompt> <userinput>keystone user-role-add --user=nova --tenant=service --role=admin</userinput></screen>
</step>
<step>
<para>For the Compute Service to use these credentials, you have to add
<para>For the Compute Service to use these credentials, you must add
them to the <filename>nova.conf</filename> configuration file.</para>
<screen><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 controller</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>
</step>
<step>
<para>You also have to add the credentials to the file
<para>Add the credentials to the file
<filename>/etc/nova/api-paste.ini</filename>. Open the file in a text editor
and locate the section <literal>[filter:authtoken]</literal>.
Make sure the following options are set:</para>
<programlisting language="ini">[filter:authtoken]
paste.filter_factory=keystoneclient.middleware.auth_token:filter_factory
auth_host=controller
auth_host=<replaceable>controller</replaceable>
admin_user=nova
admin_tenant_name=service
admin_password=<replaceable>NOVA_PASS</replaceable>
</programlisting>
<note><para>Ensure that <literal>api_paste_config=/etc/nova/api-paste.ini</literal>
is set in <filename>/etc/nova/nova.conf</filename>.</para></note>
</step>
<step>
<para>You have to register the Compute Service with the Identity Service
so that other OpenStack services can locate it. Register the service and
specify the endpoint using the <command>keystone</command> command.</para>
<screen><prompt>#</prompt> <userinput>keystone service-create --name=nova --type=compute \
--description="Nova Compute Service"</userinput></screen>
</step>
<para>Note the <literal>id</literal> property returned and use it when
creating the endpoint.</para>
<screen><prompt>#</prompt> <userinput>keystone endpoint-create \
<step><para>Note the <literal>id</literal> property returned and use it when
creating the endpoint.</para>
<screen><prompt>#</prompt> <userinput>keystone endpoint-create \
--service-id=<replaceable>the_service_id_above</replaceable> \
--publicurl=http://controller:8774/v2/%(tenant_id)s \
--internalurl=http://controller:8774/v2/%(tenant_id)s \
--adminurl=http://controller:8774/v2/%(tenant_id)s</userinput></screen>
--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>
<para os="fedora;rhel;centos">Configure the Compute Service to use the
<step os="fedora;rhel;centos">
<para>Configure the Compute Service to use the
Qpid message broker by setting the following configuration keys.</para>
<screen os="fedora;rhel;centos"><prompt>#</prompt> <userinput>openstack-config --set /etc/nova/nova.conf \
<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 controller</userinput></screen>
<prompt>#</prompt> <userinput>openstack-config --set /etc/nova/nova.conf DEFAULT qpid_hostname <replaceable>controller</replaceable></userinput>
</screen>
</step>
<para os="ubuntu;debian">Configure the Compute Service to use the RabbitMQ
<step os="ubuntu;debian">
<para>Configure the Compute Service to use the RabbitMQ
message broker by setting the following configuration keys. They are found in
the <literal>DEFAULT</literal> configuration group of the
<filename>/etc/nova/nova.conf</filename> file.</para>
<screen os="ubuntu;debian">rpc_backend = nova.rpc.impl_kombu
<screen>rpc_backend = nova.rpc.impl_kombu
rabbit_host = controller</screen>
<para os="opensuse">Configure the Compute Service to use the RabbitMQ
</step>
<step os="opensuse">
<para>Configure the Compute Service to use the RabbitMQ
message broker by setting the following configuration keys.</para>
<screen os="opensuse"><prompt>#</prompt> <userinput>openstack-config --set /etc/nova/nova.conf \
<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>