Table of Contents

py-glance

OpenStack Image Server

Set up Glance on FreeBSD

Prerequisites

Prepare the system

The following commands must be run as the OpenStack admin user. (It is assumed that the environment (OS_AUTH_URL, OS_PASSWORD, etc.) is already set thus the subsequent commands are listed only with the required parameters for the sake of brevity.)

Create the user, role and service

$ openstack user create --domain default --password-prompt glance
$ openstack role add --project service --user glance admin
$ openstack service create --name glance --description "OpenStack Image" image

Create the endpoints

$ openstack endpoint create --region RegionOne image public http://glancehost:9292
$ openstack endpoint create --region RegionOne image internal http://glancehost:9292
$ openstack endpoint create --region RegionOne image admin http://glancehost:9292

Configure the Glance service

The following files must be configured:

glance-api.conf

[database]
# ...
# Please make sure that you use an absolute path otherwise Glance won't work properly.
connection = sqlite:////var/lib/glance/glance.db

[keystone_authtoken]
# ...
auth_uri = http://keystonehost:5000
auth_url = http://keystonehost:5000
auth_type = password
project_domain_name = Default
user_domain_name = Default
project_name = service
username = glance
password = GLANCE_PASS

[paste_deploy]
# ...
flavor = keystone

[glance_store]
# ...
stores = file,http
default_store = file
# Ensure that this location has enough space!
filesystem_store_datadir = /var/lib/glance/images/

glance-registry.conf

[database]
# ...
# Please make sure that you use an absolute path otherwise Glance won't work properly.
connection = sqlite:////var/lib/glance/glance.db

[keystone_authtoken]
# ...
auth_uri = http://keystonehost:5000
auth_url = http://keystonehost:5000
auth_type = password
project_domain_name = Default
user_domain_name = Default
project_name = service
username = glance
password = GLANCE_PASS

[paste_deploy]
# ...
flavor = keystone

glance-scrubber.conf

[DEFAULT]
# ...
daemon = yes

[glance_store]
# ...
stores = file,http
default_store = file
# Ensure that this location has enough space!
filesystem_store_datadir = /var/lib/glance/images/

Populate the Image service database

# su -m glance -c "glance-manage db_sync"

Enable the services

Enable and start the Glance services:

Verify operation

$ fetch https://download.freebsd.org/ftp/releases/VM-IMAGES/11.2-RELEASE/amd64/Latest/FreeBSD-11.2-RELEASE-amd64.qcow2.xz
$ unxz FreeBSD-11.2-RELEASE-amd64.qcow2.xz
$ openstack image create "freebsd-11.2-amd64" --file FreeBSD-11.2-RELEASE-amd64.qcow2 --disk-format qcow2 --container-format bare

References

https://docs.openstack.org/glance/queens/install/index.html