CentOS 6.2下源代码安装OpenStack图文详解(4)

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境像上传:

下载境像:

解压:
[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 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 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 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的配置、运行、测试,在实验过程中遇到了各种错误,好在最后还是把它跑起来了,说完这个后我将把相关文件整理下,上传大家下载使用。

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/27cf8aa4b835e702a452c17a79bcdce6.html