使用Swift作为Glance后端存储
2015-04-29 15:09
323 查看
原文链接 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).
Verify the user glance is part of tenant service with role admin.
One of the roles returned should be admin.
Open /etc/glance/glance-api.conf and comment out the following two lines:
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):
With the configuration changes in place, restart the Glance services.
If you are running CentOS/RHEL:
If you are running Ubuntu:
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
delete any existing Glance Images, they will still be there).
Once the Horizon Dashboard or the
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):
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-listreports
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后端存储
- openstack-kilo,glance使用swift 作为后端存储
- OpenStack入门修炼之Cinder服务-->使用NFS作为后端存储(19)
- 微软企业库4.1学习笔记(十五)缓存模块3 使用数据库作为后端存储
- 使用Glusterfs作为kvm后端存储
- openstack的glance、nova、cinder使用ceph做后端存储
- Openstack存储总结之:详解如何使用NFS作为Cinder的后端存储
- openstack kilo 卷备份使用nfs作为后端存储
- 使用MongoDB作为Salt Pillar后端存储数据
- 使用Ceph作为OpenStack的后端存储
- jaeger 使用ElasticSearch 作为后端存储
- 使用Docker跑MySQL 作为Django的存储后端
- 微软企业库4.1学习笔记(十五)缓存模块3 使用数据库作为后端存储
- openstack swift做glance后端存储
- 微软企业库4.1学习笔记(十五)缓存模块3 使用数据库作为后端存储
- Openstack存储总结之:使用Ceph集群作为后端统一存储
- 使用Ceph作为OpenStack的后端存储
- 微软企业库4.1学习笔记(十五)缓存模块3 使用数据库作为后端存储
- 使用Ceph作为OpenStack的后端存储
- KVM使用glusterfs作为后端存储