このセクションは、Block Storage サービスをコントローラーノードにインストールして設定する方法を説明します。このサービスでは、ボリュームをインスタンスに提供するストレージノードが少なくとも 1 つ必要です。
Block Storage サービスをインストールして設定する前に、データベース、サービスクレデンシャル、API エンドポイントを作成する必要があります。
データベースを作成するには、これらの手順をすべて実行します。
データベースクライアントを使用して、データベースサーバーに root ユーザーとして接続します。
$ mysql -u root -p
cinder データベースを作成します。
mysql> CREATE DATABASE cinder;
cinder データベースに適切なアクセス権を付与します。
mysql> GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'localhost' \
  IDENTIFIED BY 'CINDER_DBPASS';
mysql> GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'%' \
  IDENTIFIED BY 'CINDER_DBPASS';
CINDER_DBPASS を適切なパスワードに置き換えてください。
データベースクライアントを終了します。
admin クレデンシャルを読み込み、管理者専用 CLI コマンドへのアクセス権を取得します。
$ . admin-openrc
以下の手順を実行して、サービスクレデンシャルを作成します。
cinder ユーザーを作成します。
$ openstack user create --domain default --password-prompt cinder
User Password:
Repeat User Password:
+---------------------+----------------------------------+
| Field               | Value                            |
+---------------------+----------------------------------+
| domain_id           | default                          |
| enabled             | True                             |
| id                  | 0dbcdd0968dd4c948eacf9eb60d82b46 |
| name                | cinder                           |
| password_expires_at | None                             |
+---------------------+----------------------------------+
admin ロールを cinder ユーザーに追加します。
$ openstack role add --project service --user cinder admin
注釈
このコマンドは何も出力しません。
cinder および cinderv2 サービスエンティティーを作成します。
$ openstack service create --name cinder \
  --description "OpenStack Block Storage" volume
+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | OpenStack Block Storage          |
| enabled     | True                             |
| id          | ab3bbbef780845a1a283490d281e7fda |
| name        | cinder                           |
| type        | volume                           |
+-------------+----------------------------------+
$ openstack service create --name cinderv2 \
  --description "OpenStack Block Storage" volumev2
+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | OpenStack Block Storage          |
| enabled     | True                             |
| id          | eb9fd245bdbc414695952e93f29fe3ac |
| name        | cinderv2                         |
| type        | volumev2                         |
+-------------+----------------------------------+
注釈
Block Storage サービスは 2 つのサービスエンティティーを必要とします。
Block Storage サービスの API エンドポイントを作成します。
$ openstack endpoint create --region RegionOne \
  volume public http://controller:8776/v1/%\(tenant_id\)s
  +--------------+-----------------------------------------+
  | Field        | Value                                   |
  +--------------+-----------------------------------------+
  | enabled      | True                                    |
  | id           | 03fa2c90153546c295bf30ca86b1344b        |
  | interface    | public                                  |
  | region       | RegionOne                               |
  | region_id    | RegionOne                               |
  | service_id   | ab3bbbef780845a1a283490d281e7fda        |
  | service_name | cinder                                  |
  | service_type | volume                                  |
  | url          | http://controller:8776/v1/%(tenant_id)s |
  +--------------+-----------------------------------------+
$ openstack endpoint create --region RegionOne \
  volume internal http://controller:8776/v1/%\(tenant_id\)s
  +--------------+-----------------------------------------+
  | Field        | Value                                   |
  +--------------+-----------------------------------------+
  | enabled      | True                                    |
  | id           | 94f684395d1b41068c70e4ecb11364b2        |
  | interface    | internal                                |
  | region       | RegionOne                               |
  | region_id    | RegionOne                               |
  | service_id   | ab3bbbef780845a1a283490d281e7fda        |
  | service_name | cinder                                  |
  | service_type | volume                                  |
  | url          | http://controller:8776/v1/%(tenant_id)s |
  +--------------+-----------------------------------------+
$ openstack endpoint create --region RegionOne \
  volume admin http://controller:8776/v1/%\(tenant_id\)s
  +--------------+-----------------------------------------+
  | Field        | Value                                   |
  +--------------+-----------------------------------------+
  | enabled      | True                                    |
  | id           | 4511c28a0f9840c78bacb25f10f62c98        |
  | interface    | admin                                   |
  | region       | RegionOne                               |
  | region_id    | RegionOne                               |
  | service_id   | ab3bbbef780845a1a283490d281e7fda        |
  | service_name | cinder                                  |
  | service_type | volume                                  |
  | url          | http://controller:8776/v1/%(tenant_id)s |
  +--------------+-----------------------------------------+
