Ubuntu 12.04
Sponsored Link

OpenStack Havana - Cinder 設定2013/12/04

 
OpenStack Block Storage(Cinder)をインストールします。
[1] Cinder インストール
# 事前にOpenStack Havana 用リポジトリを登録しておく

root@dlp ~(keystone)#
aptitude -y install cinder-api cinder-scheduler cinder-volume
[2] Cinder 用のユーザー等々を Keystone に登録しておく
# cinder ユーザー作成 (service テナント所属)

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

+----------+----------------------------------+
| Property |              Value               |
+----------+----------------------------------+
|  email   |                                  |
| enabled  |               True               |
|    id    | 7d424f527d864167a45777e42859a01f |
|   name   |              cinder              |
| tenantId | fdc25c122e29459eb75164c103562256 |
+----------+----------------------------------+

# 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          |
|      id     | ed8fd738f10142d2957f1c860e6b6db8 |
|     name    |              cinder              |
|     type    |              volume              |
+-------------+----------------------------------+

# 自ホスト定義

root@dlp ~(keystone)#
export my_host=10.0.0.30
# cinder 用エンドポイント作成

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

+-------------+----------------------------------------+
|   Property  |                 Value                  |
+-------------+----------------------------------------+
|   adminurl  | http://10.0.0.30:8776/v1/$(tenant_id)s |
|      id     |    fdefe590c5ef483fadc08c2c4873275c    |
| 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 |    ed8fd738f10142d2957f1c860e6b6db8    |
+-------------+----------------------------------------+

[3] Cinder 用のユーザーとデータベースを MySQL に登録しておく
root@dlp ~(keystone)#
mysql -u root -p

Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 37
Server version: 5.5.34-0ubuntu0.12.04.1 (Ubuntu)

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@'%' 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
[4] Cinder の基本設定
root@dlp ~(keystone)#
vi /etc/cinder/cinder.conf
# 最終行に追記

osapi_volume_listen = 0.0.0.0
osapi_volume_listen_port = 8776
# Glance サーバーを指定

glance_host = 10.0.0.30
glance_port = 9292
# iscsi サーバーを指定

iscsi_ip_address = 10.0.0.30
iscsi_port = 3260
# MySQL の認証情報

sql_connection = mysql://cinder:password@10.0.0.30/cinder
rpc_backend = cinder.openstack.common.rpc.impl_kombu
# RabbitMQ サーバーを指定

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

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

rabbit_password = password
root@dlp ~(keystone)#
vi /etc/cinder/api-paste.ini
# 51行目:変更 (Keystone の認証情報)

[filter:authtoken]
paste.filter_factory = keystoneclient.middleware.auth_token:filter_factory
auth_host =
10.0.0.30

auth_port = 35357
auth_protocol = http
admin_tenant_name =
service

admin_user =
cinder

admin_password =
servicepassword

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

root@dlp ~(keystone)#
sed -i '1iinclude /var/lib/cinder/volumes/*' /etc/tgt/targets.conf

root@dlp ~(keystone)#
service tgt restart

tgt stop/waiting
tgt start/running, process 4790
root@dlp ~(keystone)#
for service in api scheduler volume; do
service cinder-$service restart
done

cinder-api stop/waiting
cinder-api start/running, process 2464
cinder-scheduler stop/waiting
cinder-scheduler start/running, process 2474
cinder-volume stop/waiting
cinder-volume start/running, process 2484
関連コンテンツ