Skip to content

Latest commit

 

History

History
154 lines (109 loc) · 2.54 KB

03-glance.md

File metadata and controls

154 lines (109 loc) · 2.54 KB

Glance Install

Glance logo

1. CONTROLLER NODE

Database setup

  1. Access database as root:
mysql
  1. Create glance database:
CREATE DATABASE glance;
  1. Grant proper access to glance user and exit:
GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'localhost' identified by 'password123';
GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%' identified by 'password123';
exit

Create openstack objects

  1. Source .adminrc
source .adminrc
  1. Create service and creds
  • Create glance user and add role:
openstack user create --domain default --password password123 glance

openstack role add --project service --user glance admin
  • Create glance service:
openstack service create --name glance \
  --description "OpenStack Image" image
  1. Create service API endpoints:
for i in public internal admin; \
  do openstack endpoint create --region RegionOne \
  image $i http://controller:9292; \
  done

Install and configure components

  1. Install packages:
apt install glance python3-boto3 -y
  1. Backup an sanitize /etc/glance/glance-api.conf:
cp -p /etc/glance/glance-api.conf /etc/glance/glance-api.conf.bak
grep -Ev '^(#|$)' /etc/glance/glance-api.conf.bak|sed '/^\[.*]/i \ '|tail -n +2 > /etc/glance/glance-api.conf
  1. Edit /etc/glance/glance-api.conf sections:
[DEFAULT]
# ...
enabled_backends = file:file

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

[file]
# ...
filesystem_store_datadir = /var/lib/glance/images/

[glance_store]
# ...
default_backend = file

[keystone_authtoken]
# ...
www_authenticate_uri = http://controller:5000
auth_url = http://controller:5000
memcached_servers = controller:11211
auth_type = password
project_domain_name = Default
user_domain_name = Default
project_name = service
username = glance
password = password123

[paste_deploy]
# ...
flavor = keystone
  1. Populate database:
su -s /bin/sh -c "glance-manage db_sync" glance
  1. Restart glance api service:
systemctl enable glance-api
service glance-api restart

Verify ops

  1. Source .adminrc
source .adminrc
  1. Download CirrOS image:
wget http://download.cirros-cloud.net/0.5.2/cirros-0.5.2-x86_64-disk.img
  1. Upload image to glance:
openstack image create \
  --file cirros-0.5.2-x86_64-disk.img \
  --disk-format qcow2 --container-format bare \
  --public cirros
  1. Verify image
openstack image list