Create the MYSQL Database and grant privileges to the glance user. This only needs to be done once
mysql -h 23.253.238.179 \
-u root \
-p \
-e "CREATE DATABASE glance;"
mysql -h 23.253.238.179 \
-u root \
-p \
-e "GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%' IDENTIFIED BY 'secrete';"
Drop the Glance-API config, Note that for the backend storage I've chosen to use Cloud Files. I made this decision because the glance image sync app that we have does not work in Icehouse to do the changes in messaging.
cat > /etc/glance/glance-api.conf<<EOF
[DEFAULT]
debug = False
verbose = True
log_file = /var/log/glance/glance-api.log
use_syslog = False
sql_connection = mysql://glance:[email protected]/glance?charset=utf8
default_store = swift
bind_host = 0.0.0.0
bind_port = 9292
backlog = 4096
workers = 1
registry_host = 23.253.238.179
registry_port = 9191
registry_client_protocol = http
##### RPC MESSAGING OPTIONS #####
notification_driver = messaging
rpc_backend = glance.openstack.common.rpc.impl_kombu
rabbit_hosts=192.168.16.1:5672,192.168.16.2:5672,192.168.16.3:5672
rabbit_port = 5672
rabbit_use_ssl = false
rabbit_userid = guest
rabbit_password = guest
rabbit_virtual_host = /
rabbit_notification_exchange = glance
rabbit_notification_topic = notifications
rabbit_durable_queues = False
##### STORE OPTIONS #####
swift_store_auth_version = 2
swift_store_auth_address = https://identity.api.rackspacecloud.com/v2.0
swift_store_user = MossoCloudFS_0f496eab-41a4-49bd-9e53-1953520898fc:cloud10
swift_store_key = ${PASSWORD}
swift_store_container = glance_poc
swift_store_create_container_on_put = True
swift_store_large_object_size = 5120
swift_store_large_object_chunk_size = 200
swift_store_retry_get_count = 5
filesystem_store_datadir = /var/lib/glance/images/
delayed_delete = False
scrub_time = 43200
scrubber_datadir = /var/lib/glance/scrubber/
image_cache_dir = /var/lib/glance/cache/
[keystone_authtoken]
signing_dir = /var/lib/glance/cache/api
auth_uri = http://23.253.238.179:5000/v2.0
# cafile =
auth_host = 23.253.238.179
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = glance
admin_password = secrete
[paste_deploy]
flavor = keystone+cachemanagement
EOF
Registry configuration
cat > /etc/glance/glance-registry.conf<<EOF
[DEFAULT]
debug = False
verbose = True
log_file = /var/log/glance/glance-registry.log
use_syslog = False
sql_connection = mysql://glance:[email protected]/glance?charset=utf8
bind_host = 0.0.0.0
bind_port = 9191
backlog = 4096
api_limit_max = 1000
limit_param_default = 25
[keystone_authtoken]
signing_dir = /var/lib/glance/cache/registry/
auth_uri = http://23.253.238.179:5000/v2.0
# cafile =
auth_host = 23.253.238.179
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = glance
admin_password = secrete
[paste_deploy]
flavor = keystone
EOF
glance cache config
cat > /etc/glance/glance-cache.conf<<EOF
[DEFAULT]
admin_password = secrete
admin_user = glance
admin_tenant_name = service
use_syslog = False
debug = True
image_cache_dir = /var/lib/glance/cache/
image_cache_stall_time = 86400
image_cache_max_size = 10737418240
registry_host = 23.253.238.179
registry_port = 9191
auth_url = http://23.253.238.179:35357/v2.0
filesystem_store_datadir = /var/lib/glance/images/
EOF
Setup Glance ImageSync from Rackspace, DO NOT USE THIS YET, ITS BROKEN IN ICEHOUSE!
cat > /etc/glance/glance-image-sync.conf<<EOF
[DEFAULT]
api_nodes = 192.168.18.201,192.168.18.216,192.168.18.231
rsync_user = glance
lock_file = /var/run/glance-image-sync
EOF
Setup Keystone. This only needs to be done once
export OS_USERNAME=admin
export OS_PASSWORD=secrete
export OS_AUTH_URL=http://23.253.238.179:5000/v2.0
export OS_TENANT_NAME=admin
unset OS_SERVICE_TOKEN
unset OS_SERVICE_ENDPOINT
keystone user-create --name=glance --pass=secrete [email protected]
keystone user-role-add --user=glance --tenant=service --role=admin
SID=$(keystone service-create --name=glance --type=image --description="Glance Image Service" | awk '/id/ {print $4}')
keystone endpoint-create --service-id=$SID \
--publicurl=http://23.253.238.179:9292 \
--internalurl=http://23.253.238.179:9292 \
--adminurl=http://23.253.238.179:9292
Start the Services
service glance-api restart
service glance-registry restart