本文与前面所写的一篇关于glance的安装配置文章大部分是重复的,如果已经看过前面的那一篇,此篇略读即可
1.配置
1.1拷贝默认配置文件:
[ugyn@cc keystone-2012.1]$ cd ../glance-2012.1 && sudo cp -R etc /etc/glance
[ugyn@cc glance-2012.1]$ sudo chown -R ugyn:ugyn /etc/glance
1.2配置glance使用keystone认证:
更新/etc/glance/glance-api-paste.ini的以下选项为keystone中的设置值:
[filter:authtoken]
admin_tenant_name = service
admin_user = glance
admin_password = service123
在/etc/glance/glance-api.conf尾添加:
[paste_deploy]
flavor = keystone
更新/etc/glance/glance-registry-paste.ini的以下选项为keystone中的设置值
[filter:authtoken]
admin_tenant_name = service
admin_user = glance
admin_password = service123
在/etc/glance/glance-registry.conf尾添加:
[paste_deploy]
flavor = keystone
1.3设置glance的mysql连接:
修改/etc/glance/glance-registry.conf下的
sql_connection = mysql://glance:glance@localhost/glance
1.4配置glance的通信服务器:
修改/etc/glance/glance-api.conf下的:
notifier_strategy = noop
为:
notifier_strategy = rabbit
rabbit_password = guest
为:
rabbit_password = service123
现在我采用qpid作为通信服务器,设置notifier_strategy = qpid,其它qpid选项没做修改
1.5配置glance的存储:
在这里先不做修改了,采用默认的文件存取,以后配置好swift后再改
1.6创建目录:
[ugyn@cc glance-2012.1]$ sudo mkdir /var/log/glance
[ugyn@cc glance-2012.1]$ sudo mkdir /var/lib/glance
[ugyn@cc glance-2012.1]$ sudo chown -R ugyn:ugyn /var/log/glance
[ugyn@cc glance-2012.1]$ sudo chown -R ugyn:ugyn /var/lib/glance
2.运行
[ugyn@cc glance-2012.1]$ sudo glance-control all start
将start换成restart、stop即可重启、关闭glance
3.测试
3.1境像上传:
下载境像:http://smoser.brickies.net/ubuntu/ttylinux-uec/ttylinux-uec-amd64-12.1_2.6.35-22_1.tar.gz
[ugyn@cc glance-2012.1]$ cd ~/image
[ugyn@cc image]$ tar xzvf ttylinux-uec-amd64-12.1_2.6.35-22_1.tar.gz
上传kernel:
[ugyn@cc image]$ glance add name="tty-linux-kernel" disk_format=aki container_format=aki < ttylinux-uec-amd64-12.1_2.6.35-22_1-vmlinuz
输出:
Uploading image 'tty-linux-kernel'
===============================================================================================[100%] 13.9M/s, ETA 0h 0m 0s
Added new image with ID: d83d5227-64ba-4541-adce-4c5442d9eecc
上传initrd:
[ugyn@cc image]$ glance add name="tty-linux-ramdisk" disk_format=ari container_format=ari < ttylinux-uec-amd64-12.1_2.6.35-22_1-loader
输出:
Uploading image 'tty-linux-ramdisk'
=========================================================================================[100%] 935.456035K/s, ETA 0h 0m 0s
Added new image with ID: b7b783f9-7007-453b-9236-242765136898
上传image:注意这里的kernel_id各ramdisk_id是前面两步上传生成的id
[ugyn@cc image]$ glance add name="tty-linux" disk_format=ami container_format=ami kernel_id=d83d5227-64ba-4541-adce-4c5442d9eecc ramdisk_id=b7b783f9-7007-453b-9236-242765136898 < ttylinux-uec-amd64-12.1_2.6.35-22_1.img
输出:
Uploading image 'tty-linux'
===============================================================================================[100%] 79.6M/s, ETA 0h 0m 0s
Added new image with ID: fbd05c73-7bea-4af6-a0d5-9c7581569792
3.2查看上传的镜像:
glance的其它操作请查看请通过命令glance --help
好了,glance就说到这,接下来我将说说nova的配置、运行、测试,在实验过程中遇到了各种错误,好在最后还是把它跑起来了,说完这个后我将把相关文件整理下,上传到csdn供大家下载使用。
-
1楼
jiang7879 2012-05-08 14:16发表
-
-
2012-05-08 21:51:00 6807 ERROR [glance.store.filesystem] Could not find filesystem_store_datadir in configuration options.
2012-05-08 21:51:00 6807 ERROR [glance.store.base] Failed to configure store correctly. Disabling add method.
2012-05-08 21:51:00 6807 ERROR [glance.store.s3] Could not find s3_store_host in configuration options.
2012-05-08 21:51:00 6807 ERROR [glance.store.base] Failed to configure store correctly. Disabling add method.
2012-05-08 21:51:00 6807 ERROR [glance.store.swift] Could not find swift_store_auth_address in configuration options.
2012-05-08 21:51:00 6807 ERROR [glance.store.base] Failed to configure store correctly. Disabling add method.
2012-05-08 21:51:00 6807 INFO [glance.store.scrubber] Deleting 0 images
用了你的配置文件会报这些错误-
Re:
ugyn109 2012-05-09 15:36发表
-
- 回复jiang7879:这是glance-scrubber的错误,关于该服务的作用我也不是很清楚,但是glance只需要glance-api和glance-registry两个服务就可以正常工作了,所以我也没管它。
-