原文链接 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

最新文章

  1. 20145222《信息安全系统设计基础》Linux常用命令汇总
  2. kettle系列-1.kettle源码获取与运行
  3. ORACLE TO_CHAR函数格式化数字的出现空格的原因
  4. 数组、ArraryList和List三者的区别
  5. n全排列输出和 n个数的组合(数字范围a~b)
  6. discuzX3后台管理插件开发示例一 用户表查询
  7. 房间安排-nyoj168
  8. 读取DBF文件的部分代码
  9. 成长记录 if语句输出 由大到小的数字
  10. 读书笔记-UIView与控件
  11. 为Elasticsearch添加中文分词
  12. supesite 相关 修改
  13. 学习CAS实现SSO单点登录
  14. SQL学习之高级数据过滤
  15. 关于linux内核驱动开发中Makefile编译的问题
  16. WebApp与Native App有何区别呢?
  17. Lua5.1 升级 Lua5.3 升级 小结
  18. SpringCloud之实现客户端的负载均衡Ribbon(二)
  19. sql索引唯一
  20. 软工网络15团队作业8——Beta阶段敏捷冲刺(Day6)

热门文章

  1. 《C#高级编程》笔记系列第三弹
  2. 九度oj 题目1537:买卖股票
  3. JAVA如何解压缩ZIP文档
  4. [luoguP2325] [SCOI2005]王室联邦(树分块乱搞)
  5. leetcode 347 priority,map的使用
  6. cf711E ZS and The Birthday Paradox
  7. 通过new ClasspathApplicationContext(&quot;applicationContext.xml&quot;)找不到文件时
  8. PHP文件锁定机制
  9. POJ2560 Freckles
  10. 「CodePlus 2018 4 月赛」最短路