logo

logo
Showing posts with label Glance. Show all posts
Showing posts with label Glance. Show all posts

Monday, 18 August 2014

Manually setup all-in-one OpenStack Icehouse 3 - keystoneGlance (Image Store)


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

Tuesday, 5 August 2014

Glance Overview

Glance is the image management component in OpenStack, it is a simple component in OpenStack and now it is very stable. The purpose of Glance is to store the image template in OpenStack, when we need to create the Virtual Machine (VM) from OpenStack. When you upload the images in Glance, it will upload to a specific location and mark the location, attributes and permissions in database, when we use Nova to create VM, it will check the location and permission then pull down the image from Glance.



Glance Architecture:

Glance has three parts:
 glance-api: accepts REST-API requests, and working with other two components to fulfill image lookup, upload, delete. By default, it is listening on 9292
glance-registry: interact with database to handle the metadata, there are two database tables: image(general image information such as format, image size) and image property (customized image formation)
-  image store: the abstract layer for image storage. Now it supports Amazon S3, Swift, sheepdog, ceph, GlusterFS.

Operations in Glance:

  • glance image-create              Create a new image 
  • glance image-delete              Delete specified image(s). 
  • glance image-download            Download a specific image. 
  • glance image-list                List images you can access. 
  • glance image-show                Describe a specific image. 
  • glance image-update              Update a specific image.