6.安装和配置OpenStack图片服务组件

安装和配置图片服务组件

这里是安装在控制器上

安装和配置图片服务组件

yum install –y openstack-glance python-glanceclient

 

编辑/etc/glance/glance-api.conf

mv /etc/glance/glance-api.conf /etc/glance/glance-api.conf_bak

vim /etc/glance/glance-api.conf

[database]
connection = mysql://glance:toyo123@controller/glance

 
[keystone_authtoken]
auth_uri = http://controller:5000/v2.0
identity_uri = http://controller:35357
admin_tenant_name = service
admin_user = glance
admin_password = Abcd1234

[paste_deploy]
flavor = keystone

[glance_store]
default_store = file
filesystem_store_datadir = /var/lib/glance/images/

 

[DEFAULT]
verbose = True
notification_driver = noop

 

编辑/etc/glance/glance-registry.conf

mv /etc/glance/glance-registry.conf /etc/glance/glance-registry.conf_bak

vim /etc/glance/glance-registry.conf

[database]
connection = mysql://glance:toyo123@controller/glance

[keystone_authtoken]
auth_uri = http://controller:5000/v2.0
identity_uri = http://controller:35357
admin_tenant_name = service
admin_user = glance
admin_password = Abcd1234

[paste_deploy]
flavor = keystone

[DEFAULT]
verbose = True
notification_driver = noop

 

填充图像服务数据库并启动图像服务配置为开机自启动

su -s /bin/sh -c "glance-manage db_sync" glance
systemctl enable openstack-glance-api.service openstack-glance-registry.service
systemctl start openstack-glance-api.service openstack-glance-registry.service

 

测试服务是否正常

mkdir /tmp/images
yum install -y wget
wget -P /tmp/images http://cdn.download.cirros-cloud.net/0.3.3/cirros-0.3.3-x86_64-disk.img
source admin-openrc.sh
glance image-create --name "cirros-0.3.3-x86_64" --file /tmp/images/cirros-0.3.3-x86_64-disk.img \
  --disk-format qcow2 --container-format bare --is-public True --progress
glance image-list
rm -r /tmp/images

 

posted @ 2017-03-11 21:27  IT菜鸟园  阅读(389)  评论(0编辑  收藏  举报