1.Install and configure
Prerequisites
Replace GLANCE_DBPASS with a suitable password
mysql -u root -p
CREATE DATABASE glance;
GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'localhost' IDENTIFIED BY 'GLANCE_DBPASS';
GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%' IDENTIFIED BY 'GLANCE_DBPASS';
edit admin-openrc
export OS_PROJECT_DOMAIN_NAME=default
export OS_USER_DOMAIN_NAME=default
export OS_PROJECT_NAME=admin
export OS_USERNAME=admin
export OS_PASSWORD=ADMIN_PASS
export OS_AUTH_URL=http://controller:35357/v3
export OS_IDENTITY_API_VERSION=3
export OS_IMAGE_API_VERSION=2
. admin-openrc
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
openstack endpoint create --region RegionOne image public http://controller:9292
openstack endpoint create --region RegionOne image internal http://controller:9292
openstack endpoint create --region RegionOne image admin http://controller:9292
Install and configure components
yum install openstack-glance
/etc/glance/glance-api.conf
#Comment out or remove any other options in the [keystone_authtoken] section.
[database]
...
connection = mysql+pymysql://glance:GLANCE_DBPASS@controller/glance #Replace GLANCE_DBPASS with the password you chose for the Image service database
[keystone_authtoken]
...
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = glance
password = GLANCE_PASS #Replace GLANCE_PASS with the password you chose for the glance user in the Identity service
[paste_deploy]
...
flavor = keystone
[glance_store]
...
stores = file,http
default_store = file
filesystem_store_datadir = /var/lib/glance/images/
/etc/glance/glance-registry.conf
#Comment out or remove any other options in the [keystone_authtoken] section.
[database]
...
connection = mysql+pymysql://glance:GLANCE_DBPASS@controller/glance #Replace GLANCE_DBPASS with the password you chose for the Image service database
[keystone_authtoken]
...
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = glance
password = GLANCE_PASS #Replace GLANCE_PASS with the password you chose for the glance user in the Identity service.
[paste_deploy]
...
flavor = keystone
#Ignore any deprecation messages in this output
su -s /bin/sh -c "glance-manage db_sync" glance
Finalize installation
systemctl enable openstack-glance-api.service openstack-glance-registry.service
systemctl start openstack-glance-api.service openstack-glance-registry.service
2.Verify operation(just for test)
. admin-openrc
yum install -y wget
wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img
openstack image create "cirros" --file cirros-0.3.4-x86_64-disk.img --disk-format qcow2 --container-format bare --public