Friday, April 27, 2018

03-openstack-image-service(glance)

Image service (glance)
users to discover, register, and retrieve virtual machine images.
REST API that enables you to query virtual machine image metadata and retrieve an actual image


By default, this directory is
/var/lib/glance/images/


step 1 create database


CREATE DATABASE glance;


grant all privileges on glance.* to glance@10.0.3.11 identified by 'glance';


step 2 openstack


admin credentials to gain access
source admin-openrc


create glance user


openstack user create --domain default --password-prompt glance


unset all envrionment varialble (admin)
export all enironment variable again (admin)
password glance1

mysql database

add the admin role to the glance


$ openstack role add --project service --user glance admin


glance service entity


openstack service create --name glance --description "OpenStack Image" image


Create the Image service API endpoints:


openstack endpoint create --region RegionOne image public http://controller:9292
openstack endpoint create --region RegionOne image internal http://controller:9292
openstack endpoint create --region RegionOne image admin http://controller:9292



installing application


apt-get install glance


rabbitmq user=openstack/passwd=RABBIT_PASS


username must glance@10.0.3.11


/etc/glance/glance-api.conf


[database]
connection = mysql+pymysql://glance:glance@10.0.3.16:3306/glance


[keystone_authtoken]
# ...
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = glance
password = GLANCE_PASS


[paste_deploy]
# ...
flavor = keystone


configure the local file system store and location of image files:


[glance_store]
# ...
stores = file,http
default_store = file
filesystem_store_datadir = /var/lib/glance/images/


/etc/glance/glance-registry.conf


[database]
# ...
connection = mysql+pymysql://glance:GLANCE_DBPASS@controller/glance


[keystone_authtoken]
# ...
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = glance
password = glance


[paste_deploy]
# ...
flavor = keystone


glance-manage db_sync


service glance-registry restart
service glance-api restart


verify operation


source admin-openrc.sh


openstack image create "cirros" --file cirros-0.3.5-x86_64-disk.img --disk-format qcow2 --container-format bare --public




Confirm upload of the image and validate attributes:





Dashboard



No comments:

Post a Comment