CentOS 6
Sponsored Link

OpenStack Icehouse : Cinder 設定#1 ( Control ノード )
2014/06/26
 
OpenStack Block Storage(Cinder)をインストールします。
ここでは、以下のように、Keystone/Glance/Nova API インストール済みの Control ノード に 新たに Cinder API をインストールし、 Block Storage Service ノードに Cinder-Volume をインストールして設定します。 ( 例として役割ごとに分けていますが、All in One 構成にすることももちろん可能です )
                                      +------------------+
                             10.0.0.35| [ Storage Node ] |
+------------------+            +-----+   Cinder-Volume  |
| [ Control Node ] |            | eth0|                  |
|     Keystone     |10.0.0.30   |     +------------------+
|      Glance      |------------+
|     Nova API     |eth0        |     +------------------+
|    Cinder API    |            | eth0| [ Compute Node ] |
+------------------+            +-----+   Nova Compute   |
                             10.0.0.51|                  |
                                      +------------------+

 
ここでは、Control ノードの設定をします。
[1] Control ノードの Keystone に Cinder 用のユーザー等々を登録しておきます。
# Cinder ユーザー作成 (service テナント所属)

[root@dlp ~(keystone)]#
keystone user-create --tenant service --name cinder --pass servicepassword --enabled true

+----------+----------------------------------+
| Property |              Value               |
+----------+----------------------------------+
|  email   |                                  |
| enabled  |               True               |
|    id    | b15b794e27394abb9593affdab701a4d |
|   name   |              cinder              |
| tenantId | fc294b687db2410189f7c8bd81efe426 |
| username |              cinder              |
+----------+----------------------------------+

# Cinder ユーザーを adminロール に加える

[root@dlp ~(keystone)]#
keystone user-role-add --user cinder --tenant service --role admin
# Cinder 用サービスエントリ作成

[root@dlp ~(keystone)]#
keystone service-create --name=cinder --type=volume --description="Cinder Service"

+-------------+----------------------------------+
|   Property  |              Value               |
+-------------+----------------------------------+
| description |          Cinder Service          |
|   enabled   |               True               |
|      id     | 76dace48fa884efd87cdd07d9f3e9589 |
|     name    |              cinder              |
|     type    |              volume              |
+-------------+----------------------------------+

# Cinder API サーバーの IPアドレスを定義

[root@dlp ~(keystone)]#
export cinder_api=10.0.0.30
# Cinder 用エンドポイント作成

[root@dlp ~(keystone)]#
keystone endpoint-create --region RegionOne \
--service cinder \
--publicurl "http://$cinder_api:8776/v1/\$(tenant_id)s" \
--internalurl "http://$cinder_api:8776/v1/\$(tenant_id)s" \
--adminurl "http://$cinder_api:8776/v1/\$(tenant_id)s"

+-------------+----------------------------------------+
|   Property  |                 Value                  |
+-------------+----------------------------------------+
|   adminurl  | http://10.0.0.30:8776/v1/$(tenant_id)s |
|      id     |    65e9aebbd8984f72beb5ba0a69f8da18    |
| internalurl | http://10.0.0.30:8776/v1/$(tenant_id)s |
|  publicurl  | http://10.0.0.30:8776/v1/$(tenant_id)s |
|    region   |               RegionOne                |
|  service_id |    76dace48fa884efd87cdd07d9f3e9589    |
+-------------+----------------------------------------+
[2] Cinder 用のユーザーとデータベースを MariaDB に登録しておきます。
[root@dlp ~(keystone)]#
mysql -u root -p

Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 23
Server version: 5.5.36-MariaDB-wsrep MariaDB Server, wsrep_25.9.r3961

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

# 「Cinder」データベース作成 ( 'password'の箇所は設定するパスワードを入力 )

mysql>
create database cinder character set utf8;

Query OK, 1 row affected (0.00 sec)
mysql>
grant all privileges on cinder.* to cinder@'localhost' identified by 'password';

Query OK, 0 rows affected (0.00 sec)
mysql>
grant all privileges on cinder.* to cinder@'%' identified by 'password';

Query OK, 0 rows affected (0.00 sec)
mysql>
flush privileges;

Query OK, 0 rows affected (0.00 sec)
mysql>
exit

Bye
[3] Cinder サービスをインストールします。
# RDO, EPEL からインストール

[root@dlp ~(keystone)]#
yum --enablerepo=openstack-icehouse,epel -y install openstack-cinder
[4] Cinder の基本設定です。
[root@dlp ~(keystone)]#
mv /etc/cinder/cinder.conf /etc/cinder/cinder.conf.org

[root@dlp ~(keystone)]#
vi /etc/cinder/cinder.conf
# 新規作成

[DEFAULT]
state_path=/var/lib/cinder
api_paste_config=api-paste.ini
enable_v1_api=true
rootwrap_config=/etc/cinder/rootwrap.conf
auth_strategy=keystone
# RabbitMQ サーバーを指定

rabbit_host=10.0.0.30
rabbit_port=5672
# RabbitMQ サーバー認証用ID

rabbit_userid=guest
# RabbitMQ サーバー認証用IDのパスワード

rabbit_password=password
rpc_backend=rabbit
scheduler_driver=cinder.scheduler.filter_scheduler.FilterScheduler
volume_manager=cinder.volume.manager.VolumeManager
volume_api_class=cinder.volume.api.API
volumes_dir=$state_path/volumes
# MariaDB の接続情報

[database]
connection=mysql://cinder:password@10.0.0.30/cinder
# Keystone の認証情報

[keystone_authtoken]
auth_host=10.0.0.30
auth_port=35357
auth_protocol=http
admin_user=cinder
admin_password=servicepassword
admin_tenant_name=service
[root@dlp ~(keystone)]#
chmod 640 /etc/cinder/cinder.conf

[root@dlp ~(keystone)]#
chgrp cinder /etc/cinder/cinder.conf

[root@dlp ~(keystone)]#
cinder-manage db sync

[root@dlp ~(keystone)]#
for service in api scheduler; do
/etc/rc.d/init.d/openstack-cinder-$service start
chkconfig openstack-cinder-$service on
done

Starting openstack-cinder-api: [ OK ]
Starting openstack-cinder-scheduler: [ OK ]
# 動作確認

[root@dlp ~(keystone)]#
cinder-manage service list

Binary           Host          Zone             Status     State Updated At
cinder-scheduler dlp           nova             enabled    :-)   2014-06-26 08:32:06

※ cinder-manage コマンド実行時、下記の脆弱性に関する警告が出るが、動作そのものには影響ない
/usr/lib64/python2.6/site-packages/Crypto/Util/number.py:57:
PowmInsecureWarning: Not using mpz_powm_sec.
You should rebuild using libgmp >= 5 to avoid timing attack vulnerability.
_warn("Not using mpz_powm_sec. You should rebuild using libgmp >= 5
to avoid timing attack vulnerability.", PowmInsecureWarning)
 
Tweet