日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > centos >内容正文

centos

Centos7 install Openstack - (第三节)添加镜像服务(Glance)

發布時間:2023/12/18 centos 34 豆豆
生活随笔 收集整理的這篇文章主要介紹了 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:(在數據創建該服務需要使用的數據庫帳戶)

[root@controller ~]# mysql -uroot -p MariaDB [(none)]> CREATE DATABASE glance; MariaDB [(none)]> GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'localhost' \ -> IDENTIFIED BY 'GLANCE_DBPASS'; MariaDB [(none)]> GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%' \ -> IDENTIFIED BY 'GLANCE_DBPASS';

?

2. 加載admin環境變量

[root@controller ~]# source admin-openrc.sh



3. To create the service credentials, complete these steps:

  a. Create the glance user: ?#在認證服務中創建一個glance的帳戶

[root@controller ~]# keystone user-create --name glance --pass GLANCE_PASS +----------+----------------------------------+ | Property | Value | +----------+----------------------------------+ | email | | | enabled | True | | id | b5eb644a0049459c9f1b1bb87eaa2f35 | | name | glance | | username | glance | +----------+----------------------------------+

?

?  

  


  b. Add the admin role to the glance user: ? #將用戶添加至admin用戶組 service租戶中

[root@controller ~]# keystone user-role-add --user glance --tenant service --role admin

?


  c. Create the glance service entiry:

[root@controller ~]# keystone service-create --name glance --type image \ --description "OpenStack Image Service" +-------------+----------------------------------+ | Property | Value | +-------------+----------------------------------+ | description | OpenStack Image Service | | enabled | True | | id | 95b4d1e8cee046ada8e131cdef6d01da | | name | glance | | type | image | +-------------+----------------------------------+

?



4. Create the Image Service API endpoints: ?#創建鏡像服務api

[root@controller ~]# keystone endpoint-create \ --service-id $(keystone service-list | awk '/ image / {print $2}') \ --publicurl http://controller:9292 \ --internalurl http://controller:9292 \ --adminurl http://controller:9292 \ --region regionOne

  



二) To install and configure the Image Service components
1. Install the packages: ?# 安裝鏡像服務軟件包

[root@controller ~]# yum install -y openstack-glance python-glanceclient

?

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

[root@controller ~]# cp /etc/glance/glance-registry.conf /etc/glance/glance-registry.conf.old [root@controller ~]# vi /etc/glance/glance-registry.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[DEFAULT] notification_driver = noop verbose = True

?



4. Populate the Image Service database: # 鏡像服務數據同步

[root@controller ~]# su -s /bin/sh -c "glance-manage db_sync" glance


三)To finalize installation(收尾工作)

[root@controller ~]# systemctl enable openstack-glance-api.service openstack-glance-registry.service [root@controller ~]# systemctl start openstack-glance-api.service openstack-glance-registry.service

?

0x02. 確認以上操作
  1. Create and change into a temporary local directory: # 創建一個臨時目錄

[root@controller ~]# mkdir /tmp/images

?

  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環境變量

[root@controller ~]# source admin-openrc.sh

?

  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)的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。