• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

使用Swift作为Glance后端存储

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

原文链接 http://thornelabs.net/2014/08/03/use-openstack-swift-as-a-backend-store-for-glance.html


By default, OpenStack Glance saves images and OpenStack Instance snapshots on the local filesystem 


in /var/lib/glance/images/.


However, if you have a Swift Cluster, you can just as easily use it to save images and snapshots instead of the 


local filesystem where Glance is running.


Begin by logging into the node running the Glance services (probably your controller node also running Keystone) 


as root and source your OpenStack credentials (this is typically a file named openrc).


source ~/openrc


Verify the user glance is part of tenant service with role admin.


keystone user-role-list --user glance --tenant service


One of the roles returned should be admin.


Open /etc/glance/glance-api.conf and comment out the following two lines:


##### DEFAULT OPTIONS #####
#default_store = file
#filesystem_store_datadir = /var/lib/glance/images/


With /etc/glance/glance-api.conf still open, append the following lines to the DEFAULT OPTIONS section (be 


sure to set the values inside < > to match your environment):


default_store = swift
swift_store_auth_address = http://<IP_OF_KEYSTONE>:35357/v2.0/
swift_store_user = service:glance
swift_store_key = <VALUE OF __admin_password__ ATTRIBUTE IN __/etc/glance/glance-api.conf__>
swift_store_create_container_on_put = True


With the configuration changes in place, restart the Glance services.


If you are running CentOS/RHEL:


service openstack-glance-api restart

service openstack-glance-registry restart


If you are running Ubuntu:


service glance-api restart

service glance-registry restart


Now you should be able to upload an image to Glance through the Horizon Dashboard or using the glance 


command and instead of it being saved to /var/lib/glance/images, it will be saved in a Swift Container 


called glance in the service account.


Verify nothing is saved in /var/lib/glance/images by simply running ls /var/lib/glance/images (if you did not 


delete any existing Glance Images, they will still be there).


Once the Horizon Dashboard or the glance image-list reports the image is active, you can verify the images 


are in Swift by running the following command (be sure to set the values inside < > to match your environment):


swift --os-auth-url http://<IP_OF_KEYSTONE>:5000/v2.0 --os-tenant-name service --os-username glance --os-password <PASSWORD USED IN swift_store_key ABOVE> list glance

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
iOSSwift基础知识代码发布时间:2022-07-14
下一篇:
swift5.x访问权限控制发布时间:2022-07-14
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap