Install and configureThis section describes how to install and configure the Image Service,
code-named glance, on the controller node. For simplicity, this
configuration stores images on the local file system.This section assumes proper installation, configuration, and
operation of the Identity service as described in
and
.To configure prerequisitesBefore you install and configure the Image Service, you must
create a database, service credentials, and API endpoints.To create the database, complete these steps:Use the database access client to connect to the database
server as the root user:$mysql -u root -pCreate the glance database:CREATE DATABASE glance;Grant proper access to the glance
database:GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'localhost' \
IDENTIFIED BY 'GLANCE_DBPASS';GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%' \
IDENTIFIED BY 'GLANCE_DBPASS';Replace GLANCE_DBPASS with a suitable
password.Exit the database access client.Source the admin credentials to gain access to
admin-only CLI commands:$source admin-openrc.shTo create the service credentials, complete these steps:Create the glance user:$keystone user-create --name glance --pass GLANCE_PASS+----------+----------------------------------+
| Property | Value |
+----------+----------------------------------+
| email | |
| enabled | True |
| id | f89cca5865dc42b18e2421fa5f5cce66 |
| name | glance |
| username | glance |
+----------+----------------------------------+Replace GLANCE_PASS with a suitable
password.Add the admin role to the
glance user:$keystone user-role-add --user glance --tenant service --role adminThis command provides no output.Create the glance service entity:$keystone service-create --name glance --type image \
--description "OpenStack Image Service"+-------------+----------------------------------+
| Property | Value |
+-------------+----------------------------------+
| description | OpenStack Image Service |
| enabled | True |
| id | 23f409c4e79f4c9e9d23d809c50fbacf |
| name | glance |
| type | image |
+-------------+----------------------------------+Create the Image Service API endpoints:$keystone endpoint-create \
--service-id $(keystone service-list | awk '/ image / {print $2}') \
--publicurl http://controller:9292 \
--internalurl http://controller:9292 \
--adminurl http://controller:9292 \
--region regionOne+-------------+----------------------------------+
| Property | Value |
+-------------+----------------------------------+
| adminurl | http://controller:9292 |
| id | a2ee818c69cb475199a1ca108332eb35 |
| internalurl | http://controller:9292 |
| publicurl | http://controller:9292 |
| region | regionOne |
| service_id | 23f409c4e79f4c9e9d23d809c50fbacf |
+-------------+----------------------------------+To install and configure the Image Service componentsInstall the packages:#apt-get install glance python-glanceclient#yum install openstack-glance python-glanceclient#zypper install openstack-glance python-glanceclientEdit the /etc/glance/glance-api.conf
file and complete the following actions:In the [database] section, configure
database access:[database]
...
connection = mysql://glance:GLANCE_DBPASS@controller/glanceReplace GLANCE_DBPASS with the
password you chose for the Image Service database.In the [keystone_authtoken] and
[paste_deploy] sections, configure Identity
service access:[keystone_authtoken]
...
auth_uri = http://controller:5000/v2.0
identity_uri = http://controller:35357
admin_tenant_name = service
admin_user = glance
admin_password = GLANCE_PASS
[paste_deploy]
...
flavor = keystoneReplace GLANCE_PASS with the
password you chose for the glance user in the
Identity service.Comment out any auth_host,
auth_port, and
auth_protocol options because the
identity_uri option replaces them.In the [glance_store] section, configure
the local file system store and location of image files:[glance_store]
...
default_store = file
filesystem_store_datadir = /var/lib/glance/images/In the [DEFAULT] section, configure
the noop notification driver to disable
notifications because they only pertain to the optional
Telemetry service:[DEFAULT]
...
notification_driver = noopThe Telemetry chapter provides an Image Service configuration
that enables notifications.(Optional) To assist with troubleshooting,
enable verbose logging in the [DEFAULT]
section:[DEFAULT]
...
verbose = TrueEdit the /etc/glance/glance-registry.conf
file and complete the following actions:In the [database] section, configure
database access:[database]
...
connection = mysql://glance:GLANCE_DBPASS@controller/glanceReplace GLANCE_DBPASS with the
password you chose for the Image Service database.In the [keystone_authtoken] and
[paste_deploy] sections, configure Identity
service access:[keystone_authtoken]
...
auth_uri = http://controller:5000/v2.0
identity_uri = http://controller:35357
admin_tenant_name = service
admin_user = glance
admin_password = GLANCE_PASS
[paste_deploy]
...
flavor = keystoneReplace GLANCE_PASS with the
password you chose for the glance user in the
Identity service.Comment out any auth_host,
auth_port, and
auth_protocol options because the
identity_uri option replaces them.In the [DEFAULT] section, configure
the noop notification driver to disable
notifications because they only pertain to the optional
Telemetry service:[DEFAULT]
...
notification_driver = noopThe Telemetry chapter provides an Image Service configuration
that enables notifications.(Optional) To assist with troubleshooting,
enable verbose logging in the [DEFAULT]
section:[DEFAULT]
...
verbose = TruePopulate the Image Service database:#su -s /bin/sh -c "glance-manage db_sync" glanceTo install and configure the Image Service componentsInstall the packages:#apt-get install glance python-glanceclientRespond to prompts for
database management,
Identity service
credentials,
service endpoint
registration, and
message broker
credentials.Select the keystone pipeline to configure the
Image Service to use the Identity service:To finalize installationRestart the Image Service services:#service glance-registry restart#service glance-api restartStart the Image Service services and configure them to start when
the system boots:#systemctl enable openstack-glance-api.service openstack-glance-registry.service#systemctl start openstack-glance-api.service openstack-glance-registry.serviceOn SLES:#service openstack-glance-api start#service openstack-glance-registry start#chkconfig openstack-glance-api on#chkconfig openstack-glance-registry onOn openSUSE:#systemctl enable openstack-glance-api.service openstack-glance-registry.service#systemctl start openstack-glance-api.service openstack-glance-registry.serviceBy default, the Ubuntu packages create an SQLite database.Because this configuration uses a SQL database server, you can
remove the SQLite database file:#rm -f /var/lib/glance/glance.sqlite