Centos7 install Openstack - (第三节)添加镜像服务(Glance)
Centos7 install Openstack - (第三節)添加鏡像服務(Glance)
?
我的blog地址:http://www.cnblogs.com/caoguo
該文根據openstack官方文檔配置
官方文檔地址:?http://docs.openstack.org/juno/install-guide/install/yum/content/#
?
?
0x01. 基本安裝配置(控制節點)
一) To configure prerequisites?
1. To create the database, complete these steps:(在數據創建該服務需要使用的數據庫帳戶)
?
2. 加載admin環境變量
[root@controller ~]# source admin-openrc.sh
3. To create the service credentials, complete these steps:
a. Create the glance user: ?#在認證服務中創建一個glance的帳戶
?
?
b. Add the admin role to the glance user: ? #將用戶添加至admin用戶組 service租戶中
?
c. Create the glance service entiry:
?
4. Create the Image Service API endpoints: ?#創建鏡像服務api
二) To install and configure the Image Service components
1. Install the packages: ?# 安裝鏡像服務軟件包
?
2. Edit the /etc/glance/glance-api.conf file
[root@controller ~]# cp /etc/glance/glance-api.conf /etc/glance/glance-api.conf.old [root@controller ~]# vi /etc/glance/glance-api.conf # 在配置文件節點下新增配置 [database] connection = mysql://glance:GLANCE_DBPASS@controller/glance [keystone_authtoken] auth_uri = http://controller:5000/v2.0 identity_uri = http://controller:35357 admin_tenant_name = service admin_user = glance admin_password = GLANCE_PASS[paste_deploy] flavor = keystone[glance_store] default_store = file filesystem_store_datadir = /var/lib/glance/images/[DEFAULT] notification_driver = noop?
3. Edit the /etc/glance/glance-registry.conf file
?
4. Populate the Image Service database: # 鏡像服務數據同步
三)To finalize installation(收尾工作)
?
0x02. 確認以上操作
1. Create and change into a temporary local directory: # 創建一個臨時目錄
?
2. Download the image to the temporary local directory: # 下載一個測試鏡像
[root@controller ~]# yum install -y wget [root@controller ~]# wget -P /tmp/images http://download.cirros-cloud.net/0.3.3/cirros-0.3.3-x86_64-disk.img
3. Source the admin credentials to gain access to admin-only CLI commands: # 導入admin環境變量
?
4. Upload the image to the Image Service: # 上傳鏡像文件
[root@controller ~]# glance image-create --name "cirros-0.3.3-x86_64" --file /tmp/images/cirros-0.3.3-x86_64-disk.img \ --disk-format qcow2 --container-format bare --is-public True --progress [=============================>] 100% +------------------+--------------------------------------+ | Property | Value | +------------------+--------------------------------------+ | checksum | 133eae9fb1c98f45894a4e60d8736619 | | container_format | bare | | created_at | 2015-11-01T10:16:39 | | deleted | False | | deleted_at | None | | disk_format | qcow2 | | id | 833b50a1-167e-4968-8d8e-27799ad4c52a | | is_public | True | | min_disk | 0 | | min_ram | 0 | | name | cirros-0.3.3-x86_64 | | owner | f42937a2fd484d638ce58e67fef59b67 | | protected | False | | size | 13200896 | | status | active | | updated_at | 2015-11-01T10:16:40 | | virtual_size | None | +------------------+--------------------------------------+?
?
?
5. Confirm upload for image and validate attributes: # 查看當前已經上傳成功的鏡像
[root@controller ~]# glance image-list +--------------------------------------+---------------------+-------------+------------------+----------+--------+ | ID | Name | Disk Format | Container Format | Size | Status | +--------------------------------------+---------------------+-------------+------------------+----------+--------+ | 74da30a6-8e15-4b11-807c-2eba444e6a54 | cirros-0.3.3-x86_64 | qcow2 | bare | 13200896 | active | +--------------------------------------+---------------------+-------------+------------------+----------+--------+6. Remove the temporary local directory:
[root@controller ~]# rm -r /tmp/images rm: descend into directory ‘/tmp/images’? y rm: remove regular file ‘/tmp/images/cirros-0.3.3-x86_64-disk.img’? y rm: remove directory ‘/tmp/images’? y?
?
結束!!!
更多精彩請訪問:http://www.cnblogs.com/caoguo
轉載于:https://www.cnblogs.com/caoguo/p/4937323.html
總結
以上是生活随笔為你收集整理的Centos7 install Openstack - (第三节)添加镜像服务(Glance)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: php课程 8-28 php如何绘制生成
- 下一篇: 神经网络优化(二) - 滑动平均