30cec57089
Closes-Bug: 1195352 Change-Id: I79efd588b403a182b244d4d2d60d8bf0da8c457d
114 lines
6.0 KiB
XML
114 lines
6.0 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<section xml:id="cinder-install"
|
|
xmlns="http://docbook.org/ns/docbook"
|
|
xmlns:xi="http://www.w3.org/2001/XInclude"
|
|
xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
version="5.0">
|
|
<title>Installing and configuring Block Storage (Cinder)</title>
|
|
<para>Install the packages for OpenStack Block Storage (Cinder) on the cloud
|
|
controller.</para>
|
|
<screen os="ubuntu"><prompt>$</prompt> <userinput>sudo apt-get install cinder-api \
|
|
cinder-scheduler cinder-volume open-iscsi python-cinderclient tgt</userinput></screen>
|
|
<screen os="rhel;centos;fedora"><prompt>$</prompt> <userinput>sudo yum install openstack-cinder openstack-cinder-doc \
|
|
iscsi-initiator-utils scsi-target-utils</userinput></screen>
|
|
<screen os="opensuse"><prompt>$</prompt> <userinput>sudo zypper install openstack-cinder openstack-cinder-doc \
|
|
open-iscsi tgt</userinput></screen>
|
|
<note><para>If you are using XenServer type vhd images, you will also need the <command>vhd-util</command>
|
|
binary to be able to create volumes from uploaded images.</para>
|
|
<para>This could be installed by:</para>
|
|
<screen os="ubuntu"><prompt>$</prompt> <userinput>sudo apt-get install blktap-utils</userinput></screen>
|
|
<screen os="opensuse"><prompt>$</prompt> <userinput>sudo zypper in xen-tools</userinput></screen>
|
|
<screen os="rhel;centos;fedora"><prompt>$</prompt> <userinput>sudo yum install blktap</userinput></screen>
|
|
</note>
|
|
|
|
<para>Edit <filename>/etc/cinder/api-paste.ini</filename> (filter
|
|
authtoken).<programlisting>[filter:authtoken]
|
|
paste.filter_factory = keystoneclient.middleware.auth_token:filter_factory
|
|
service_protocol = http
|
|
service_host = 192.168.206.130
|
|
service_port = 5000
|
|
auth_host = 192.168.206.130
|
|
auth_port = 35357
|
|
auth_protocol = http
|
|
admin_tenant_name = service
|
|
admin_user = cinder
|
|
admin_password = openstack</programlisting></para>
|
|
<para>Edit <filename>/etc/cinder/cinder.conf</filename> to reflect your settings.</para>
|
|
<programlisting>
|
|
[DEFAULT]
|
|
rootwrap_config=/etc/cinder/rootwrap.conf
|
|
sql_connection = mysql://cinder:openstack@localhost/cinder
|
|
api_paste_config = /etc/cinder/api-paste.ini
|
|
|
|
iscsi_helper=tgtadm
|
|
volume_name_template = volume-%s
|
|
volume_group = cinder-volumes
|
|
verbose = True
|
|
auth_strategy = keystone
|
|
#osapi_volume_listen_port=5900</programlisting>
|
|
<para>Configure messaging also in <filename>/etc/cinder/cinder.conf</filename>.</para>
|
|
<programlisting os="ubuntu">
|
|
rabbit_host = 10.10.10.10
|
|
rabbit_port = 5672
|
|
# Change the following settings if you're not using the default RabbitMQ configuration
|
|
#rabbit_userid = rabbit
|
|
#rabbit_password = secure_password
|
|
#rabbit_virtual_host = /nova</programlisting>
|
|
<programlisting os="rhel;centos;fedora">
|
|
qpid_hostname=192.168.206.130</programlisting>
|
|
<programlisting os="opensuse">
|
|
rabbit_host = 10.10.10.10
|
|
rabbit_port = 5672
|
|
# Change the following settings if you're not using the default RabbitMQ configuration
|
|
#rabbit_userid = rabbit
|
|
#rabbit_password = secure_password
|
|
#rabbit_virtual_host = /nova</programlisting>
|
|
<para>Verify entries in <filename>/etc/nova/nova.conf</filename>. The
|
|
<literal>volume_api_class</literal> setting is the default setting since
|
|
grizzly.</para>
|
|
<programlisting>volume_api_class=nova.volume.cinder.API</programlisting>
|
|
<para>Set up the cinder database.</para>
|
|
<programlisting>CREATE DATABASE cinder;
|
|
GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'localhost' \
|
|
IDENTIFIED BY 'password';
|
|
FLUSH PRIVILEGES;</programlisting>
|
|
<para>Add a filter entry to the devices section
|
|
<filename>/etc/lvm/lvm.conf</filename> to keep LVM from scanning devices
|
|
used by virtual machines.</para>
|
|
<note><para>You must add every physical volume that is
|
|
needed for LVM on the Cinder host. You can get a list by running
|
|
<command>pvdisplay</command>.</para></note>
|
|
<para>Each item in the filter array starts with either an
|
|
"<literal>a</literal>" for accept, or an "<literal>r</literal>" for reject.
|
|
Physical volumes that are needed on the Cinder host begin with
|
|
"<literal>a</literal>". The array must end with
|
|
"<literal>r/.*/</literal>"</para>
|
|
<programlisting>devices {
|
|
...
|
|
filter = [ "a/sda1/", "a/sdb1/", "r/.*/"]
|
|
...
|
|
}</programlisting>
|
|
<para>Set up the target file.</para>
|
|
<note><para><literal>$state_path=/var/lib/cinder/</literal> and
|
|
<literal>$volumes_dir=$state_path/volumes</literal> are the
|
|
default values used by the Block Storage service.
|
|
<emphasis>These directories MUST exist!</emphasis></para></note>
|
|
<screen><prompt>$</prompt> <userinput>sudo sh -c "echo 'include /var/lib/cinder/volumes/*' >> /etc/tgt/targets.conf"</userinput></screen>
|
|
<para>Restart the <command>tgt</command> service.
|
|
<screen><prompt>$</prompt> <userinput>sudo restart tgt</userinput></screen></para>
|
|
<para>Populate the database.
|
|
<screen><prompt>$</prompt> <userinput>sudo cinder-manage db sync</userinput></screen></para>
|
|
<para>Restart the services.
|
|
<screen><prompt>$</prompt> <userinput>sudo service cinder-volume restart</userinput>
|
|
<prompt>$</prompt> <userinput>sudo service cinder-api restart</userinput>
|
|
<prompt>$</prompt> <userinput>sudo service cinder-scheduler restart</userinput></screen></para>
|
|
<para>Create a 1 GB test volume.
|
|
<screen><prompt>$</prompt> <userinput>cinder create --display_name test 1</userinput>
|
|
<prompt>$</prompt> <userinput>cinder list</userinput></screen></para>
|
|
<programlisting>+--------------------------------------+-----------+--------------+------+-------------+-------------+
|
|
| ID | Status | Display Name | Size | Volume Type | Attached to |
|
|
+--------------------------------------+-----------+--------------+------+-------------+-------------+
|
|
| 5bbad3f9-50ad-42c5-b58c-9b6b63ef3532 | available | test | 1 | None | |
|
|
+--------------------------------------+-----------+--------------+------+-------------+-------------+</programlisting>
|
|
</section>
|