From e9bde9eefd6a90b8f5a271a41a94315923283fc4 Mon Sep 17 00:00:00 2001 From: Tom Fifield Date: Wed, 2 Apr 2014 11:40:56 +0800 Subject: [PATCH] Change cinder install to use keystone_authtoken We should no longer edit api-paste.ini, instead we should follow the same keystone_authtoken section edits. Change-Id: Ic8d21108c5f91179b33a4275985f04d5444eee29 --- .../section_cinder-controller.xml | 155 +++++++++-------- doc/install-guide/section_cinder-node.xml | 163 ++++++++++-------- 2 files changed, 168 insertions(+), 150 deletions(-) diff --git a/doc/install-guide/section_cinder-controller.xml b/doc/install-guide/section_cinder-controller.xml index 6b5128d62d..0b4b32eecb 100644 --- a/doc/install-guide/section_cinder-controller.xml +++ b/doc/install-guide/section_cinder-controller.xml @@ -4,16 +4,17 @@ xml:id="cinder-controller"> Configure a Block Storage service controller - This section describes how to configure OpenStack Block Storage + This scenario configures OpenStack Block Storage services on the Controller node and assumes that a second node provides storage through the cinder-volume service. For + class="service">cinder-volume service. + For instructions on how to configure the second node, see . You can configure OpenStack to use various storage systems. - The examples in this guide show you how to configure LVM. + This example uses LVM. Install the appropriate packages for the Block Storage @@ -23,32 +24,24 @@ # zypper install openstack-cinder-api openstack-cinder-scheduler - Respond to the prompts for database - management, [keystone_authtoken] settings, - RabbitMQ credentials - and API endpoint - registration. + Respond to the prompts for database + management, [keystone_authtoken] settings, RabbitMQ credentials and API endpoint registration. - Configure Block Storage to use your MySQL database. Edit the - /etc/cinder/cinder.conf file and add the - following key under the [database] section. - Replace CINDER_DBPASS with the password - for the Block Storage database that you will create in a later step. - - The /etc/cinder/cinder.conf - file packaged with some distributions does not include the - [database] section header. You must add this - section header to the end of the file before proceeding further. - + Configure Block Storage to use your database. + In the + /etc/cinder/cinder.conf file, add this key in the [database] section and replace CINDER_DBPASS with the password + for the Block Storage database that you will create in a later step: # openstack-config --set /etc/cinder/cinder.conf \ database connection mysql://cinder:CINDER_DBPASS@controller/cinder [database] ... connection = mysql://cinder:CINDER_DBPASS@controller/cinder - + In some distributions, the /etc/cinder/cinder.conf + file does not include the + [database] section header. You must add this + section header to the end of the file before you proceed. + To create the Block Storage service database and tables and a cinder database user, run the @@ -57,51 +50,67 @@ connection = mysql://cinder:CINDER_DBPASS@ Use the password that you set to log in as root to create - a cinder database. - $ mysql -u root -p -mysql> CREATE DATABASE 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'; + a cinder database: + # mysql -u root -p +mysql> CREATE DATABASE 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'; Create the database tables for the Block Storage - service. + service: # cinder-manage db sync - Create a cinder user. The Block Storage - service uses this user to authenticate with the Identity - service. Use the service tenant and give - the user the admin role. - $ keystone user-create --name=cinder --pass=CINDER_PASS --email=cinder@example.com -$ keystone user-role-add --user=cinder --tenant=service --role=admin + Create a cinder user. + The Block Storage service uses this user to authenticate + with the Identity service. + Use the service tenant and give the + user the admin role: + # keystone user-create --name=cinder --pass=CINDER_PASS --email=cinder@example.com +# keystone user-role-add --user=cinder --tenant=service --role=admin - - Add the credentials to the file - /etc/cinder/api-paste.ini. Open the - file in a text editor and locate the section - [filter:authtoken]. Set the following - options: - [filter:authtoken] -paste.filter_factory=keystoneclient.middleware.auth_token:filter_factory -auth_host=controller + + Edit the + /etc/cinder/cinder.conf configuration file: + # + openstack-config --set /etc/cinder/cinder.conf DEFAULT \ +auth_strategy keystone +# openstack-config --set /etc/cinder/cinder.conf keystone_authtoken \ +auth_uri http://controller:5000 +# openstack-config --set /etc/cinder/cinder.confkeystone_authtoken \ +auth_host controller +# openstack-config --set /etc/cinder/cinder.conf keystone_authtoken \ + auth_protocol http +# openstack-config --set /etc/cinder/cinder.conf keystone_authtoken \ +auth_port 35357 +# openstack-config --set /etc/cinder/cinder.conf keystone_authtoken \ +admin_user cinder +# openstack-config --set /etc/cinder/cinder.conf keystone_authtoken \ +admin_tenant_name service +# openstack-config --set /etc/cinder/cinder.conf keystone_authtoken \ +admin_password CINDER_PASS + Edit the + /etc/cinder/cinder.conf configuration + file and add this section for keystone credentials: + ... +[keystone_authtoken] +auth_uri = http://controller:5000 +auth_host = controller auth_port = 35357 auth_protocol = http -auth_uri = http://controller:5000 -admin_tenant_name=service -admin_user=cinder -admin_password=CINDER_PASS - +admin_tenant_name = service +admin_user = cinder +admin_password = CINDER_PASS Configure Block Storage to use the RabbitMQ message - broker by setting these configuration keys in the - [DEFAULT] configuration group of the - /etc/cinder/cinder.conf file. Replace - RABBIT_PASS with the password you - chose for RabbitMQ. + broker. + In the [DEFAULT] section in + the /etc/cinder/cinder.conf file, set + these configuration keys and replace + RABBIT_PASS with the password you + chose for RabbitMQ: [DEFAULT] ... rpc_backend = cinder.openstack.common.rpc.impl_kombu @@ -111,16 +120,18 @@ rabbit_userid = guest rabbit_password = RABBIT_PASS - Configure Block Storage to use the Qpid message broker. + Configure Block Storage to use the Qpid message + broker: # openstack-config --set /etc/cinder/cinder.conf \ DEFAULT rpc_backend cinder.openstack.common.rpc.impl_qpid # openstack-config --set /etc/cinder/cinder.conf \ DEFAULT qpid_hostname controller - Configure Block Storage to use the RabbitMQ message broker. - Replace RABBIT_PASS with the password - you chose for RabbitMQ. + Configure Block Storage to use the RabbitMQ message + broker. + Replace RABBIT_PASS with the + password you chose for RabbitMQ: # openstack-config --set /etc/cinder/cinder.conf \ DEFAULT rpc_backend cinder.openstack.common.rpc.impl_kombu # openstack-config --set /etc/cinder/cinder.conf \ @@ -130,39 +141,35 @@ rabbit_password = RABBIT_PASS # openstack-config --set /etc/cinder/cinder.conf \ DEFAULT rabbit_password RABBIT_PASS - Register the Block Storage service with the Identity - Service so that other OpenStack services can locate it. - Register the service and specify the endpoint using the - keystone command. - $ keystone service-create --name=cinder --type=volume \ - --description="OpenStack Block Storage" -$ keystone endpoint-create \ + service so that other OpenStack services can locate it: + $ keystone service-create --name=cinder --type=volume --description="OpenStack Block Storage" +$ keystone endpoint-create \ --service-id=$(keystone service-list | awk '/ volume / {print $2}') \ --publicurl=http://controller:8776/v1/%\(tenant_id\)s \ --internalurl=http://controller:8776/v1/%\(tenant_id\)s \ --adminurl=http://controller:8776/v1/%\(tenant_id\)s - Also register a service and endpoint for version 2 of the - Block Storage service API. - # keystone service-create --name=cinderv2 --type=volumev2 \ - --description="OpenStack Block Storage v2" -$ keystone endpoint-create \ + Register a service and endpoint for version 2 of the Block + Storage service API: + $ keystone service-create --name=cinderv2 --type=volumev2 --description="OpenStack Block Storage v2" +$ keystone endpoint-create \ --service-id=$(keystone service-list | awk '/ volumev2 / {print $2}') \ --publicurl=http://controller:8776/v2/%\(tenant_id\)s \ --internalurl=http://controller:8776/v2/%\(tenant_id\)s \ --adminurl=http://controller:8776/v2/%\(tenant_id\)s - Restart the cinder service with its new settings: + Restart the Block Storage services with the new + settings: # service cinder-scheduler restart # service cinder-api restart - Start the cinder services and configure them to start when - the system boots. + Start and configure the Block Storage services to start when + the system boots: # service openstack-cinder-api start # service openstack-cinder-scheduler start # chkconfig openstack-cinder-api on diff --git a/doc/install-guide/section_cinder-node.xml b/doc/install-guide/section_cinder-node.xml index 6ae506ecc4..0f4d51a3ba 100644 --- a/doc/install-guide/section_cinder-node.xml +++ b/doc/install-guide/section_cinder-node.xml @@ -8,7 +8,7 @@ configure a second system to be a Block Storage service node. This node contains the disk that serves volumes. You can configure OpenStack to use various storage systems. - The examples in this guide show you how to configure LVM. + This example uses LVM. Use the instructions in to @@ -28,43 +28,43 @@ - - Install the required LVM packages, if they are not already installed: - # apt-get install lvm2 - + Install the required LVM packages, if they are not already + installed: + # apt-get install lvm2 - Create the - LVM physical and logical volumes. This guide assumes a second - disk /dev/sdb that is used for this - purpose: + Create the LVM physical and logical volumes. This guide + assumes a second disk /dev/sdb that is used + for this purpose: # pvcreate /dev/sdb # vgcreate cinder-volumes /dev/sdb - Add a filter entry to the devices section - /etc/lvm/lvm.conf to keep LVM from - scanning devices used by virtual machines: + Add a filter entry to the devices + section in the /etc/lvm/lvm.conf file to + keep LVM from scanning devices used by virtual + machines: + devices { +... +filter = [ "a/sda1/", "a/sdb/", "r/.*/"] +... +} You must add required physical volumes for LVM on the Block Storage host. Run the pvdisplay command to get a list or required volumes. Each item in the filter array starts with either an - a for accept, or an - r for reject. The physical volumes that - are required on the Block Storage host have names that begin - with a. The array must end with - "r/.*/" to reject any device not listed. + a for accept, or an r + for reject. The physical volumes that are required on the + Block Storage host have names that begin with + a. The array must end with + "r/.*/" to reject any device not + listed. In this example, /dev/sda1 is the volume where the volumes for the operating system for the node reside, while /dev/sdb is the volume reserved for cinder-volumes. - devices { -... -filter = [ "a/sda1/", "a/sdb/", "r/.*/"] -... -} After you configure the operating system, install the @@ -81,46 +81,60 @@ filter = [ "a/sda1/", "a/sdb/", "r/.*/"] >[keystone_authtoken] settings, and RabbitMQ credentials. Make sure to enter the same details as - your Block Storage service controller node. + you did for your Block Storage service controller node. Another screen prompts you for the volume-group to use. The Debian - package configuration script detects every active volume - group, provided that the lvm2 package is installed before Block Storage - (this should be the case if you configured the volume group first, - as this guide recommends), and tries to use the first one it - sees. If you have only one active volume group on your Block + package configuration script detects every active volume group + and tries to use the first one it sees, provided that the + lvm2 package was + installed before Block Storage. This should be the case if you + configured the volume group first, as this guide recommends. + If you have only one active volume group on your Block Storage service node, you do not need to manually enter its - name in when you install the cinder-volume package because it is detected automatically. If no volume-group is available when you install cinder-common, you - must manually configure or re-configure cinder-common by using - dpkg-reconfigure. + must use dpkg-reconfigure to manually + configure or re-configure cinder-common. - - Copy the /etc/cinder/api-paste.ini - file from the controller, or open the file in a text editor - and locate the section [filter:authtoken]. - Make sure the following options are set: - [filter:authtoken] -paste.filter_factory=keystoneclient.middleware.auth_token:filter_factory -auth_host=controller + + Copy the + /etc/cinder/cinder.conf configuration + file from the controller, or perform the following steps to + set the keystone credentials: + # openstack-config --set /etc/cinder/cinder.conf DEFAULT auth_strategy keystone +# openstack-config --set /etc/cinder/cinder.conf keystone_authtoken auth_uri http://controller:5000 +# openstack-config --set /etc/cinder/cinder.conf keystone_authtoken auth_host controller +# openstack-config --set /etc/cinder/cinder.conf keystone_authtoken auth_protocol http +# openstack-config --set /etc/cinder/cinder.conf keystone_authtoken auth_port 35357 +# openstack-config --set /etc/cinder/cinder.conf keystone_authtoken admin_user cinder +# openstack-config --set /etc/cinder/cinder.conf keystone_authtoken admin_tenant_name service +# openstack-config --set /etc/cinder/cinder.conf keystone_authtoken admin_password +CINDER_PASS + Edit the + /etc/cinder/cinder.conf configuration + file and add this section for keystone credentials: + ... +[keystone_authtoken] +auth_uri = http://controller:5000 +auth_host = controller auth_port = 35357 auth_protocol = http -admin_tenant_name=service -admin_user=cinder -admin_password=CINDER_PASS +admin_tenant_name = service +admin_user = cinder +admin_password = CINDER_PASS Configure Block Storage to use the RabbitMQ message - broker by setting these configuration keys in the - [DEFAULT] configuration group of the - /etc/cinder/cinder.conf file. Replace - RABBIT_PASS with the password you - chose for RabbitMQ. + broker. + In the [DEFAULT] configuration section + of the /etc/cinder/cinder.conf file, set + these configuration keys and replace + RABBIT_PASS with the password you + chose for RabbitMQ: [DEFAULT] ... rpc_backend = cinder.openstack.common.rpc.impl_kombu @@ -130,16 +144,17 @@ rabbit_userid = guest rabbit_password = RABBIT_PASS - Configure Block Storage to use the Qpid message broker. + Configure Block Storage to use the Qpid message + broker: # openstack-config --set /etc/cinder/cinder.conf \ DEFAULT rpc_backend cinder.openstack.common.rpc.impl_qpid # openstack-config --set /etc/cinder/cinder.conf \ DEFAULT qpid_hostname controller - Configure Block Storage to use the RabbitMQ message broker. - Replace RABBIT_PASS with the password - you chose for RabbitMQ. + Configure Block Storage to use the RabbitMQ message + broker. Replace RABBIT_PASS with + the password you chose for RabbitMQ: # openstack-config --set /etc/cinder/cinder.conf \ DEFAULT rpc_backend cinder.openstack.common.rpc.impl_kombu # openstack-config --set /etc/cinder/cinder.conf \ @@ -150,49 +165,45 @@ rabbit_password = RABBIT_PASS DEFAULT rabbit_password RABBIT_PASS - Configure Block Storage to use your MySQL database. Edit the - /etc/cinder/cinder.conf file and add the following - key under the [database] section. Replace - CINDER_DBPASS with the password you chose - for the Block Storage database. - The /etc/cinder/cinder.conf - file packaged with some distributions does not include the - [database] section header. You must add this - section header to the end of the file before proceeding further. - + Configure Block Storage to use your MySQL database. Edit + the /etc/cinder/cinder.conf file and add + the following key to the [database] + section. Replace CINDER_DBPASS with + the password you chose for the Block Storage database: # openstack-config --set /etc/cinder/cinder.conf \ database connection mysql://cinder:CINDER_DBPASS@controller/cinder [database] ... connection = mysql://cinder:CINDER_DBPASS@controller/cinder + + In some distributions, the + /etc/cinder/cinder.conf file does not + include the [database] section header. + You must add this section header to the end of the file + before you proceed. + - - - - Restart the cinder service with its new settings: + Restart the Block Storage services with the new + settings: # service cinder-volume restart # service tgt restart - - - Configure the iSCSI target service to discover cinder - volumes. Add the following line to the beginning of the - /etc/tgt/targets.conf file, if it is + Configure the iSCSI target service to discover Block + Storage volumes. Add the following line to the beginning of + the /etc/tgt/targets.conf file, if it is not already present: include /etc/cinder/volumes/* - - Start the cinder services and configure them to start when - the system boots: + Start and configure the Block Storage services to start + when the system boots: # service openstack-cinder-volume start # service tgtd start # chkconfig openstack-cinder-volume on # chkconfig tgtd on -