Install & Configure Glance - Openstack Installation Part 3

Install Openstack glance Service, install glance service, openstack glance client install, glance openstack add image, openstack glance step by step tutorial

Install & Configure Glance - Openstack Installation Part 3

In the previous post, we have covered the topic, how to install and configure the Keystone Identity service which was also a stage involved in the Openstack Deployment.

Stages involved in the Openstack deployments are,
1. Enable Repositories on node1 and node2
2. Install Openstack Liberty Packages on node1 and node2.
3. Install and Configure MariaDB(MySQL) Database on node1 and node2.
4. Install and Configure RabbitMQ Message service on node1.
5. Install and Configure keystone for Identity service on node1.
6. Install Glance for Image service on node1.
7. Install Nova Computing on node1 and node2.
8. Install Neutron Networking on node1 and node2.
    8a. Install Openstack Neutron Component on Controller Node
    8b. Install Openstack Neutron Component on Compute Node
9. Install Openstack Horizon for dashboard on node1

Continue with previous post install and configure the Keystone Identity service, we will explain you how to install and configure the Glance component for the Image service on node1.

Basically Glance provides Openstack image service which allow us to store and retrieve virtual machine images. be default image service directory is /var/lib/glance/images/. Server should have enough space to hold the images on your disk.

Lab Setup for this Openstack Deployment:
Server Names : node1 and node2.
OS :  CentOS 7.2 - 64 Bit
Enabled Internet connection.

Prerequisites:
1. Make sure each hosts are reachable. I make an entries in hosts file.
2. Verify the internet connection, because we use puclic repos to install these glance component.
3. Take a backup or snapshot at different stages to restore if needed.
4. Stop the firewall to avoid issues during the installations (systemctl stop firewalld ; systemctl disable firewalld)

Refer this link to enable and Install Openstack Liberty Repositories


Install and Configure Glance for Image Service on Node1
Create Glance Database to store its data
[root@node1 ~]# mysql -u root -p
Enter password:
Create tables for Glance database.
MariaDB [(none)]> CREATE DATABASE glance;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'node1' \
  IDENTIFIED BY 'redhat';
MariaDB [(none)]> GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%' \
  IDENTIFIED BY 'redhat';
Replace 'node1' with your controller node name and replace 'redhat' with your Glance password you wish to set.

ALSO WATCH THIS TUTORIAL VIDEO FREE ON OUR YOUTUBE CHANNEL
Install the Glance Component packages.

To enable the repos for this installation, please refer the links,

[root@node1 ~]# yum -y install openstack-glance python-glance python-glanceclient
Configure Glance Image service.

Do the following changes on two files /etc/glance/glance-api.conf and /etc/glance/glance-registry.conf

Change the connection parameter under [database] section.
[database]
connection = mysql://glance:redhat@node1/glance
Replace 'redhat' with your glance password which we have set during the Glance database creation and replace 'node1' with your server name.

Change the following parameters under [keystone_authtoken] and [paste_deploy]
[keystone_authtoken]
auth_uri = http://node1:5000
auth_url = http://node1:35357
auth_plugin = password
project_domain_id = default
user_domain_id = default
project_name = service
username = glance
password = redhat
[paste_deploy]
flavor = keystone
Replace 'redhat' with the password you chose for the glance user in the Identity service and replace 'node1' with your server name.
[ads-post]
Change the following parameters under [DEFAULT] section.
[DEFAULT]
notification_driver = noop
Change the following parameters under [glance_store] section only on /etc/glance/glance-api.conf. This change not required in the file  /etc/glance/glance-registry.conf
[glance_store]
default_store = file
filesystem_store_datadir = /var/lib/glance/images/
Once all changes done, populate the Image service database
[root@node1 ~]# su -s /bin/sh -c "glance-manage db_sync" glance
Ignore if you get handler error as "No handlers could be found for logger "oslo_config.cfg""

Start and Enable the glance service.
[root@node1 ~]# systemctl enable openstack-glance-api \
  openstack-glance-registry
[root@node1 ~]# systemctl start openstack-glance-api \
  openstack-glance-registry
Source the admin-openrc.sh to load the environment to gain access. If you have created before, if not create a client authentication file for the “admin” project to gain the access. Replace *ADMIN_PASS* with your own:
# vim /root/admin-openrc.sh
  export OS_PROJECT_DOMAIN_ID=default
  export OS_USER_DOMAIN_ID=default
  export OS_PROJECT_NAME=admin
  export OS_TENANT_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
Configure the Image service client to use API version 2.0
[root@node1 ~]# echo "export OS_IMAGE_API_VERSION=2" \
  | tee -a admin-openrc.sh demo-openrc.sh
