Openstack-glance鏡像服務

640?wx_fmt=jpeg&tp=webp&wxfrom=5&wx_lazy


Openstack-glance鏡像服務mysql




教程大綱web

      

1. glance的服務組件介紹
2. glance的安裝部署
sql

3. 上傳鏡像測試數據庫





1.建立glance的數據庫api


mysql -u root -p -e "create database glance;"dom

mysql -u root -p -e "grant all privileges on glance.* to 'glance'@'localhost' identified by 'glance';"ide

mysql -u root -p -e "grant all privileges on glance.* to 'glance'@'%' identified by 'glance';"測試



2.安裝glance的組件網站


yum install openstack-glanceurl




3.修改 glance-api的配置


verbose = true

connection = mysql://glance:glance@192.168.100.40/glance

stores = file,http

default_store = file

filesystem_store_datadir = /var/lib/glance/p_w_picpaths

auth_uri = http://192.168.100.40:5000

auth_url = http://192.168.100.40:35357

auth_type = password

project_domain_name = default

user_domain_name = default

project_name = service

username = glance

password = glance

flavor = keystone




4.修改 glance-registry.conf


connection = mysql://glance:glance@192.168.100.40/glance

auth_uri = http://192.168.100.40:5000

auth_url = http://192.168.100.40:35357

auth_type = password

project_domain_name = default

user_domain_name = default

project_name = service

username = glance

password = glance

flavor = keystone




5.同步glance數據庫


su -s /bin/sh -c "glance-manage db_sync" glance




6.啓動glance服務 


 

systemctl enable openstack-glance-api.service \

   openstack-glance-registry.service

   systemctl start openstack-glance-api.service \

   openstack-glance-registry.service




7.建立glance用戶


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

 將glance 加入服務中

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




8.註冊glance 的服務(若是想用glance 必須在keystone上作註冊)   


 

openstack service create --name glance \

  --description "OpenStack Image" p_w_picpath



9.建立glance服務



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




10.建立glance的三個端點


openstack endpoint create --region RegionOne p_w_picpath public http://192.168.100.40:9292


    openstack endpoint create --region RegionOne p_w_picpath internal http://192.168.100.40:9292

     

    openstack endpoint create --region RegionOne p_w_picpath admin http://192.168.100.40:9292




11.上傳鏡像測試


(若是沒有鏡像就能夠 wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img)



建立系統鏡像的glance命令

      openstack p_w_picpath create "cirros" \

     --file cirros-0.3.4-x86_64-disk.img \

     --disk-format qcow2 --container-format bare \

     --public



查看鏡像的存放目錄

    ls /var/lib/glance/p_w_picpaths/



13.驗證glance 的節點


glance  p_w_picpath-list


640?wx_fmt=jpeg&tp=webp&wxfrom=5&wx_lazy

請觀看視屏




視屏會在騰訊課堂和優酷、56視屏網站中上傳。請你們搜索中祥課堂便可觀看


640?wx_fmt=png&tp=webp&wxfrom=5&wx_lazy=

0?wx_fmt=gif&tp=webp&wxfrom=5&wx_lazy=1

相關文章
相關標籤/搜索