Block Storage Server:
1. sudo apt-get install python-mysqldb 2. sudo apt-get install lvm2 3. Create a storage volume sudo pvcreate/dev/sdbsudo vgcreate cinder-volumes/dev/sdb 4. sudo vi/etc/lvm/lvm.conffilter = ["a/sda1/", "a/sdb/", "r/.*/"] 5. sudo apt-get install Cinder-volume 6. sudo vi/etc/cinder/cinder.conf
[Keystone_authtoken]Auth_uri = Http://controller:5000auth_host = Controllerauth_port = 35357auth_protocol = Httpadmin_tenant_name = Serviceadmin_user = Cinderadmin_password = Cinder_pass
[DEFAULT]Rpc_backend = Rabbitrabbit_host = Controllerrabbit_port = 5672rabbit_userid = Guestrabbit_password = RABBIT_PASS
[Database]Connection = Mysql://cinder:[email Protected]/cinder
[DEFAULT]Glance_host = Controller 7. sudo service cinder-volume restart && sudo service TGT restart
Controller Node:1. sudo apt-get install Cinder-api Cinder-scheduler 2. sudo vi/etc/cinder/cinder.conf
[Database]Connection = Mysql://cinder:[email Protected]/cinder 3. Create databases Mysql-u root-pcreate database cinder; GRANT all privileges the cinder.* to ' cinder ' @ ' localhost ' identified by ' cinder_dbpass '; GRANT all privileges the cinder.* to ' cinder ' @ '% ' identified by ' cinder_dbpass '; 4. Sudo-s/bin/sh-c "Cinder-manage db Sync" cinder 5. Create user source Admin-openrc.shkeystone user-create--name=cinder--pass=cinder_pass [email protected]
Keystone User-role-add--user=cinder--tenant=service--role=admin 6. sudo vi/etc/cinder/cinder.conf
[Keystone_authtoken]Auth_uri = Http://controller:5000auth_host = Controllerauth_port = 35357auth_protocol = Httpadmin_tenant_name = Serviceadmin_user = Cinderadmin_password = Cinder_pass
[DEFAULT]Rpc_backend = Rabbitrabbit_host = Controllerrabbit_port = 5672rabbit_userid = Guestrabbit_password = RABBIT_PASS 7. keystone service-create--name=cinder--type=volume--description= "OpenStack Block Storage" Keystone Endpoint-create \ --service-id=$ (Keystone Service-list | awk '/volume/{print $} ') \ --publicurl=http://con Troller:8776/v1/%\ (tenant_id\) s \ --internalurl=http://controller:8776/v1/%\ (tenant_id\) s \ --adminurl =http://controller:8776/v1/%\ (tenant_id\) skeystone service-create--name=cinderv2--type=volumev2--description= " OpenStack Block Storage v2 "Keystone Endpoint-create \ --service-id=$ (Keystone Service-list | awk '/volumev2/{Prin T-$} ') \ --publicurl=http://controller:8776/v2/%\ (tenant_id\) s \ --internalurl=http://controller:8776/ V2/%\ (tenant_id\) s \ --adminurl=http://controller:8776/v2/%\ (tenant_id\) s 8. sudo service cinder-scheduler restart && sudo service cinder-api restart
Verify:1. SOURCE demo-openrc.sh 2. Cinder Create--display-name Myvolume 1 3. Cinder List
9. Add the Block Storage service