Ubuntu 12.04
Sponsored Link

OpenStack Havana - Configure Cinder
2013/12/04
 
Install and Configure OpenStack Block Storage (Cinder).
[1] Install Cinder

root@dlp ~(keystone)#
aptitude -y install cinder-api cinder-scheduler cinder-volume
[2] Add a user and so on for Cinder in Keystone
# add cinder user (in service tenant)

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 |
+----------+----------------------------------+

# add cinder user in admin role

root@dlp ~(keystone)#
keystone user-role-add --user cinder --tenant service --role admin
# add service entry for 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              |
+-------------+----------------------------------+

# define own host

root@dlp ~(keystone)#
export my_host=10.0.0.30
# add endpoint for 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] Add a user and DB for Cinder in 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.

# create a DB for cinder ( set any password for 'password' section )

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] Configure Cinder
root@dlp ~(keystone)#
vi /etc/cinder/cinder.conf
# add at the last

osapi_volume_listen = 0.0.0.0
osapi_volume_listen_port = 8776
# specify Glance server

glance_host = 10.0.0.30
glance_port = 9292
# specify iscsi server

iscsi_ip_address = 10.0.0.30
iscsi_port = 3260
# specify DB info in MySQL

sql_connection = mysql://cinder:password@10.0.0.30/cinder
rpc_backend = cinder.openstack.common.rpc.impl_kombu
# specify RabbitMQ server

rabbit_host = 10.0.0.30
rabbit_port = 5672
# specify a userID for RabbitMQ

rabbit_userid = guest
# specify the password of above

rabbit_password = password
root@dlp ~(keystone)#
vi /etc/cinder/api-paste.ini
# line 51: change : (auth info in 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
Matched Content