[root@node1 ~]# source admin-openrc.sh
Create the glance user and add roles.

[root@node1 ~]# openstack user create --domain default --password-prompt glance
User Password:
Repeat User Password:
+-----------+----------------------------------+
| Field     | Value                            |
+-----------+----------------------------------+
| domain_id | default                          |
| enabled   | True                             |
| id        | 1c2ca5c95a1741bf9a895454bc9f7054 |
| name      | glance                           |
+-----------+----------------------------------+
[root@node1 ~]#
Add the admin role to the glance user and service project:
[root@node1 ~]# openstack role add --project service --user glance admin
Create the glance service entity:
[root@node1 ~]# openstack service create --name glance \
  --description "OpenStack Image service" image
+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | OpenStack Image service          |
| enabled     | True                             |
| id          | 1d9cbeb55a7e43f1a6bd4f2444c81036 |
| name        | glance                           |
| type        | image                            |
+-------------+----------------------------------+
Create the Image service API endpoints:
Replace 'node1' with your node name.
[root@node1 ~]# openstack endpoint create --region RegionOne \
   image public http://node1:9292
+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | e2bf6a6205504a34954a5f32bff7c426 |
| interface    | public                           |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | 1d9cbeb55a7e43f1a6bd4f2444c81036 |
| service_name | glance                           |
| service_type | image                            |
| url          | http://node1:9292                |
+--------------+----------------------------------+
[root@node1 ~]# openstack endpoint create --region RegionOne \
  image internal http://node1:9292
+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | fc5e7154ef9f4d329468a5edb46f40ea |
| interface    | internal                         |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | 1d9cbeb55a7e43f1a6bd4f2444c81036 |
| service_name | glance                           |
| service_type | image                            |
| url          | http://node1:9292                |
+--------------+----------------------------------+
[root@node1 ~]# openstack endpoint create --region RegionOne \
  image admin http://node1:9292
+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | bce3447ff4ec48b794690d721f248caf |
| interface    | admin                            |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | 1d9cbeb55a7e43f1a6bd4f2444c81036 |
| service_name | glance                           |
| service_type | image                            |
| url          | http://node1:9292                |
+--------------+----------------------------------+
Testing the Configurations:

To test the configuration, download ISO image and Upload the image to the Image service using the QCOW2 disk format, bare container format, and public visibility so all projects can access it. here we use only the Cirror ISO image for testing purpose which is smaller in size.
[root@node1 ~]# wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img
[root@node1 ~]# glance image-create --name "cirros" \
  --file cirros-0.3.4-x86_64-disk.img \
  --disk-format qcow2 --container-format bare \
  --visibility public --progress
List out the uploaded images.
[root@node1 ~]# glance image-list
+--------------------------------------+--------+
| ID                                   | Name   |
+--------------------------------------+--------+
| cbc9dcb0-9574-4f30-bcba-03e48ebd3ef3 | cirros |
+--------------------------------------+--------+
Installation and Configuration of Glance Openstack component for Image service on node1 is completed. 

So far, We are done with the below topics in the Openstack Deployment. Refer the links,
1. Enable Repositories on node1 and node2
2. Install Openstack Liberty Packages on node1 and node2.
3. Install and Configure MariaDB(MySQL) Database on node1 and node2.
4. Install and Configure RabbitMQ Message service on node1.
5. Install and Configure keystone for Identity service on node1.
6. Install Glance for Image service on node1.
7. Install Nova Computing on node1 and node2.
8. Install Neutron Networking on node1 and node2.
    8a. Install Openstack Neutron Component on Controller Node
    8b. Install Openstack Neutron Component on Compute Node
9. Install Openstack Horizon for dashboard on node1

Also download 100% free eBooks related to OpenStack Cloud.
1. A Brief Look at OpenStack
2. OpenStack Cloud Computing Cookbook
3. Concepts of Cloud Computing in simple terms

More topics will be added soon. stay connected with us on social networking sites and Subscribe our YouTube channel for more updates.
Youtube Channel : https://www.youtube.com/learnitguide
Facebook : http://www.facebook.com/learnitguide
Twitter : http://www.twitter.com/learnitguide
Pinterest : http://www.pinterest.com/learnitguide
RSS : http://feeds.feedburner.com/learnitguide

Incoming Searches : Install Openstack glance Service, install glance service on centos7, openstack glance client install, glance openstack add image, openstack glance step by step tutorial

February 23, 2016

Post a Comment

[disqus][facebook][blogger]

Contact Form

Name

Email *

Message *

Powered by Blogger.
Javascript DisablePlease Enable Javascript To See All Widget