$ openstack endpoint create --region RegionOne \
  volumev2 public http://controller:8776/v2/%\(tenant_id\)s
+--------------+-----------------------------------------+
| Field        | Value                                   |
+--------------+-----------------------------------------+
| enabled      | True                                    |
| id           | 513e73819e14460fb904163f41ef3759        |
| interface    | public                                  |
| region       | RegionOne                               |
| region_id    | RegionOne                               |
| service_id   | eb9fd245bdbc414695952e93f29fe3ac        |
| service_name | cinderv2                                |
| service_type | volumev2                                |
| url          | http://controller:8776/v2/%(tenant_id)s |
+--------------+-----------------------------------------+
$ openstack endpoint create --region RegionOne \
  volumev2 internal http://controller:8776/v2/%\(tenant_id\)s
+--------------+-----------------------------------------+
| Field        | Value                                   |
+--------------+-----------------------------------------+
| enabled      | True                                    |
| id           | 6436a8a23d014cfdb69c586eff146a32        |
| interface    | internal                                |
| region       | RegionOne                               |
| region_id    | RegionOne                               |
| service_id   | eb9fd245bdbc414695952e93f29fe3ac        |
| service_name | cinderv2                                |
| service_type | volumev2                                |
| url          | http://controller:8776/v2/%(tenant_id)s |
+--------------+-----------------------------------------+
$ openstack endpoint create --region RegionOne \
  volumev2 admin http://controller:8776/v2/%\(tenant_id\)s
+--------------+-----------------------------------------+
| Field        | Value                                   |
+--------------+-----------------------------------------+
| enabled      | True                                    |
| id           | e652cf84dd334f359ae9b045a2c91d96        |
| interface    | admin                                   |
| region       | RegionOne                               |
| region_id    | RegionOne                               |
| service_id   | eb9fd245bdbc414695952e93f29fe3ac        |
| service_name | cinderv2                                |
| service_type | volumev2                                |
| url          | http://controller:8776/v2/%(tenant_id)s |
+--------------+-----------------------------------------+
注釈
Block Storage サービスは、それぞれのサービスエンティティーのエンドポイントを必要とします。
パッケージをインストールします。
# apt install cinder-api cinder-scheduler
/etc/cinder/cinder.conf ファイルを編集し、以下の作業をすべて行います。
[database] セクションで、データベースのアクセス方法を設定します。
[database]
...
connection = mysql+pymysql://cinder:CINDER_DBPASS@controller/cinder
CINDER_DBPASS を Block Storage データベース用に選択したパスワードで置き換えます。
[DEFAULT] セクションに、RabbitMQ メッセージキューのアクセス方法を設定します。
[DEFAULT]
...
transport_url = rabbit://openstack:RABBIT_PASS@controller
RABBIT_PASS を RabbitMQ の openstack アカウント用に選択したパスワードで置き換えます。
[DEFAULT] セクションと [keystone_authtoken] セクションに、Identity サービスへのアクセス方法を設定します。
[DEFAULT]
...
auth_strategy = keystone
[keystone_authtoken]
...
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name = Default
user_domain_name = Default
project_name = service
username = cinder
password = CINDER_PASS
CINDER_PASS を Identity サービスで cinder ユーザー用に選択したパスワードで置き換えます。
注釈
[keystone_authtoken] セクションにある他のオプションは、コメントアウトまたは削除します。
[DEFAULT] セクションで、コントローラーノードの管理インターフェースの IP アドレスを使用するように``my_ip`` オプションを設定します。
[DEFAULT]
...
my_ip = 10.0.0.11
Block Storage データベースを展開します。
# su -s /bin/sh -c "cinder-manage db sync" cinder
注釈
この出力の廃止予定に関するメッセージはすべて無視してください。
/etc/nova/nova.conf ファイルを編集し、以下を追加します。
[cinder]
os_region_name = RegionOne
Compute API サービスを再起動します。
# service nova-api restart
Block Storage サービスを再起動します。
# service cinder-scheduler restart
# service cinder-api restart
 
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.