# yum list *cinder*
# yum install *cinder* -y
# openstack user create cinder --password redhat
# openstack role add --user cinder --project services admin
# openstack service create --name cinder volume
# openstack endpoint create --region RegionOne --publicurl 'http://192.
168.179.140:8776/v1/%(tenant_id)s' --internalurl 'http://192.168.179.140:8776/v1/%(tenant_id)s' --adminurl 'http://192.168.179.140:8776/v1/%(tenant_id)s' d90608530d4348729cb3cb2a4df0f140
# openstack service create --name cinderv2 volumev2
# openstack endpoint create --region RegionOne --publicurl 'http://192.
168.179.140:8776/v2/%(tenant_id)s' --internalurl 'http://192.168.179.140:8776/v2/%(tenant_id)s' --adminurl 'http://192.168.179.140:8776/v2/%(tenant_id)s' 2edb4ecdb6ee483a8cccc57f445db6fb
修改配置文件:
从配置模板复制过来方便配置
配置数据库:
create database cinder;
grant all privileges on cinder.* to [email protected]'localhost' identified by 'redhat';
grant all privileges on cinder.* to [email protected]'%' identified by 'redhat';
grant all privileges on cinder.* to [email protected]'192.168.179.140' identified by 'redhat';
# sh -c 'cinder-manage db sync' cinder
systemctl list-unit-files | grep cinder
查看cinder:
# cinder list
# openstack volume list
创建volume:显示创建失败
查看log: /var/log/cinder/volume.log
即: 默认情况下,创建云硬盘的时候,默认使用lv作为后端存储,当每创建一个云硬盘,就会在cinder-volumes 里创建一个lv
现在的问题是没有这个卷组!!!因此新创建
修改配置文件,增加volume_driver配置并重启服务
volume_driver = cinder.volume.drivers.lvm.LVMVolumeDriver
重新创建volume
P.S: 默认使用的卷组是cinder-volumes 这个默认的卷组是可以修改的。
从备份的配置文件中过滤出默认选项,添加到配置文件中 并修改名字
将卷组的名字改成myvg
重新创建volume并测试:如下
########################################################################################################
测试环境:
使用OSP1(packstack安装好的cinder)以及osp3新建的cinder,分别定义不同的storage_availablity_zone.
让让OSP3的cinder endpoint指向 OSP1的keystone 来验证,从而进行测试cinder的存储有效域。
OSP3:cinder keystone认证修改:
修改OSP1的cinder配置文件如下:
OSP1需要添加endpoint 指向才行OSP3:
重启服务:
在OSP1的dashboard上创建volume测试:az137 如下:
在OSP1的dashboard上创建volume测试:az140 如下:
如下OSP1上的volume ID
OSP3上的volume ID 如下:
即OSP1上面图片中的第一个ID