原文链接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
localfilesystem 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 namedopenrc).
source ~/openrc
Verify the userglanceis part of tenantservicewith roleadmin.
keystone user-role-List --user glance --tenant service
One of the roles returned should beadmin.
Open/etc/glance/glance-API.confand comment out the following two lines:
##### DEFAulT OPTIONS ######default_store = file#filesystem_store_datadir = /var/lib/glance/images/
With/etc/glance/glance-API.confstill open,append the following lines to theDEFAulT OPTIONSsection (be
sureto set the values insIDe< >to match your environment):
default_store = swiftswift_store_auth_address = http://<IP_OF_KEYSTONE>:35357/v2.0/swift_store_user = service:glanceswift_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 runningCentOS/RHEL:
service openstack-glance-API restartservice openstack-glance-registry restart
If you are runningUbuntu:
service glance-API restartservice 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
calledglancein theserviceaccount.
Verify nothing is saved in/var/lib/glance/imagesby simply runningls /var/lib/glance/images
(if you dID not
delete any existing Glance Images,they will still be there).
Once the Horizon Dashboard or theglance image-List
reports the image isactive,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后端存储全部内容,希望文章能够帮你解决使用Swift作为Glance后端存储所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)