Skip to content

Home Lab

Notes from my learning sessions

Menu
Menu

Openstack – Train : Glance – Image Service

Posted on October 9, 2020January 29, 2023 by sandeep

<<<   Keystone                                                                                                                                              Placement >>>

On the controller node :

Create database for Glance (Image) services (from MySQL prompt)

CREATE DATABASE glance;

GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'localhost' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%' IDENTIFIED BY 'password'; FLUSH PRIVILEGES; exit

Create an user account for glance service.

. admin-openrc
openstack user create --domain default --password-prompt glance

Add the admin role to the glance user / homelab project

openstack role add --project homelab --user glance admin

Create the glance service entity

openstack service create --name glance --description "OpenStack Image" image

Create the Image service API endpoints

openstack endpoint create --region RegionOne image public http://controller:9292

openstack endpoint create --region RegionOne image internal http://controller:9292

openstack endpoint create --region RegionOne image admin http://controller:9292

Install package

apt install -y glance

Update the configuration in /etc/glance/glance-api.conf

Change the connection configuration in [database] section to

[database]
connection = mysql+pymysql://glance:password@controller/glance

Add the following configurations in respective sections (observed that all configuration by default were commented – so just adding these)

[glance_store]
stores = file,http
default_store = file
filesystem_store_datadir = /var/lib/glance/images/

[keystone_authtoken]
www_authenticate_uri = http://controller:5000
auth_url = http://controller:5000
memcached_servers = controller:11211
auth_type = password
project_domain_name = Default
user_domain_name = Default
project_name = homelab
username = glance
password = password

[paste_deploy]
flavor = keystone

Populate the service database

su -s /bin/sh -c "glance-manage db_sync" glance

Restart the Image services

service glance-api restart

Verify image service operations – Download and add an image to repository

wget http://download.cirros-cloud.net/0.4.0/cirros-0.4.0-x86_64-disk.img

. admin-openrc

glance image-create --name "cirros" --file cirros-0.4.0-x86_64-disk.img --disk-format qcow2 --container-format bare --visibility public

glance image-list
+--------------------------------------+--------+ | ID | Name | +--------------------------------------+--------+ | 59924307-6b58-4bcf-8f8b-fb9666f5b2c6 | cirros | +--------------------------------------+--------+

<<< Keystone                                               Placement >>>

Recent Posts

  • Ceph + KVM: 4. Orchestrating Ceph RBD backed VMs on KVM Hosts
  • Rabbit MQ Cluster + HAProxy + Keepalived
  • Install and configure MariaDB / Galera cluster
  • Ceph + KVM : 3. Installing KVM, cutsomized monitoring scripts
  • Ceph + KVM : 5. Service checks and CLI commands
  • Ceph + KVM : 2. Installation – Ceph Storage
  • Ceph + KVM : 1. Planning and preparing for Ceph Storage
  • Openstack Xena on Ubuntu 20.04 – Cinder
  • Preparing custom Debian 11 MATE image
  • Setup Ubuntu 20.04 repository mirror server

Archives

  • April 2025
  • March 2025
  • October 2024
  • September 2024
  • April 2022
  • March 2022
  • February 2022
  • December 2021
  • October 2021
  • September 2021
  • October 2020
  • February 2020
  • January 2020
  • December 2019
© 2025 Home Lab | Powered by Minimalist Blog WordPress Theme