塊存儲,相似於磁盤
第一步:建立cinder的數據庫和用戶
[root@zxw6 ~]# mysql -uroot -p123
create database cinder;mysql
grant all on cinder.* to cinder@'localhost' identified by 'zxw6';
Query OK, 0 rows affected (0.02 sec)redis
grant all on cinder.* to cinder@'%' identifiied by 'zxw6';
Query OK, 0 rows affected (0.00 sec)sql
登陸到openstack
[root@zxw6 ~]# source openrc 數據庫
第二步:建立openstack的cinder用戶
[root@zxw6 ~]# openstack user create --domain default --password=zxw6 cindervim
+---------------------+----------------------------------+
| Field | Value |
+---------------------+----------------------------------+
| domain_id | default |
| enabled | True |
| id | c6d19459b0354931a4e281bfc52b9a88 |
| name | cinder |
| options | {} |
| password_expires_at | None |
+---------------------+----------------------------------+api
第四步:在service項目把cinder用戶加入到admin角色
[root@zxw6 ~]# openstack role add --project service --user cinder admincors
第五步:建立service項目cinderv2,cinderv3dom
[root@zxw6 ~]# openstack service create --name cinderv2 --description "OpenStack Block Storage" volumev2
+-------------+----------------------------------+
| Field | Value |
+-------------+----------------------------------+
| description | OpenStack Block Storage |
| enabled | True |
| id | d51dc5280e584c7b8a50f018a0041724 |
| name | cinderv2 |
| type | volumev2 |
+-------------+----------------------------------+ide
[root@zxw6 ~]# openstack service create --name cinderv3 --description "OpenStack Block Storage" volumev3
+-------------+----------------------------------+
| Field | Value |
+-------------+----------------------------------+
| description | OpenStack Block Storage |
| enabled | True |
| id | c67f72e6c80942ef9baacc123feae8da |
| name | cinderv3 |
| type | volumev3 |
+-------------+----------------------------------+memcached
第六步:建立服務v2,v3端點8776
openstack endpoint create --region RegionOne volumev2 public http://zxw6:8776/v2/%\(project_id\)s
openstack endpoint create --region RegionOne volumev2 internal http://zxw6:8776/v2/%\(project_id\)s
openstack endpoint create --region RegionOne volumev2 admin http://zxw6:8776/v2/%\(project_id\)s
openstack endpoint create --region RegionOne volumev3 public http://zxw6:8776/v3/%\(project_id\)s
openstack endpoint create --region RegionOne volumev3 internal http://zxw6:8776/v3/%\(project_id\)s
openstack endpoint create --region RegionOne volumev3 admin http://zxw6:8776/v3/%\(project_id\)s
第七步:下載cinder服務
[root@zxw6 ~]# yum install openstack-cinder -y
第八步:編輯配置文件cinder
vim /etc/cinder/cinder.conf
root@zxw6 cinder]# egrep -v '(#|^$)' cinder.conf
[DEFAULT]
my_ip = 192.168.126.6
transport_url = rabbit://openstack:zxw6@zxw6
auth_strategy = keystone
[backend]
[barbican]
[brcd_fabric_example]
[cisco_fabric_example]
[coordination]
[cors]
[cors.subdomain]
[database]
connection = mysql+pymysql://cinder:zxw6@zxw6/cinder
[fc-zone-manager]
[healthcheck]
[key_manager]
[keystone_authtoken]
auth_uri = http://zxw6:5000
auth_url = http://zxw6:35357
memcached_servers = zxw6:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = cinder
password = zxw6
[matchmaker_redis]
[oslo_concurrency]
lock_path = /var/lib/cinder/tmp
[oslo_messaging_amqp]
[oslo_messaging_kafka]
[oslo_messaging_notifications]
[oslo_messaging_rabbit]
[oslo_messaging_zmq]
[oslo_middleware]
[oslo_policy]
[oslo_reports]
[oslo_versionedobjects]
[profiler]
[ssl]
第九步:導入cinder數據庫
[root@zxw6 ~]# su -s /bin/sh -c "cinder-manage db sync" cinder
第十步:編輯nova服務
[root@zxw6 ~]# vim /etc/nova/nova.conf
[cinder]
os_region_name = RegionOne
第十一步:重啓nova-api服務
[root@zxw6 ~]# systemctl restart openstack-nova-api.service
第十二步 :啓動cinder服務並開機自啓
[root@zxw6 ~]# systemctl start openstack-cinder-api.service openstack-cinder-scheduler.service
[root@zxw6 ~]# systemctl enable openstack-cinder-api.service openstack-cinder-scheduler.service