/
install-config-glance.xml
82 lines (78 loc) · 4.71 KB
/
install-config-glance.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<?xml version="1.0" encoding="UTF-8"?>
<section xml:id="install-glance"
xmlns="http://docbook.org/ns/docbook"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:html="http://www.w3.org/1999/xhtml"
version="5.0">
<title>Installing and Configuring the Image Service</title>
<para>Install the Image service.</para>
<screen>sudo apt-get install glance</screen>
<para>After installing,
you need to delete the sqlite database it creates, then change
the configuration to point to the mysql database. </para>
<para>Delete the <filename>glance.sqlite</filename> file created in the /var/lib/glance/
directory.</para>
<screen>sudo rm /var/lib/glance/glance.sqlite</screen>
<section xml:id="configure-glance-mysql"><title>Configuring the Image Service database backend</title>
<para>Configure the backend data store. For MySQL, create a glance MySQL database and a glance MySQL user. Grant the "glance" user full
access to the glance MySQL database.</para><para>Start the MySQL command line client by running:</para>
<para><literallayout class="monospaced">mysql -u root -p</literallayout></para><para>Enter the mysql root user's password when prompted.</para>
<para>To configure the MySQL database, create the glance database. </para><para><literallayout class="monospaced">mysql> CREATE DATABASE glance;</literallayout>
</para><para>Create a MySQL user for the newly-created glance database that has full control of the database. </para>
<para><literallayout class="monospaced">mysql> GRANT ALL ON glance.* TO 'glance'@'%' IDENTIFIED BY 'yourpassword';</literallayout></para>
<para>Enter quit at the mysql> prompt to exit MySQL.</para><para><literallayout class="monospaced">mysql> quit</literallayout></para></section>
<section xml:id="configure-glance-files"><title>Edit the Glance configuration files and paste ini middleware files</title>
<para> Update
<filename>/etc/glance/glance-api-paste.ini</filename>
and configure the admin_* values under
[filter:authtoken].</para>
<screen>[filter:authtoken]
admin_tenant_name = service
admin_user = glance
admin_password = glance</screen>
<para>Ensure that the glance-api pipeline section includes
authtoken:</para>
<screen>[pipeline:glance-api]
pipeline = versionnegotiation authtoken auth-context apiv1app</screen>
<para>Add this to the end of <filename>/etc/glance/glance-api.conf</filename>.</para>
<screen>[paste_deploy]
flavor = keystone</screen>
<para>Restart glance-api to pick up these changed settings.</para>
<screen>service glance-api restart</screen>
<para>Add this to the end of <filename>/etc/glance/glance-registry.conf</filename>.</para>
<screen>[paste_deploy]
flavor = keystone</screen>
<para>Update
<filename>/etc/glance/glance-registry-paste.ini</filename>,
configure the admin_* values under
[filter:authtoken]:</para>
<screen>[filter:authtoken]
admin_tenant_name = service
admin_user = glance
admin_password = glance</screen>
<para>Ensure that the glance-registry pipeline section includes authtoken:</para>
<screen>[pipeline:glance-registry]
#pipeline = context registryapp
# NOTE: use the following pipeline for keystone
pipeline = authtoken auth-context context registryapp</screen>
<para>Ensure that the <filename>/etc/glance/glance-registry.conf</filename> and
<filename>/etc/glance/glance-scrubber.conf</filename>
files point to the MySQL database rather than
sqlite.<programlisting>sql_connection = mysql://glance:yourpassword@192.168.206.130/glance</programlisting></para>
<para>Restart glance-registry and glance-api services.</para>
<screen>sudo service glance-registry restart
sudo service glance-api restart</screen>
<note><para>Any time you change the .conf files, restart the
corresponding service.</para></note>
<para>On Ubuntu 12.04, the database tables are under version
control and you must do these steps on a new install to
prevent the Image service from breaking possible upgrades.
<screen>glance-manage version_control 0
glance-manage db_sync</screen></para>
<note><para>Also note that this guide does not configure image
caching, refer to <link
xlink:href="http://glance.openstack.org"
>http://glance.openstack.org</link> for more
information.</para></note></section></section>