Rate This Document
Findability
Accuracy
Completeness
Readability

Creating the Cinder Database

Cinder is a block storage service that provides persistent storage for VM instances. It simplifies the creation and management of block storage devices.

In the hybrid deployment solution, to isolate the service architecture and storage, different availability zones (AZs) are divided, including the compute Nova AZ and storage Cinder AZ. The two AZs should be mapped to each other to achieve isolation. Currently, most OpenStack platforms use Ceph as the Cinder (and Glance and Swift) storage backend, and create block storage from images during VM creation. In the hybrid deployment, different Cinder AZs are created and different Ceph pools are configured so that the VM OS drives created in different AZs are completely isolated in the Ceph cluster.

Perform the following operations on the controller node.

  1. Access the database as the user root.
    1
    mysql -u root -p
    
  2. Create a Cinder database and grant proper access to the Cinder database.
    1
    2
    3
    4
    CREATE DATABASE cinder;
    GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'localhost' IDENTIFIED BY '<PASSWORD>';
    GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'%' IDENTIFIED BY '<PASSWORD>';
    exit
    

    In this document, all passwords are represented as PASSWORD. Use the actual password during the operation. Replace the PASSWORD with the password of the Cinder database.

  3. Log in to the OpenStack CLI as the user admin, create service credentials and the cinder user, and set the password.
    1
    2
    source /etc/keystone/admin-openrc
    openstack user create --domain default --password-prompt cinder
    

    The password for the cinder user must be the same as the password for accessing the Cinder database described in section Creating the Cinder Database.

  4. Add the admin role to the cinder user.
    1
    openstack role add --project service --user cinder admin
    
  5. Create cinderv2 and cinderv3 service entities.
    1
    2
    openstack service create --name cinderv2 --description "OpenStack Block Storage" volumev2
    openstack service create --name cinderv3 --description "OpenStack Block Storage" volumev3
    

    Two service entities need to be created for the Cinder service.

  6. Create API endpoints of the Block Storage service.
    1
    2
    3
    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
    

    1
    2
    3
    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