1. package installation
apt-get install -y glance
2. Create database and credentials for Glance
In MySQL command prompt:
CREATE DATABASE glance;
GRANT ALL ON glance.* TO 'glance'@'%'
IDENTIFIED BY 'glance_dbpass';
3. Create glance related keystone entries
keystone user-create --name=glance
--pass=glance_pass --email=glance@example.com
keystone user-role-add --user=glance
--tenant=service --role=admin
keystone service-create --name=glance
--type=image --description="Glance Image Service"
keystone endpoint-create --service=glance
--publicurl=http://192.168.139.111:9292 --internalurl=http://192.168.139.111:9292
--adminurl=http://192.168.139.111:9292
4. Edit /etc/glance/glance-api.conf and edit the following lines
Hash out
# sqlite_db = /var/lib/glance/glance.sqlite
Add
connection = mysql://glance:glance_dbpass@192.168.139.111/glance
[keystone_authtoken]
auth_host = 192.168.139.111
auth_port = 5000
auth_protocol = http
admin_tenant_name = service
admin_user = glance
admin_password = glance_pass
[paste_deploy]
flavor = keystone
Edit /etc/glance/glance-registry.conf and
edit the following lines as below
Hash out
# sqlite_db = /var/lib/glance/glance.sqlite
Add
connection = mysql://glance:glance_dbpass@192.168.139.111/glance
[keystone_authtoken]
auth_host = 192.168.139.111
auth_port = 5000
auth_protocol = http
admin_tenant_name = service
admin_user = glance
admin_password = glance_pass
[paste_deploy]
flavor = keystone
5. Restart Glance services and sync the database
service glance-api restart
service glance-registry restart
glance-manage db_sync
6.Download a pre-bundled image for testing
glance image-create --name Cirros
--is-public true --container-format bare --disk-format qcow2 --location
https://launchpad.net/cirros/trunk/0.3.0 /+download/cirros-0.3.0-x86_64-disk.img
7. testing
glance index
No comments:
Post a Comment