mastesr:
yum install openstack-cinder python-cinderclient
/etc/cinder/cinder.conf
cat > /etc/cinder/cinder.conf <<EOF [DEFAULT] transport_url = rabbit://openstack:openstack@192.168.3.220 auth_strategy = keystone [keystone_authtoken] auth_uri = http://192.168.3.220:5000 auth_url = http://192.168.3.220:35357 memcached_servers = 192.168.3.220:11211 auth_type = password project_domain_name = default user_domain_name = default project_name = service username = cinder password = cinder [database] connection = mysql+pymysql://cinder:cinder@192.168.3.220/cinder [oslo_concurrency] lock_path = /var/lib/cinder/tmp EOF
初始化cinder数据库
su -s /bin/sh -c "cinder-manage db sync" cinder && mysql -ucinder -pcinder -e "use cinder; show tables;"
cat /etc/nova/nova.conf (增加)
[cinder] os_region_name = RegionOne systemctl restart openstack-nova-api openstack-cinder-api openstack-cinder-scheduler systemctl enable openstack-cinder-api openstack-cinder-scheduler
创建服务与端点
openstack service create --name cinder --description "Openstack Block Storage" volumev2 openstack service create --name cinder --description "Openstack Block Storage" volumev3 openstack endpoint create --region RegionOne volumev2 public http://192.168.3.220:8776/v2/%(tenant_id)s openstack endpoint create --region RegionOne volumev2 internal http://192.168.3.220:8776/v2/%(tenant_id)s openstack endpoint create --region RegionOne volumev2 admin http://192.168.3.220:8776/v2/%(tenant_id)s openstack endpoint create --region RegionOne volumev3 public http://192.168.3.220:8776/v3/%(tenant_id)s openstack endpoint create --region RegionOne volumev3 internal http://192.168.3.220:8776/v3/%(tenant_id)s openstack endpoint create --region RegionOne volumev3 admin http://192.168.3.220:8776/v3/%(tenant_id)s
================================================================================================
LVM节点(这里配置在控制器上)
安装并设置卡机启动
yum install -y lvm2 targetcli python-keystone openstack-cinder
systemctl enable lvm2-lvmetad && systemctl start lvm2-lvmetad
配置lvm卷
fdisk -l pvcreate /dev/sdb vgcreate cinder-volumes /dev/sdb (查看vgdisplay cinder-volumes )
vim /etc/lvm/lvm.conf (中){ sed -i 's#^devices {#&
filter = [ "a/sda/", "a/sdb/", "r/.*/"]#g' /etc/lvm/lvm.conf }
devices { (系统又lvm才这样操作,排除掉系统本身的lvm,控制器上也需要配)
......
filter = [ "a/sda/", "a/sdb/", "r/.*/"](存储节点,在控制器上需要配)
}
/etc/cinder/cinder.conf 增加
[DEFAULT] verbose = True enabled_backends = lvm glance_host = http://192.168.3.220:9292 [lvm] volume_driver = cinder.volume.drivers.lvm.LVMVolumeDriver volume_group = cinder-volumes iscsi_protocol = iscsi iscsi_helper = lioadm [backend_defaults] iscsci_ip_address = 192.168.3.220
重启服务
systemctl enable openstack-cinder-volume target && systemctl restart openstack-cinder-volume target
控制器查看卷
openstack volume service list