• DevOps
    Case Study

    How we built a resilient multi-account, multi-cloud solution for a Health Tech service provider!

    READ CASESTUDY
    icon

    24/7 DevOps as a Service

    Round-the-clock DevOps for uninterrupted efficiency.

    icon

    Infrastructure as a Code

    Crafting infrastructure with ingenious code.

    icon

    CI/CD Pipeline

    Automated CI/CD pipeline for seamless deployments.

    icon

    DevSecOps

    Integrated security in continuous DevOps practices.

    icon

    Hire DevOps Engineers

    Level up your team with DevOps visionaries.

    icon

    Consulting Services

    Navigate success with expert DevOps consulting.

  • TechOps
    Case Study

    How we built a scalable Odoo solution for a Travel Tech service provider!

    READ CASESTUDY

    WEB HOSTING SUPPORT

    icon

    HelpDesk Support

    Highly skilled 24/7 HelpDesk Support

    icon

    Product Support

    Boost your product support with our expertise.

    MANAGED SERVICES

    icon

    Server Management

    Don’t let server issues slow you down. Let us manage them for you.

    icon

    Server Monitoring

    Safeguard your server health with our comprehensive monitoring solutions.

    STAFF AUGMENTATION

    icon

    Hire an Admin

    Transform your business operations with our expert administrative support.

    icon

    Hire a Team

    Augment your workforce with highly skilled professionals from our diverse talent pool.

  • CloudOps
    Case Study

    How we helped a Private Deemed University in India, save US $3500/m on hosting charges!

    READ CASESTUDY
    icon

    AWS Well Architected Review

    Round-the-clock for uninterrupted efficiency

    icon

    Optimize

    Efficient CloudOps mastery for seamless cloud management

    icon

    Manage

    Automated CI/CD pipeline for seamless deployments

    icon

    Migrate

    Upgrade the journey, Migrate & Modernize seamlessly

    icon

    Modernize

    Simplify compliance complexities with our dedicated services

    icon

    FinOps as a Service

    FinOps as a Service

  • SecOps
    Case Study

    How we built a scalable Odoo solution for TravelTech service provider!

    READ CASESTUDY
    icon

    VAPT

    Vulnerability Assessment and Penetration Testing

    icon

    Source Code Review

    Ensuring source code security ans safe practices to reduce risks

    icon

    Security Consultation

    On demand services for improving server security

    icon

    System Hardening

    Reduced vulnerability and proactive protection

    icon

    Managed SoC

    Monitors and maintains system security. Quick response on incidents.

    icon

    Compliance as a Service

    Regulatory compliance, reduced risk

  • Insights
    Case Study

    How we helped a Private Deemed University in India, save US $3,500/m on hosting charges!

    READ CASESTUDY
    icon

    Blog

    Explore our latest articles and insights

    icon

    Case Studies

    Read about our client success stories

    icon

    Flipbook

    Explore our latest Flipbook

    icon

    Events

    Join us at upcoming events and conferences

    icon

    Webinars

    Watch our educational webinar series

  • Our Story
  • Contact Us

Interested to collaborate?

Get in touch with us!

Ready to elevate your business with certified cloud expertise? Contact us today to learn how our team can help you leverage cloud technology to drive growth, streamline operations, and enhance security.

  • AWSAWS
  • Azure CloudAzure Cloud
  • Google CloudGoogle Cloud
  • Akamai CloudAkamai Cloud
  • OVHOVH
  • Digital OceanDigital Ocean
  • HetznerHetzner
  • Kubernetes Consultancy Services
  • K8s & Cloud native Solutions
  • 24/7 Infrastructure Monitoring
  • DevOps as a Service
  • Cloud CI/CD Solutions
  • White Labeled MSP Support
  • Our story
  • Life@SupportSages
  • Insights
  • Careers
  • Events
  • Contact Us

Connect with us!


LinkedInFacebookXInstagramYouTube

aws partneraws advanced partner
SupportSages

Copyright © 2008 – 2026 SupportSages Pvt Ltd. All Rights Reserved.
Privacy PolicyLegal TermsData ProtectionCookie Policy
OpenStack on Ubuntu – Part 3 – Image or Glance Service

OpenStack on Ubuntu – Part 3 – Image or Glance Service

Scott S

  • 6 min read
OpenStack on Ubuntu – Part 3 – Image or Glance Service

Generating audio, please wait...

Now that Keystone has been installed and configured using the steps given in previous post .  Here we are discussing about the implementation of OpenStack Image or Glance Service.

What is Glance?

The Glance project provides a service where users can upload and discover data assets that are meant to be used with other services. This currently includes images and metadata definitions. Glance image services include discovering, registering, and retrieving virtual machine images. Glance has a RESTful API that allows querying of VM image metadata as well as retrieval of the actual image.

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. VM images made available through Glance can be stored in a variety of locations from simple filesystems to object-storage systems like the OpenStack Swift project.

Glance, as with all OpenStack projects, is written with the following design guidelines in mind:

Component based architecture: Quickly add new behaviors
Highly available: Scale to very serious workloads
Fault tolerant: Isolated processes avoid cascading failures
Recoverable: Failures should be easy to diagnose, debug, and rectify
Open standards: Be a reference implementation for a community-driven api

1) Install the Image service/Glance

Install the Image Service on the controller node using the below command

root@controller# apt-get install glance python-glanceclient

The image service uses MySQL as the database to store information. So you need to specify the location of the database in the glance configuration file.

Add/modify the entry shown below in both /etc/glance/glance-api.conf and /etc/glance/glance-registry.conf files under the [database] section.

[database]
connection = mysql://glance:GLANCE_DBPASS@controller/glance

