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

使用Swift作为Glance后端存储的更多相关文章

  1. 020 ceph作openstack的后端存储

    一.使用ceph做glance后端 1.1 创建用于存储镜像的池 [root@serverc ~]#  ceph osd pool create images 128 128 pool 'images ...

  2. Swift编程语言学习9—— 存储属性和计算属性

    属性将值跟特定的类.结构或枚举关联.存储属性存储常量或变量作为实例的一部分,计算属性计算(而不是存储)一个值.计算属性能够用于类.结构体和枚举里,存储属性仅仅能用于类和结构体. 存储属性和计算属性通经 ...

  3. Openstack_后端存储平台Ceph

    框架图 介绍 一种为优秀的性能.可靠性和可扩展性而设计的统一的.分布式文件系统 特点 CRUSH算法 Crush算法是ceph的两大创新之一,简单来说,ceph摒弃了传统的集中式存储元数据寻址的方案, ...

  4. 9 云计算系列之Cinder的安装与NFS作为cinder后端存储

    preface 在前面我们知道了如何搭建Openstack的keystone,glance,nova,neutron,horizon这几个服务,然而在这几个服务中唯独缺少存储服务,那么下面我们就学习块 ...

  5. 配置Ceph集群为OpenStack后端存储

    配置Ceph存储为OpenStack的后端存储 1  前期配置 Ceph官网提供的配置Ceph块存储为OpenStack后端存储的文档说明链接地址:http://docs.ceph.com/docs/ ...

  6. Flocker 做为后端存储代理 docker volume-driver 支持

    docker Flocker https://github.com/ClusterHQ/flocker/ 文档: https://docs.clusterhq.com/en/latest/docker ...

  7. jaeger 使用ElasticSearch 作为后端存储

    jaeger 支持es 作为后端存储,这样对于查询.以及系统扩展是比较方便的 使用docker-compose 运行 环境准备 参考项目: https://github.com/rongfenglia ...

  8. Openstack入门篇(十八)之Cinder服务-->使用NFS作为后端存储

    1.安装cinder-volume组件以及nfs [root@linux-node2 ~]# yum install -y openstack-cinder python-keystone [root ...

  9. 以ScaleIO 1.30为后端存储运行微软服务器软件SQL Server 2014, SharePoint 2013, Exchange 2013的解决方案

    EMC新发布了以ScaleIO 1.30为后端存储来运行SQL, SharePoint, Exchange的解决方案白皮书.   下面的页面中有简要的介绍和整篇文档PDF的下载. https://co ...

随机推荐

  1. tomcat 下catalina.out 日志乱码问题处理

    问题: 项目部署到Linux服务器之后,控制台 catalina.out 文件输出的中文为乱码: 解决办法: 方法一:修改tomcat下的模板编码 bin/catalina.sh 文件添加如下配置:J ...

  2. angular controller与directive相互引用

    /** * Created by Administrator on 2017/8/28. */ var app =angular.module('app',[]); app.directive('fo ...

  3. 大数据学习——Storm+Kafka+Redis整合

    1 pom.xml <?xml version="1.0" encoding="UTF-8"?> <project xmlns="h ...

  4. 洛谷P3097 - [USACO13DEC]最优挤奶Optimal Milking

    Portal Description 给出一个\(n(n\leq4\times10^4)\)个数的数列\(\{a_n\}(a_i\geq1)\).一个数列的最大贡献定义为其中若干个不相邻的数的和的最大 ...

  5. 刷题总结——系列维护(ssoi)

    题目: 题解: 题解如上图,至于计算大于s的数字的数量和小于s数字的和用权值线段树或者树状数组维护就行了···注意离散化 另外发现cout和puts比printf快好多····· 代码: #inclu ...

  6. leetcode 347 priority,map的使用

    主要是对次数进行排序,然后去前几个最大次数的值,输出即可 class Solution { public: vector<int> topKFrequent(vector<int&g ...

  7. vue elementUI 表单校验(数组多层嵌套)

    在使用vue element-ui form表单渲染的时候,会遇到这样的数据结构: { "title":''123455, "email":'123456@qq ...

  8. java 汉字保存到mysql 乱码

    保存之前正常,插入数据乱码 确认jsp mysql编码都确定为utf8 在连接数据库是加上编码 jdbc:mysql://localhost:3306/test?useUnicode=true& ...

  9. 【Codevs1907】方格取数3(最小割)

    题意:在一个有m*n 个方格的棋盘中,每个方格中有一个正整数.现要从方格中取数,使任意2 个数所在方格没有公共边,且取出的数的总和最大.试设计一个满足要求的取数算法. n,m<=30 思路:如果 ...

  10. 洛谷—— P3375 【模板】KMP字符串匹配

    P3375 [模板]KMP字符串匹配 题目描述 如题,给出两个字符串s1和s2,其中s2为s1的子串,求出s2在s1中所有出现的位置. 为了减少骗分的情况,接下来还要输出子串的前缀数组next. (如 ...