grizzly版swift和glance整合

来源:互联网 发布:网络管理是什么意思 编辑:程序博客网 时间:2024/04/24 08:52
系统:ubuntu 12.0.4
环境:3节点
controller节点:172.16.77.128(swift的proxy也在此节点)
network节点:172.16.77.130
compute节点:172.16.77.131
部署方式参照上篇博文:http://blog.sina.com.cn/s/blog_6773675101019omm.html

相对于swift和keystone整合,swift和glance整合相对简单
修改/etc/glance/glance-api.conf中
default_store = file
swift_store_auth_address = 127.0.0.1:5000/v2.0/
swift_store_user = jdoe:jdoe
swift_store_key = a86850deb2742ec3cb41518e26aa2d89
swift_store_create_container_on_put = False

to:
default_store = swift
swift_store_auth_address =http://172.16.77.128:5000/v2.0/(备注:swift proxy url)
swift_store_user = service:swift
swift_store_key = service_pass
swift_store_create_container_on_put = True

然后service glance restart
这时候我们会在/var/log/glance/api.log中看到这样一条日志:
2013-08-19 01:10:42.245 3236 WARNING glance.api.v2.images [-]Could not find schema properties file schema-image.json. Continuingwithout custom properties
我们修改的配置不生效
这是由于/etc/glance中缺少了schema-image.json.缺少了schema-image.json.,我是通过apt-getinstall的方式安装的,这应该算是一个bug
cd /home/
gitclone https://github.com/openstack/glance.git
cd glance
git tag
git checkout grizzly-2
cp etc/schema-image.json /etc/glance/
然后这个问题就搞定了

验证:
glance add name="test"is_public=true disk_format="qcow2"container_format="bare" location="https://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-disk.img"
grizzly版swift和glance整合
这里我们可以看到glanceadd成功,通过glance命令查询也可以查到,但是通过swift命令查询并未看到有新的object。而且通过后期创建实例的现象表明,这里glance应该并没有把镜像下到本地,而只是保存了一份记录
那我们先把镜像下到本地,再上传
cd /home/
wgethttps://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-disk.img
glance add name="cirros-0.3.0-x86_64-disk" is_public=truedisk_format="qcow2" container_format="bare" <cirros-0.3.0-x86_64-disk.img
grizzly版swift和glance整合
这次可以证明swift和glance配置成功

附:
可以通过qemu-img info cirros-0.3.0-x86_64-disk.img查询镜像信息
原创粉丝点击