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 and Identity service credentials including 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:mysql>CREATE DATABASE glance;Grant proper access to the glance
database: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';Replace GLANCE_DBPASS with a suitable
password.Exit the database access client:mysql>exitSource the admin credentials to gain access to
admin-only CLI commands:$source admin-openrc.shTo create the Identity service credentials, complete these steps:Create the glance user:$keystone user-create --name=glance --pass=GLANCE_PASS --email=EMAIL_ADDRESSReplace GLANCE_PASS with a suitable
password and EMAIL_ADDRESS with
a suitable e-mail address.Link the glance user to the
service tenant and admin
role:$keystone user-role-add --user=glance --tenant=service --role=adminCreate the glance service:$keystone service-create --name=glance --type=image \
--description="OpenStack Image Service"Create the Identity service endpoints:$keystone endpoint-create \
--service-id=$(keystone service-list | awk '/ image / {print $2}') \
--publicurl=http://controller:9292 \
--internalurl=http://controller:9292 \
--adminurl=http://controller:9292To 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 [DEFAULT] section, configure
RabbitMQ message broker access:[DEFAULT]
...
rpc_backend = rabbit
rabbit_host = controller
rabbit_password = RABBIT_PASSReplace RABBIT_PASS with the password
you chose for the guest account in
RabbitMQ.In the [keystone_authtoken] and
[paste_deploy] sections, configure Identity
service access:[keystone_authtoken]
...
auth_uri = http://controller:5000/v2.0
auth_host = controller
auth_port = 35357
auth_protocol = http
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.Edit 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
auth_host = controller
auth_port = 35357
auth_protocol = http
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.Populate 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:#service openstack-glance-api start#service openstack-glance-registry start#chkconfig openstack-glance-api on#chkconfig openstack-glance-registry onBy default, the Ubuntu packages create an SQLite database.Because this configuration uses a SQL database server, you can
remove the SQLite database file:#rm /var/lib/glance/glance.sqlite