From ed8fd1c397c6f0360c07e39aea9fe0a073d4f4e1 Mon Sep 17 00:00:00 2001 From: Gauvain Pocentek Date: Tue, 19 Nov 2013 20:32:38 +0100 Subject: [PATCH] Install Guide: add a chapter about client commands This new chapter is taken from the common/ section, and explains how to install clients on machines outside the OpenStack cluster. The install guide can be misleading about how to use clients to administrate the cloud, adding this section will hopefully help clarifying this. pom.xml is modified to add an audience target (installer), used to build specific parts of the common files. backport: none Change-Id: Ib4187d86bb2e3d7d9a26df426e17b4f4039a90fa --- doc/common/section_cli_openrc.xml | 182 ++++++++++-------- doc/common/section_cli_overview.xml | 20 +- .../bk_openstackinstallguide.xml | 1 + doc/install-guide/ch_clients.xml | 10 + doc/install-guide/pom.xml | 1 + doc/install-guide/section_keystone-verify.xml | 151 ++++++++------- doc/install-guide/section_nova-network.xml | 2 +- doc/pom.xml | 2 +- doc/training-guides/pom.xml | 1 + tools/test.py | 3 +- 10 files changed, 204 insertions(+), 169 deletions(-) create mode 100644 doc/install-guide/ch_clients.xml diff --git a/doc/common/section_cli_openrc.xml b/doc/common/section_cli_openrc.xml index 26194f9e8e..6f53b339d3 100644 --- a/doc/common/section_cli_openrc.xml +++ b/doc/common/section_cli_openrc.xml @@ -2,96 +2,110 @@
- - Create and source the OpenStack RC file + xml:id="cli_openrc"> + + The OpenStack RC file To set the required environment variables for the OpenStack - command-line clients, you must either create or download an - environment file, and source it. It is project-specific and - contains the credentials used by all OpenStack - services. + command-line clients, you must create an environment + file. If your OpenStack + installation provides it, you can download the file from + the OpenStack dashboard as an administrative user or any + other user. This project-specific environment + file contains the credentials that all OpenStack services + use. When you source the file, environment variables are set for - your current shell. They allow the commands to communicate to - the OpenStack services that run in the cloud. - If your OpenStack installation provides it, you can download - the file from the OpenStack dashboard as an administrative - user or any other user. - - - Log in to the OpenStack dashboard, choose the - project for which you want to download the OpenStack - RC file, and click Access & - Security. - - - Click Download OpenStack RC - File and save the file. - - - Copy the openrc.sh file to the - machine from where you want to run OpenStack - commands. - For example, copy the file to the machine from where - you want to upload an image with a glance client - command. - - - On any shell from where you want to run OpenStack - commands, source the openrc.sh - file for the respective project. - In this example, you source the - demo-openrc.sh file for the - demo project: - $ source demo-openrc.sh - - - When you are prompted for an OpenStack password, - enter the password for the user who downloaded the - openrc.sh file. - - - When you run OpenStack client commands, you can - override some environment variable settings by using - the options that are listed at the end of the - nova help output. For example, - you can override the OS_PASSWORD - setting in the openrc.sh file by - specifying a password on a nova command, as - follows: - $ nova --password <password> image-list - Where password is your - password. - - - Alternatively, you can create the - openrc.sh file from scratch. - - - Create the openrc.sh file - and add the authentication information: - export OS_USERNAME=USERNAME + your current shell. The variables enable the OpenStack client + commands to communicate with the OpenStack services that run + in the cloud. +
+ Download and source the OpenStack RC file + + + Log in to the OpenStack dashboard, choose the + project for which you want to download the + OpenStack RC file, and click Access + & Security. + + + Click Download OpenStack RC + File and save the file. + + + Copy the openrc.sh file to + the machine from where you want to run OpenStack + commands. + For example, copy the file to the machine from + where you want to upload an image with a glance + client command. + + + On any shell from where you want to run + OpenStack commands, source the + openrc.sh file for the + respective project. + In this example, you source the + demo-openrc.sh file for + the demo project: + $ source demo-openrc.sh + + + When you are prompted for an OpenStack password, + enter the password for the user who downloaded the + openrc.sh file. + + +
+
+ Create and source the OpenStack RC file + Alternatively, you can create the + openrc.sh file from + scratch. + + + Create the openrc.sh file + and add the authentication information: + export OS_USERNAME=USERNAME export OS_PASSWORD=PASSWORD export OS_TENANT_NAME=PROJECT_NAME export OS_AUTH_URL=https://IDENTITY_HOST:PORT/v2.0 # The following lines can be omitted export OS_TENANT_ID=9d792532ffce494583138c495801d164 export OS_REGION_NAME=RegionOne - - - On any shell from where you want to run OpenStack - commands, source the openrc.sh - file for the respective project. - $ source openrc.sh - - - - You are not prompted for the password with this method. - The password lives in clear text format in the - openrc.sh file. Restrict the - permissions on this file to avoid security problems. You - can also remove the OS_PASSWORD - variable from the file, and use the - --password parameter with - OpenStack client commands. - + export OS_USERNAME=admin +export OS_PASSWORD=ADMIN_PASS +export OS_TENANT_NAME=admin +export OS_AUTH_URL=http://controller:35357/v2.0 + + + On any shell from where you want to run + OpenStack commands, source the + openrc.sh file for the + respective project: + $ source openrc.sh + + + + You are not prompted for the password with this + method. The password lives in clear text format in the + openrc.sh file. Restrict the + permissions on this file to avoid security problems. + You can also remove the OS_PASSWORD + variable from the file, and use the + --password parameter with + OpenStack client commands. + +
+
+ Override environment variable values + When you run OpenStack client commands, you can override + some environment variable settings by using the options + that are listed at the end of the nova + help output. For example, you can override + the setting in the + openrc.sh file by specifying a + password on a nova command, as follows: + $ nova --password <password> image-list + Where password is your + password. +
diff --git a/doc/common/section_cli_overview.xml b/doc/common/section_cli_overview.xml index fa5240420c..d55183f4b3 100644 --- a/doc/common/section_cli_overview.xml +++ b/doc/common/section_cli_overview.xml @@ -13,11 +13,14 @@ xml:id="section_cli_overview"> Overview You can use the OpenStack command-line clients to run simple - commands that make API calls. You can use these commands in - scripts to automate tasks. Internally, each client command - runs cURL commands that embed API requests. The OpenStack APIs - are RESTful APIs that use the HTTP protocol, including - methods, URIs, media types, and response codes. + commands that make API calls. You can run these commands from + the command line or in scripts to automate tasks. As long as + you provide OpenStack credentials, you can run these commands + on any machine. + Internally, each client command runs cURL commands that + embed API requests. The OpenStack APIs are RESTful APIs that + use the HTTP protocol, including methods, URIs, media types, + and response codes. These open-source Python clients run on Linux or Mac OS X systems and are easy to learn and use. Each OpenStack service has its own command-line client. On some client commands, you @@ -88,9 +91,10 @@ ad hoc processing. - An OpenStack common client is in development. - For client installation instructions, see - An OpenStack common client is in + development. + For client installation instructions, + see Install the OpenStack command-line clients. For information about the OpenStack RC file, see + diff --git a/doc/install-guide/ch_clients.xml b/doc/install-guide/ch_clients.xml new file mode 100644 index 0000000000..fe324a2c28 --- /dev/null +++ b/doc/install-guide/ch_clients.xml @@ -0,0 +1,10 @@ + + + Install and configure the OpenStack clients + + + + diff --git a/doc/install-guide/pom.xml b/doc/install-guide/pom.xml index c5bc07a1f6..04f68ba58b 100644 --- a/doc/install-guide/pom.xml +++ b/doc/install-guide/pom.xml @@ -85,6 +85,7 @@ + installer true . diff --git a/doc/install-guide/section_keystone-verify.xml b/doc/install-guide/section_keystone-verify.xml index 67147f4784..40336149c3 100644 --- a/doc/install-guide/section_keystone-verify.xml +++ b/doc/install-guide/section_keystone-verify.xml @@ -1,85 +1,88 @@
- + 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"> Verify the Identity Service installation - - To verify the Identity Service is installed and configured - correctly, first unset the OS_SERVICE_TOKEN and - OS_SERVICE_ENDPOINT environment variables. These - were only used to bootstrap the administrative user and register - the Identity Service. - - # unset OS_SERVICE_TOKEN OS_SERVICE_ENDPOINT - - You can now use regular username-based authentication. - Request an authentication token using the admin - user and the password you chose during the earlier administrative - user-creation step. - - - See for further details. - - - See for further details. - - - # keystone --os-username=admin --os-password=ADMIN_PASS \ + + + To verify that the Identity Service is installed and + configured correctly, clear the values in the + OS_SERVICE_TOKEN and + OS_SERVICE_ENDPOINT environment + variables: + # unset OS_SERVICE_TOKEN OS_SERVICE_ENDPOINT + These variables, which were used to bootstrap the + administrative user and register the Identity Service, are no + longer needed. + + + You can now use regular user name-based + authentication. + Request a authentication token by using the + admin user and the password you chose for + that user: + # keystone --os-username=admin --os-password=ADMIN_PASS \ --os-auth-url=http://controller:35357/v2.0 token-get - - You should receive a token in response, paired with your user ID. - This verifies that keystone is running on the expected endpoint, and - that your user account is established with the expected credentials. - - Next, verify that authorization is behaving as expected by requesting - authorization on a tenant. - - # keystone --os-username=admin --os-password=ADMIN_PASS \ - --os-tenant-name=admin --os-auth-url=http://controller:35357/v2.0 token-get - - You should receive a new token in response, this time including the - ID of the tenant you specified. This verifies that your user account has - an explicitly defined role on the specified tenant, and that the tenant - exists as expected. - - You can also set your --os-* variables in your - environment to simplify command-line usage. Set up a - keystonerc file with the admin credentials and - admin endpoint. - - export OS_USERNAME=admin + In response, you receive a token paired with your user ID. + This verifies that the Identity Service is running on the + expected endpoint and that your user account is established + with the expected credentials. + + + Verify that authorization behaves as expected. To do so, + request authorization on a tenant: + # keystone --os-username=admin --os-password=ADMIN_PASS \ + --os-tenant-name=admin --os-auth-url=http://controller:35357/v2.0 token-get + In response, you receive a token that includes the ID of + the tenant that you specified. This verifies that your user + account has an explicitly defined role on the specified tenant + and the tenant exists as expected. + + + You can also set your --os-* variables + in your environment to simplify command-line usage. Set up a + openrc.sh file with the admin + credentials and admin endpoint: + export OS_USERNAME=admin export OS_PASSWORD=ADMIN_PASS export OS_TENANT_NAME=admin export OS_AUTH_URL=http://controller:35357/v2.0 - - You can source this file to read in the environment variables. - - # source keystonerc - - Verify that your keystonerc is configured - correctly by performing the same command as above, but without the - --os-* arguments. - - $ keystone token-get - - The command returns a token and the ID of the specified tenant. - This verifies that you have configured your environment variables - correctly. - - Finally, verify that your admin account has authorization to - perform administrative commands. - - # keystone user-list - -+----------------------------------+---------+--------------------+--------+ + + + Source this file to read in the environment + variables: + # source openrc.sh + + + Verify that your openrc.sh file is + configured correctly. Run the same command without the + --os-* arguments: + $ keystone token-get + The command returns a token and the ID of the specified + tenant. This verifies that you have configured your + environment variables correctly. + + + Verify that your admin account has authorization to + perform administrative commands: + # keystone user-list + +----------------------------------+---------+--------------------+--------+ | id | enabled | email | name | +----------------------------------+---------+--------------------+--------+ | a4c2d43f80a549a19864c89d759bb3fe | True | admin@example.com | admin | - - - This verifies that your user account has the - admin role, which matches the role used in - the Identity Service policy.json file. ++----------------------------------+---------+--------------------+--------+ + This verifies that your user account has the + admin role, which matches the role used + in the Identity Service policy.json + file. + + As long as you define your credentials and the Identity + Service endpoint through the command line or environment + variables, you can run all OpenStack client commands from + any machine. For details, see . + + +
diff --git a/doc/install-guide/section_nova-network.xml b/doc/install-guide/section_nova-network.xml index 0789713968..7cb76c8b75 100644 --- a/doc/install-guide/section_nova-network.xml +++ b/doc/install-guide/section_nova-network.xml @@ -87,7 +87,7 @@ public_interface=eth1 Create a network that virtual machines can use. Do this once for the entire installation and not on each compute node. Run the nova network-create command on the controller: - # source keystonerc + # source openrc.sh # nova network-create vmnet --fixed-range-v4=10.0.0.0/24 \ --bridge-interface=br100 --multi-host=T diff --git a/doc/pom.xml b/doc/pom.xml index d188726724..229d0d6311 100644 --- a/doc/pom.xml +++ b/doc/pom.xml @@ -16,7 +16,7 @@ image-guide install-guide security-guide - training-guide + training-guides user-guide user-guide-admin diff --git a/doc/training-guides/pom.xml b/doc/training-guides/pom.xml index acbb39ab11..081c843240 100644 --- a/doc/training-guides/pom.xml +++ b/doc/training-guides/pom.xml @@ -1,3 +1,4 @@ + diff --git a/tools/test.py b/tools/test.py index cec2067c8c..3999fbe09a 100755 --- a/tools/test.py +++ b/tools/test.py @@ -50,7 +50,8 @@ KNOWN_OS_VALUES = ["debian", # List of recognized (allowable) audience profiling directives. KNOWN_AUDIENCE_VALUES = ["enduser", - "adminuser"] + "adminuser", + "installer"] # NOTE(berendt): check_output as provided in Python 2.7.5 to make script