b2ddfaf3d5
This fixes an inconsistency between the install guide and other OpenStack components, which names the first region in Camel Case. Change-Id: I80a1827e9008777e73dce1dd3a95ece5dd614744 Related-Change: I8f47be1b4b43defb86b4da2a34c5f40494361045
323 lines
14 KiB
XML
323 lines
14 KiB
XML
<?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="glance-install">
|
|
<title>Install and configure</title>
|
|
<para>This section describes how to install and configure the Image service,
|
|
code-named glance, on the controller node. For simplicity, this
|
|
configuration stores images on the local file system.</para>
|
|
<note>
|
|
<para>This section assumes proper installation, configuration, and
|
|
operation of the Identity service as described in
|
|
<xref linkend="keystone-install"/> and <xref
|
|
linkend="keystone-verify"/> as well as setup of the
|
|
<filename>admin-openrc.sh</filename> script as described in
|
|
<xref linkend="keystone-client-environment-scripts"/>.</para>
|
|
</note>
|
|
<procedure os="ubuntu;rhel;centos;fedora;sles;opensuse">
|
|
<title>To configure prerequisites</title>
|
|
<para>Before you install and configure the Image service, you must
|
|
create a database, service credentials, and API endpoint.</para>
|
|
<step>
|
|
<para>To create the database, complete these steps:</para>
|
|
<substeps>
|
|
<step>
|
|
<para>Use the database access client to connect to the database
|
|
server as the <literal>root</literal> user:</para>
|
|
<screen><prompt>$</prompt> <userinput>mysql -u root -p</userinput></screen>
|
|
</step>
|
|
<step>
|
|
<para>Create the <literal>glance</literal> database:</para>
|
|
<screen><userinput>CREATE DATABASE glance;</userinput></screen>
|
|
</step>
|
|
<step>
|
|
<para>Grant proper access to the <literal>glance</literal>
|
|
database:</para>
|
|
<screen><userinput>GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'localhost' \
|
|
IDENTIFIED BY '<replaceable>GLANCE_DBPASS</replaceable>';</userinput>
|
|
<userinput>GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%' \
|
|
IDENTIFIED BY '<replaceable>GLANCE_DBPASS</replaceable>';</userinput></screen>
|
|
<para>Replace <replaceable>GLANCE_DBPASS</replaceable> with a suitable
|
|
password.</para>
|
|
</step>
|
|
<step>
|
|
<para>Exit the database access client.</para>
|
|
</step>
|
|
</substeps>
|
|
</step>
|
|
<step>
|
|
<para>Source the <literal>admin</literal> credentials to gain access to
|
|
admin-only CLI commands:</para>
|
|
<screen><prompt>$</prompt> <userinput>source admin-openrc.sh</userinput></screen>
|
|
</step>
|
|
<step>
|
|
<para>To create the service credentials, complete these steps:</para>
|
|
<substeps>
|
|
<step>
|
|
<para>Create the <literal>glance</literal> user:</para>
|
|
<screen><prompt>$</prompt> <userinput>openstack user create --password-prompt glance</userinput>
|
|
<computeroutput>User Password:
|
|
Repeat User Password:
|
|
+----------+----------------------------------+
|
|
| Field | Value |
|
|
+----------+----------------------------------+
|
|
| email | None |
|
|
| enabled | True |
|
|
| id | 1dc206e084334db2bee88363745da014 |
|
|
| name | glance |
|
|
| username | glance |
|
|
+----------+----------------------------------+</computeroutput></screen>
|
|
</step>
|
|
<step>
|
|
<para>Add the <literal>admin</literal> role to the
|
|
<literal>glance</literal> user and <literal>service</literal>
|
|
project:</para>
|
|
<screen><prompt>$</prompt> <userinput>openstack role add --project service --user glance admin</userinput>
|
|
<computeroutput>+-------+----------------------------------+
|
|
| Field | Value |
|
|
+-------+----------------------------------+
|
|
| id | cd2cb9a39e874ea69e5d4b896eb16128 |
|
|
| name | admin |
|
|
+-------+----------------------------------+</computeroutput></screen>
|
|
</step>
|
|
<step>
|
|
<para>Create the <literal>glance</literal> service entity:</para>
|
|
<screen><prompt>$</prompt> <userinput>openstack service create --type image \
|
|
--description "OpenStack Image service" glance</userinput>
|
|
<computeroutput>+-------------+----------------------------------+
|
|
| Field | Value |
|
|
+-------------+----------------------------------+
|
|
| description | OpenStack Image service |
|
|
| enabled | True |
|
|
| id | 178124d6081c441b80d79972614149c6 |
|
|
| name | glance |
|
|
| type | image |
|
|
+-------------+----------------------------------+</computeroutput></screen>
|
|
</step>
|
|
</substeps>
|
|
</step>
|
|
<step>
|
|
<para>Create the Image service API endpoint:</para>
|
|
<screen><prompt>$</prompt> <userinput>openstack endpoint create \
|
|
--publicurl http://<replaceable>controller</replaceable>:9292 \
|
|
--internalurl http://<replaceable>controller</replaceable>:9292 \
|
|
--adminurl http://<replaceable>controller</replaceable>:9292 \
|
|
--region RegionOne \
|
|
image</userinput>
|
|
<computeroutput>+--------------+----------------------------------+
|
|
| Field | Value |
|
|
+--------------+----------------------------------+
|
|
| adminurl | http://controller:9292 |
|
|
| id | 805b1dbc90ab47479111102bc6423313 |
|
|
| internalurl | http://controller:9292 |
|
|
| publicurl | http://controller:9292 |
|
|
| region | RegionOne |
|
|
| service_id | 178124d6081c441b80d79972614149c6 |
|
|
| service_name | glance |
|
|
| service_type | image |
|
|
+--------------+----------------------------------+</computeroutput></screen>
|
|
</step>
|
|
</procedure>
|
|
<procedure os="ubuntu;rhel;centos;fedora;sles;opensuse">
|
|
<title>To install and configure the Image service components</title>
|
|
<note>
|
|
<para>Default configuration files vary by distribution. You might need
|
|
to add these sections and options rather than modifying existing
|
|
sections and options. Also, an ellipsis (...) in the configuration
|
|
snippets indicates potential default configuration options that you
|
|
should retain.</para>
|
|
</note>
|
|
<step>
|
|
<para>Install the packages:</para>
|
|
<screen os="ubuntu"><prompt>#</prompt> <userinput>apt-get install glance python-glanceclient</userinput></screen>
|
|
<!-- The installation of python-glance is a workaround
|
|
for bug: https://bugzilla.redhat.com/show_bug.cgi?id=1213545 -->
|
|
<screen os="rhel;centos;fedora"><prompt>#</prompt> <userinput>yum install openstack-glance-api openstack-glance-registry \
|
|
openstack-glance python-glance python-glanceclient</userinput></screen>
|
|
<screen os="opensuse;sles"><prompt>#</prompt> <userinput>zypper install openstack-glance python-glanceclient</userinput></screen>
|
|
</step>
|
|
<step>
|
|
<para>Edit the <filename>/etc/glance/glance-api.conf</filename>
|
|
file and complete the following actions:</para>
|
|
<substeps>
|
|
<step>
|
|
<para>In the <literal>[database]</literal> section, configure
|
|
database access:</para>
|
|
<programlisting language="ini">[database]
|
|
...
|
|
connection = mysql://glance:<replaceable>GLANCE_DBPASS</replaceable>@<replaceable>controller</replaceable>/glance</programlisting>
|
|
<para>Replace <replaceable>GLANCE_DBPASS</replaceable> with the
|
|
password you chose for the Image service database.</para>
|
|
</step>
|
|
<step>
|
|
<para>In the <literal>[keystone_authtoken]</literal> and
|
|
<literal>[paste_deploy]</literal> sections, configure Identity
|
|
service access:</para>
|
|
<programlisting language="ini">[keystone_authtoken]
|
|
...
|
|
auth_uri = http://<replaceable>controller</replaceable>:5000
|
|
auth_url = http://<replaceable>controller</replaceable>:35357
|
|
auth_plugin = password
|
|
project_domain_id = default
|
|
user_domain_id = default
|
|
project_name = service
|
|
username = glance
|
|
password = <replaceable>GLANCE_PASS</replaceable>
|
|
|
|
[paste_deploy]
|
|
...
|
|
flavor = keystone</programlisting>
|
|
<para>Replace <replaceable>GLANCE_PASS</replaceable> with the
|
|
password you chose for the <literal>glance</literal> user in the
|
|
Identity service.</para>
|
|
<note>
|
|
<para>Comment out or remove any other options in the
|
|
<literal>[keystone_authtoken]</literal> section.</para>
|
|
</note>
|
|
</step>
|
|
<step>
|
|
<para>In the <literal>[glance_store]</literal> section, configure
|
|
the local file system store and location of image files:</para>
|
|
<programlisting language="ini">[glance_store]
|
|
...
|
|
default_store = file
|
|
filesystem_store_datadir = /var/lib/glance/images/</programlisting>
|
|
</step>
|
|
<step>
|
|
<para>In the <literal>[DEFAULT]</literal> section, configure
|
|
the <literal>noop</literal> notification driver to disable
|
|
notifications because they only pertain to the optional
|
|
Telemetry service:</para>
|
|
<programlisting language="ini">[DEFAULT]
|
|
...
|
|
notification_driver = noop</programlisting>
|
|
<para>The Telemetry chapter provides an Image service configuration
|
|
that enables notifications.</para>
|
|
</step>
|
|
<step>
|
|
<para>(Optional) To assist with troubleshooting,
|
|
enable verbose logging in the <literal>[DEFAULT]</literal>
|
|
section:</para>
|
|
<programlisting language="ini">[DEFAULT]
|
|
...
|
|
verbose = True</programlisting>
|
|
</step>
|
|
</substeps>
|
|
</step>
|
|
<step>
|
|
<para>Edit the <filename>/etc/glance/glance-registry.conf</filename>
|
|
file and complete the following actions:</para>
|
|
<substeps>
|
|
<step>
|
|
<para>In the <literal>[database]</literal> section, configure
|
|
database access:</para>
|
|
<programlisting language="ini">[database]
|
|
...
|
|
connection = mysql://glance:<replaceable>GLANCE_DBPASS</replaceable>@<replaceable>controller</replaceable>/glance</programlisting>
|
|
<para>Replace <replaceable>GLANCE_DBPASS</replaceable> with the
|
|
password you chose for the Image service database.</para>
|
|
</step>
|
|
<step>
|
|
<para>In the <literal>[keystone_authtoken]</literal> and
|
|
<literal>[paste_deploy]</literal> sections, configure Identity
|
|
service access:</para>
|
|
<programlisting language="ini">[keystone_authtoken]
|
|
...
|
|
auth_uri = http://<replaceable>controller</replaceable>:5000
|
|
auth_url = http://<replaceable>controller</replaceable>:35357
|
|
auth_plugin = password
|
|
project_domain_id = default
|
|
user_domain_id = default
|
|
project_name = service
|
|
username = glance
|
|
password = <replaceable>GLANCE_PASS</replaceable>
|
|
|
|
[paste_deploy]
|
|
...
|
|
flavor = keystone</programlisting>
|
|
<para>Replace <replaceable>GLANCE_PASS</replaceable> with the
|
|
password you chose for the <literal>glance</literal> user in the
|
|
Identity service.</para>
|
|
<note>
|
|
<para>Comment out or remove any other options in the
|
|
<literal>[keystone_authtoken]</literal> section.</para>
|
|
</note>
|
|
</step>
|
|
<step>
|
|
<para>In the <literal>[DEFAULT]</literal> section, configure
|
|
the <literal>noop</literal> notification driver to disable
|
|
notifications because they only pertain to the optional
|
|
Telemetry service:</para>
|
|
<programlisting language="ini">[DEFAULT]
|
|
...
|
|
notification_driver = noop</programlisting>
|
|
<para>The Telemetry chapter provides an Image service configuration
|
|
that enables notifications.</para>
|
|
</step>
|
|
<step>
|
|
<para>(Optional) To assist with troubleshooting,
|
|
enable verbose logging in the <literal>[DEFAULT]</literal>
|
|
section:</para>
|
|
<programlisting language="ini">[DEFAULT]
|
|
...
|
|
verbose = True</programlisting>
|
|
</step>
|
|
</substeps>
|
|
</step>
|
|
<step os="rhel;centos;fedora;ubuntu">
|
|
<para>Populate the Image service database:</para>
|
|
<screen><prompt>#</prompt> <userinput>su -s /bin/sh -c "glance-manage db_sync" glance</userinput></screen>
|
|
</step>
|
|
</procedure>
|
|
<procedure os="debian">
|
|
<title>To install and configure the Image service components</title>
|
|
<step>
|
|
<para>Install the packages:</para>
|
|
<screen><prompt>#</prompt> <userinput>apt-get install glance python-glanceclient</userinput></screen>
|
|
</step>
|
|
<step>
|
|
<para>Respond to prompts for
|
|
<link linkend="debconf-dbconfig-common">database management</link>,
|
|
<link linkend="debconf-keystone_authtoken">Identity service
|
|
credentials</link>,
|
|
<link linkend="debconf-api-endpoints">service endpoint
|
|
registration</link>, and
|
|
<link linkend="debconf-rabbitmq">message broker
|
|
credentials</link>.</para>
|
|
</step>
|
|
<step>
|
|
<para>Select the <literal>keystone</literal> pipeline to configure the
|
|
Image service to use the Identity service:</para>
|
|
<mediaobject>
|
|
<imageobject>
|
|
<imagedata scale="50"
|
|
fileref="figures/debconf-screenshots/glance-common_pipeline_flavor.png"
|
|
/>
|
|
</imageobject>
|
|
</mediaobject>
|
|
</step>
|
|
</procedure>
|
|
<procedure>
|
|
<title>To finalize installation</title>
|
|
<step os="ubuntu;debian">
|
|
<para>Restart the Image service services:</para>
|
|
<screen><prompt>#</prompt> <userinput>service glance-registry restart</userinput>
|
|
<prompt>#</prompt> <userinput>service glance-api restart</userinput></screen>
|
|
</step>
|
|
<step os="rhel;centos;fedora;sles;opensuse">
|
|
<para>Start the Image service services and configure them to start when
|
|
the system boots:</para>
|
|
<screen><prompt>#</prompt> <userinput>systemctl enable openstack-glance-api.service openstack-glance-registry.service</userinput>
|
|
<prompt>#</prompt> <userinput>systemctl start openstack-glance-api.service openstack-glance-registry.service</userinput></screen>
|
|
</step>
|
|
<step os="ubuntu">
|
|
<para>By default, the Ubuntu packages create an SQLite database.</para>
|
|
<para>Because this configuration uses a SQL database server, you can
|
|
remove the SQLite database file:</para>
|
|
<screen><prompt>#</prompt> <userinput>rm -f /var/lib/glance/glance.sqlite</userinput></screen>
|
|
</step>
|
|
</procedure>
|
|
</section>
|