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

  • March 19, 2014

[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 glanceUser@localhost identified by ‘StrongPass’;</i>
<i>&gt; grant all privileges on keystone.* to glanceUser@'%' 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</i>
<i># keystone user-role-add --user=glance --tenant=service --role=admin </i>

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:StrongPass@localhost/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.

Subscribe to our blog


Related Blog Posts