openstack-manuals/doc/install-guide/basic-install-files/basic-install_controller-glance.xml
Gauvain Pocentek 8198911886 Use a more generic URL for ubuntu image download
Change-Id: Ie04b949f84fbe6cd7ab06248597597ce3db9f9c1
2013-09-30 19:11:41 +02:00

114 lines
7.3 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="basic-install_controller-glance">
<title>OpenStack Image Service</title>
<para>The Image Service provides a catalog of virtual machine
images from which you can launch instances.</para>
<para>For example, if a <phrase os="ubuntu">Ubuntu
12.04</phrase><phrase os="centos;rhel;fedora">Fedora
19</phrase><phrase os="opensuse">openSUSE 12.3</phrase>
image exists, you can use it to launch a
<phrase os="ubuntu">Ubuntu 12.04</phrase><phrase
os="centos;rhel;fedora">Fedora 19</phrase>
<phrase os="opensuse">openSUSE 12.3</phrase>
instance.</para>
<procedure>
<title>To install and configure the OpenStack Image
Service</title>
<step>
<para>Install the OpenStack Image packages, as follows:
<screen os="ubuntu;debian"><prompt>#</prompt> <userinput>apt-get install glance</userinput></screen>
<screen os="centos;rhel;fedora"><prompt>#</prompt> <userinput>yum install openstack-glance</userinput></screen>
<screen os="opensuse"><prompt>#</prompt> <userinput>zypper install openstack-glance python-glanceclient</userinput></screen>
</para>
</step>
<step>
<para>Configure the OpenStack Image Service, as
follows:</para>
<substeps>
<step>
<para>The OpenStack Image Service provides the
<systemitem class="service">glance-api</systemitem> and
<systemitem class="service">glance-registry</systemitem>
services. You configure these services
identically. However, be aware that each
provides a distinct service.</para>
<para>Edit <filename>/etc/glance/glance-api.conf</filename>
and <filename>/etc/glance/glance-registry.conf</filename>,
as follows:
<programlisting language="ini">[DEFAULT]
sql_connection = mysql://glance:password@localhost/glance
[keystone_authtoken]
admin_tenant_name = service
admin_user = glance
admin_password = password
[paste_deploy]
flavor=keystone</programlisting></para>
</step>
<step>
<para>Restart both services, as follows:
<screen os="ubuntu;debian"><prompt>#</prompt> <userinput>service glance-api restart &amp;&amp; service glance-registry restart</userinput></screen>
<screen os="centos;rhel;fedora"><prompt>#</prompt> <userinput>service openstack-glance-api restart</userinput>
<prompt>#</prompt> <userinput>service openstack-glance-registry restart</userinput></screen>
<screen os="opensuse"><prompt>#</prompt> <userinput>systemctl restart openstack-glance-api</userinput>
<prompt>#</prompt> <userinput>systemctl restart openstack-glance-registry</userinput></screen>
<note>
<para>Check the
<literal>/var/log/glance/*.log</literal>
files for errors that cause the Image
Service to fail to start.</para>
</note>
</para>
</step>
<step os="opensuse">
<para>Enable both Glance services:
<screen><prompt>#</prompt> <userinput>systemctl enable openstack-glance-api openstack-glance-registry</userinput></screen>
</para>
</step>
<step>
<para>Create the OpenStack Image tables in the
database, as follows:
<screen><prompt>#</prompt> <userinput>glance-manage db_sync</userinput></screen></para>
</step>
<step>
<para os="ubuntu;debian">Download and import Ubuntu 12.04
LTS UEC image:
<screen><prompt>$</prompt> <userinput>wget http://uec-images.ubuntu.com/precise/current/precise-server-cloudimg-amd64-disk1.img</userinput>
<prompt>$</prompt> <userinput>glance image-create --is-public true --disk-format qcow2 \
--container-format bare --name "Ubuntu" \
&lt; precise-server-cloudimg-amd64-disk1.img</userinput></screen></para>
<para os="centos;rhel;fedora"> Download and import
the latest Fedora cloud image:
<screen><prompt>$</prompt> <userinput>wget http://cloud.fedoraproject.org/fedora-latest.x86_64.qcow2</userinput>
<prompt>#</prompt> <userinput>glance image-create --is-public true --disk-format qcow2 \
--container-format bare --name "Fedora" &lt; fedora-latest.x86_64.qcow2</userinput> </screen></para>
<para>Download and import the CirrOS QCOW2 Image:
<screen><prompt>$</prompt> <userinput>wget http://download.cirros-cloud.net/0.3.1/cirros-0.3.1-x86_64\
-disk.img</userinput>
<prompt>$</prompt> <userinput>glance image-create --is-public true --disk-format qcow2 \
--container-format bare --name "CirrOS 0.3.1" \
&lt; cirros-0.3.1-x86_64-disk.img</userinput></screen>
</para>
</step>
<step>
<para>Check if the images have been introduced in
the index:
<screen os="ubuntu;debian"><prompt>$</prompt> <userinput>glance image-list</userinput></screen><screen os="ubuntu"><computeroutput>+--------------------------------------+--------------+-------------+------------------+-----------+--------+
| ID | Name | Disk Format | Container Format | Size | Status |
+--------------------------------------+--------------+-------------+------------------+-----------+--------+
| acafc7c0-40aa-4026-9673-b879898e1fc2 | CirrOS 0.3.1 | qcow2 | bare | 13147648 | active |
| 62f9278e-a26e-4fa0-9537-1eb503aa2f01 | Ubuntu | qcow2 | bare | 253755392 | active |
+--------------------------------------+--------------+-------------+------------------+-----------+--------+</computeroutput></screen><screen os="centos;rhel;fedora"><prompt>$</prompt> <userinput>glance image-list</userinput></screen><screen os="centos;rhel;fedora"><computeroutput>+--------------------------------------+--------------+-------------+------------------+-----------+--------+
| ID | Name | Disk Format | Container Format | Size | Status |
+--------------------------------------+--------------+-------------+------------------+-----------+--------+
| acafc7c0-40aa-4026-9673-b879898e1fc2 | CirrOS 0.3.1 | qcow2 | bare | 13147648 | active |
| 62f9278e-a26e-4fa0-9537-1eb503aa2f01 | Fedora | qcow2 | bare | 237371392 | active |
+--------------------------------------+--------------+-------------+------------------+-----------+--------+</computeroutput></screen></para>
</step>
</substeps>
</step>
</procedure>
</section>