Glance & Its Installation | OpenStack's Image Service - Flux7 Blog

[Tweet "This tutorial is on OpenStack's Image Service Glance"]

This tutorial is on OpenStack's Image Service Glance - its components and step-by-step guide to install and use Glance.


The OpenStack Image Service called Glance provides discovery, registration and delivery services for disk and server images.

It has the ability to copy (or snapshot) a server image and then to store it promptly. Stored images then can be used as templates to get new servers up and running quickly, and can also be used to store and catalog unlimited backups.

Virtual-machine images can be stored in various locations, including simple filesystems and object-storage systems such as OpenStack Object Storage (code named Swift).

Glance includes the following components:

Glance-api: Accepts Image API calls for image discovery, retrieval and storage.

Glance-registry: Stores, processes, and retrieves metadata for images. Metadata includes size, type and so on.

Database: Stores image metadata and supports many backends, including MySQL, SQlite and mongodb.

Storage repository: Supports normal file systems, RADOS block devices, Amazon S3 and HTTP for image storage.

Installing Glance


a. Install Glance services.

<i>#apt-get install glance python-glanceclient</i>

b. Create database. Glance uses database to store information. In this case, we’ll use MySQL as the default.

<i>&gt; create database glance;</i>
<i>&gt; grant all privileges on glance.* to [email protected] identified by ‘StrongPass’;</i>
<i>&gt; grant all privileges on keystone.* to [email protected]'%' identified by ‘StrongPass’;</i>

c. Create Glance user and add the user to tenant service with admin role.

<i># keystone user-create --name=glance --pass=90b68569e6da [email protected]</i>
<i># keystone user-role-add --user=glance --tenant=service --role=admin

d. Register Glance service at Keystone.

<i># keystone service-create --name=glance --type=image --description="Glance Image Service"</i>

e. Create Glance endpoint by using the the Glance service id as the service-id.

<i># keystone endpoint-create --service-id=a3f9c625a3b9443f8e66bf4e5de2349f --publicurl=</i><a href="http://controller:9292/"><i></i></a><i> --internalurl=</i>

f. Change database connection at Glance configuration and the Keystone user details.

g. Edit /etc/glance/glance-registry.conf and /etc/glance/glance-api.conf and change the database connection string.

<i>sql_connection = mysql://glanceUser:[email protected]/glance</i>

h. Now change Keystone authentication details under the [keystone_authentication] section:

<i>auth_uri =</i>
<i>auth_host =</i>
<i>auth_port = 35357</i>
<i>auth_protocol = http</i>
<i>admin_tenant_name = service</i>
<i>admin_user = glance</i>
<i>admin_password = 90b68569e6da</i>

Also change flavor to Keystone under the [paste_deploy] section:-

<i>flavor = keystone</i>

i. Edit /etc/glance/glance-registry-paste.ini and /etc/glance/glance-api-paste.ini and change [filter:authtoken].


j. Finally, restart Glance services.

<i># service glance-registry restart</i>
<i># service glance-api restart</i>


Did you find this useful?  

Interested in getting tips, best practices and commentary delivered regularly? Click the button below to sign up for our blog and set your topic and frequency preferences.

Sign Me Up!

March 20, 2014 / Compute

About the Author

Flux7 Labs
Find me on:

Join Us

Join thousands of technology enthusiasts, subscribe and get expert perspective in your inbox.

Connect With Us