10.1 存储分类
块存储:硬盘,磁盘阵列DAS,SAN存储 文件存储:nfs,GluserFS,Ceph(PB级分布式文件系统),MooserFS(缺点Metadata数据丢失,虚拟机完全丢失) 对象存储:Swift,S3
10.2 创建cinder数据库
mysql -uroot -pabc-123
---
create database cinder;
grant all privileges on cinder.* to 'cinder'@'localhost' identified by 'cinder';
grant all privileges on cinder.*to 'cinder'@'%' identified by 'cinder';
flush privileges;
---
exit
10.3在keystone注册cinder
10.3.1 keystone创建cinder用户
source /script/admin.sh
openstack user create --domain default --password=cinder cinder
openstack user list
10.3.2 在Keystone上把cinder用户添加到test项目的admin权限
openstack role add --project test --user cinder admin
10.3.3 创建cinder存储服务
openstack service create --name cinderv2 --description "OpenStack Block Storage" volumev2
openstack service create --name cinderv3 --description "OpenStack Block Storage" volumev3
openstack service list
10.3.4 创建cinder的API服务
openstack endpoint create --region RegionOne volumev2 public http://controller:8776/v2/%\(project_id\)s
openstack endpoint create --region RegionOne volumev2 internal http://controller:8776/v2/%\(project_id\)s
openstack endpoint create --region RegionOne volumev2 admin http://controller:8776/v2/%\(project_id\)s
openstack endpoint create --region RegionOne volumev3 public http://controller:8776/v3/%\(project_id\)s
openstack endpoint create --region RegionOne volumev3 internal http://controller:8776/v3/%\(project_id\)s
openstack endpoint create --region RegionOne volumev3 admin http://controller:8776/v3/%\(project_id\)s
openstack endpoint list
10.4 安装cinder
yum install openstack-cinder -y
10.5 修改cinder配置
openstack-config --set /etc/cinder/cinder.conf DEFAULT my_ip 192.168.204.10
openstack-config --set /etc/cinder/cinder.conf database connection mysql+pymysql://cinder:cinder@controller/cinder
openstack-config --set /etc/cinder/cinder.conf DEFAULT transport_url rabbit://openstack:openstack@controller
openstack-config --set /etc/cinder/cinder.conf DEFAULT auth_strategy keystone
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken auth_uri http://controller:5000
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken auth_url http://controller:5000
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken memcached_servers controller:11211
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken auth_type password
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken project_domain_name default
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken user_domain_name default
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken project_name test
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken username cinder
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken password cinder
openstack-config --set /etc/cinder/cinder.conf oslo_concurrency lock_path /var/lib/nova/tmp
10.6 同步cinder数据库
su -s /bin/sh -c "cinder-manage db sync" cinder
mysql -h127.0.0.1 -ucinder -pcinder -e "use cinder;show tables;"
10.7 修改nova配置文件
openstack-config --set /etc/nova/nova.conf cinder os_region_name RegionOne
10.8 重启nova-api服务
systemctl restart openstack-nova-api.service
systemctl status openstack-nova-api.service
10.9 启动并且配置自启动
systemctl start openstack-cinder-api.service openstack-cinder-scheduler.service
systemctl status openstack-cinder-api.service openstack-cinder-scheduler.service
systemctl enable openstack-cinder-api.service openstack-cinder-scheduler.service