Installation of the latest OpenStack Image Service is simply achieved by using the packages provided from the Ubuntu Cloud Archive repositories, which have been packaged for our Ubuntu 14.04 LTS GNU/Linux installation.
To begin with, ensure you're logged in to our OpenStack Controller host where OpenStack Image Service will be installed.
To log in to our OpenStack Controller host that was created using Vagrant, issue the following command:
vagrant ssh controller
Ensure that our Ubuntu 14.04 LTS release is using the Ubuntu Cloud Archive that has the packages required for the Juno release. For more information, visit http://bit.ly/OpenStackCookbookCloudArchive.
All of the steps can be found at http://www.openstackcookbook.com/.
We will configure Glance to use MariaDB as the database backend, so this needs to be installed prior to installing Glance.
If MariaDB is not installed, visit http://bit.ly/OpenStackCookbookInstallMariaDB for instructions on how to do this.
We will also need to have RabbitMQ installed as our message queue service, so this needs to also be installed prior to installing Glance.
If RabbitMQ is not installed, visit http://bit.ly/OpenStackCookbookInstallRabbitMQ for instructions on how to do this.
The instructions in this section assume the controller
node has two IP addresses. It will have a front-facing IP address 192.168.100.200 and a backside IP address 172.16.0.200 (which is also the address of the MariaDB server). It has two addresses because the internal data will communicate over the backside IP address (for example, database traffic) and any Glance traffic will traverse the front.
Carry out the following steps to install OpenStack Image Service:
sudo apt-get update sudo apt-get install ntp glance python-keyring
glance
database in MariaDB. We do this as follows:MYSQL_ROOT_PASS=openstack mysql -uroot -p$MYSQL_ROOT_PASS -e "CREATE DATABASE glance;"
We have a user called root in MariaDB with the password openstack, which is able to create databases.
glance
user in the database as follows:MYSQL_GLANCE_PASS=openstack mysql -uroot -p$MYSQL_ROOT_PASS -e "GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'localhost' IDENTIFIED BY '$MYSQL_KEYSTONE_PASS';" mysql -uroot -p$MYSQL_ROOT_PASS -e "GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%' IDENTIFIED BY '$MYSQL_GLANCE_PASS';"
/etc/glance/glance-registry.conf
and /etc/glance/glance-api.conf
files and changing the sql_connection
line to match the database credentials. We do this by ensuring the following lines are in the files:[database] backend = sqlalchemy connection = mysql://glance:[email protected]/glance
/etc/glance/glance-registry.conf
:rabbit_host = localhost 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
glance-registry
service:sudo stop glance-registry sudo start glance-registry
glance-api
service:sudo stop glance-api sudo start glance-api
glance
database is version controlled under Ubuntu 14.04 to allow the upgrade and downgrade of the service. We first set the version control to be 0
by issuing the following command:sudo glance-manage db_version_control 0
sudo glance-manage db_sync
Congratulations! We now have OpenStack Image service installed and ready for use in our OpenStack environment.
OpenStack Image Service is split into two running services: glance-api
and glance-registry
. It is the glance-registry
service that connects to the database backend. The first step is to create our glance
database and the glance
user, so it can perform operations on the glance
database that we have created.
Once this is done, we modify the /etc/glance/glance-registry.conf
and /etc/glance/glance-api.conf
files so that glance
knows where to find and connect to our MySQL database. This is provided by the standard SQLAlchemy
connection string that has the following syntax:
sql_connection = mysql://USER:PASSWORD@HOST/DBNAME