Install and configure This 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 prerequisites Before 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 -p Create 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.sh To create the Identity service credentials, complete these steps: Create the glance user: $ keystone user-create --name glance --pass GLANCE_PASS --email EMAIL_ADDRESS +----------+----------------------------------+ | Property | Value | +----------+----------------------------------+ | email | glance@example.com | | enabled | True | | id | f89cca5865dc42b18e2421fa5f5cce66 | | name | glance | | username | glance | +----------+----------------------------------+ Replace 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 admin This command provides no output. Create the glance service: $ 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 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: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 components Install the packages: # apt-get install glance python-glanceclient # yum install openstack-glance python-glanceclient # zypper install openstack-glance python-glanceclient Edit 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/glance Replace 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 = keystone Replace 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 keys because the identity_uri key replaces them. (Optional) To assist with troubleshooting, enable verbose logging in the [DEFAULT] section: [DEFAULT] ... verbose = True 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/glance Replace 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 = keystone Replace 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 keys because the identity_uri key replaces them. In the [DEFAULT] section, we recommend enabling verbose logging to assist with potential troubleshooting: [DEFAULT] ... verbose = True Populate the Image Service database: # su -s /bin/sh -c "glance-manage db_sync" glance To install and configure the Image Service components Install the packages: # apt-get install glance python-glanceclient Respond 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 installation Restart the Image Service services: # service glance-registry restart # service glance-api restart Start 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 on By 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