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 as well as setup of the
admin-openrc.sh script as described in
.To configure prerequisitesBefore you install and configure the Image service, you must
create a database, service credentials, and API endpoint.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:$openstack user create --password-prompt glanceUser Password:
Repeat User Password:
+----------+----------------------------------+
| Field | Value |
+----------+----------------------------------+
| email | None |
| enabled | True |
| id | 1dc206e084334db2bee88363745da014 |
| name | glance |
| username | glance |
+----------+----------------------------------+Add the admin role to the
glance user and service
project:$openstack role add --project service --user glance admin+-------+----------------------------------+
| Field | Value |
+-------+----------------------------------+
| id | cd2cb9a39e874ea69e5d4b896eb16128 |
| name | admin |
+-------+----------------------------------+Create the glance service entity:$openstack service create --name glance \
--description "OpenStack Image service" image+-------------+----------------------------------+
| Field | Value |
+-------------+----------------------------------+
| description | OpenStack Image service |
| enabled | True |
| id | 178124d6081c441b80d79972614149c6 |
| name | glance |
| type | image |
+-------------+----------------------------------+Create the Image service API endpoint:$openstack endpoint create \
--publicurl http://controller:9292 \
--internalurl http://controller:9292 \
--adminurl http://controller:9292 \
--region RegionOne \
image+--------------+----------------------------------+
| Field | Value |
+--------------+----------------------------------+
| adminurl | http://controller:9292 |
| id | 805b1dbc90ab47479111102bc6423313 |
| internalurl | http://controller:9292 |
| publicurl | http://controller:9292 |
| region | RegionOne |
| service_id | 178124d6081c441b80d79972614149c6 |
| service_name | glance |
| service_type | image |
+--------------+----------------------------------+To install and configure the Image service componentsDefault configuration files vary by distribution. You might need
to add these sections and options rather than modifying existing
sections and options. Also, an ellipsis (...) in the configuration
snippets indicates potential default configuration options that you
should retain.Install the packages:#apt-get install glance python-glanceclient#yum install openstack-glance python-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
auth_url = http://controller:35357
auth_plugin = password
project_domain_id = default
user_domain_id = default
project_name = service
username = glance
password = GLANCE_PASS
[paste_deploy]
...
flavor = keystoneReplace GLANCE_PASS with the
password you chose for the glance user in the
Identity service.Comment out or remove any other options in the
[keystone_authtoken] section.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
auth_url = http://controller:35357
auth_plugin = password
project_domain_id = default
user_domain_id = default
project_name = service
username = glance
password = GLANCE_PASS
[paste_deploy]
...
flavor = keystoneReplace GLANCE_PASS with the
password you chose for the glance user in the
Identity service.Comment out or remove any other options in the
[keystone_authtoken] section.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.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