Remember to change the GLANCE_DBPASS with the desired password for the glance database user.

By default, the Ubuntu packages create a SQLite database.

Delete the glance.sqlite file created in the /var/lib/glance/ directory so that it does not get used by mistake

root@controller# rm /var/lib/glance/glance.sqlite

Login to MySQL database as root in the controller node and create the glance database user.

root@controller# mysql -u root -p
mysql> CREATE DATABASE glance;
mysql> GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'localhost' \ IDENTIFIED BY 'GLANCE_DBPASS';
mysql> GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%' \ IDENTIFIED BY 'GLANCE_DBPASS';
mysql> exit

Remember to change the GLANCE_DBPASS to match the one set in glance configuration file.

Create the database tables for the image service.

root@controller# su -s /bin/sh -c "glance-manage db_sync" glance

Create a glance user that the image service can use to authenticate with the identity or keystone service

root@controller# keystone user-create --name=glance --pass=GLANCE_PASS \ [email protected]

You can chose your own GLANCE_PASS and the email option.

Give the glance user admin role and assign it to service tenant.

root@controller# keystone user-role-add --user=glance --tenant=service --role=admin

Configure the image service to use Keystone service for authentication.

Add or edit the following entries in both /etc/glance/glance-api.conf and /etc/glance/glance-registry.conf under the [keystone_authtoken] section as shown below.

[keystone_authtoken]
auth_uri = http://controller:5000
auth_host = controller
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = glance
admin_password = GLANCE_PASS

Edit the GLANCE_PASS to match the one you set for the glance user created using keystone –user-create command.  Also modify the following entry under the [paste_deploy] section as shown below

[paste_deploy]
flavor = keystone

Register the image service with the keystone service and create the endpoint.

root@controller# keystone service-create --name=glance --type=image \
--description="OpenStack Image Service"
root@controller# keystone endpoint-create \
--service-id=$(keystone service-list | awk '/ image / {print $2}') \
--publicurl=http://controller:9292 \
--internalurl=http://controller:9292 \
--adminurl=http://controller:9292

Restart glance service for the changes to take effect.

root@controller# service glance-registry restart
root@controller# service glance-api restart

2) Verify the Image service Installation

We need to first download any virtual machine image that is compatible with OpenStack for testing the image service.Download the image to a directory using wget. I’m creating a new directory /tm/images to hold the VM image

 root@controller# mkdir /tmp/images

root@controller# cd /tmp/images/

root@controller# wget http://download.cirros-cloud.net/0.3.2/cirros-0.3.2-x86_64-disk.img 

Upload the image to the image service using the following command.

 root@controller# glance image-create --name=IMAGELABEL --disk-format=FILEFORMAT --container-format=CONTAINERFORMAT --is-public=ACCESSVALUE < IMAGEFILE 

IMAGELABEL – The name with which a user refer to an image.

FILEFORMAT – Specifies the format of the image file. Valid formats include qcow2, raw, vhd, vmdk, vdi, iso, aki, ari, and ami. You can use the file command with the image name as the argument to know the file format.

CONTAINERFORMAT – Specifies the container format. Valid formats include: bare, ovf, aki, ari and ami. Bare is the common container type that almost all images support.

ACCESSVALUE – true (All users can view and use the image)  and false (Only administrator can use and view the image)

IMAGEFILE – The name of the downloaded image (cirros-0.3.2-x86_64-disk.img)

Example:

root@controller# source admin-openrc.sh
root@controller# glance image-create --name "Cirros" --disk-format qcow2 --container-format bare --is-public True --progress < cirros-0.3.2-x86_64-disk.img

Screenshot from 2016-01-06 14:13:49

Confirm that the image was uploaded correctly using the below command.

 root@controller# glance image-list 

If the above command shows the image attributes as shown in the screenshot below, the image service was correctly installed and configured.

Screenshot from 2016-01-06 14:14:30

Remove the locally downloaded image from /tmp/images, since it is stored and available through the Image Service

 root@controller# rm -r /tmp/images 

Now we can proceed with the installation and configuration of Compute Service [Nova]

Recommended Readings

OpenStack Cloud Computing Fundamentals

OpenStack On Ubuntu – Part 1- Prerequisite Setup

OpenStack on Ubuntu – Part 2 – Identity or Keystone Service

OpenStack on Ubuntu – Part 4 – Compute or Nova Service

OpenStack on Ubuntu – Part 5 – Dashboard or Horizon Service

OpenStack on Ubuntu – Part 6 – Block Storage or Cinder Service

OpenStack integration With CEPH Block Device (RBD)

Get 24/7 expert server management

  • Howtos
  • Linux

All you want to know about Asterisk – Asterisk PBX – Part 3

All you want to know about Asterisk – Asterisk PBX – Part 3
  • Linux
logo

All you want to know about Asterisk – VoIP system architecture – Part 2

All you want to know about Asterisk – VoIP system architecture – Part 2
  • Howtos
  • Linux
logo

All you want to know about Asterisk – VoIP Fundamentals – Part 1

All you want to know about Asterisk – VoIP Fundamentals – Part 1
  • Howtos
  • Linux
logo

Asterisk Setup – Frequently Asked Questions and Answers

Asterisk Setup – Frequently Asked Questions and Answers
  • Linux
logo

Posts by Scott S

Scott follows his heart and enjoys design and implementation of advanced, sophisticated enterprise solutions. His never ending passion towards technological advancements, unyielding affinity to perfection and excitement in exploration of new areas, helps him to be on the top of everything he is involved with. This amateur bike stunting expert probably loves cars and bikes much more than his family. He currently spearheads the Enterprise Solutions and Infrastructure Consultancy wing of SupportSages.