From 256641230d014747fe622dddf3e47f5e5d062e92 Mon Sep 17 00:00:00 2001
From: chenxing <chason.chan@foxmail.com>
Date: Tue, 26 Jun 2018 03:38:08 -0400
Subject: [PATCH] Update install guide for placement database configuration

Change-Id: I295fe539321bcce3449b522d54121985577c4b35
Partial-Bug: #1778227
---
 doc/source/install/controller-install-obs.rst | 23 ++++++++++++++-----
 doc/source/install/controller-install-rdo.rst | 22 +++++++++++++-----
 .../install/controller-install-ubuntu.rst     | 21 +++++++++++++----
 3 files changed, 49 insertions(+), 17 deletions(-)

diff --git a/doc/source/install/controller-install-obs.rst b/doc/source/install/controller-install-obs.rst
index 9ced92acc..a4bc3bd5c 100644
--- a/doc/source/install/controller-install-obs.rst
+++ b/doc/source/install/controller-install-obs.rst
@@ -19,13 +19,15 @@ databases, service credentials, and API endpoints.
 
         $ mysql -u root -p
 
-   * Create the ``nova_api``, ``nova``, and ``nova_cell0`` databases:
+   * Create the ``nova_api``, ``nova``, ``nova_cell0``, and ``placement``
+     databases:
 
      .. code-block:: console
 
         MariaDB [(none)]> CREATE DATABASE nova_api;
         MariaDB [(none)]> CREATE DATABASE nova;
         MariaDB [(none)]> CREATE DATABASE nova_cell0;
+        MariaDB [(none)]> CREATE DATABASE placement;
 
    * Grant proper access to the databases:
 
@@ -46,7 +48,12 @@ databases, service credentials, and API endpoints.
         MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova_cell0.* TO 'nova'@'%' \
           IDENTIFIED BY 'NOVA_DBPASS';
 
-     Replace ``NOVA_DBPASS`` with a suitable password.
+        MariaDB [(none)]> GRANT ALL PRIVILEGES ON placement.* TO 'placement'@'localhost' \
+          IDENTIFIED BY 'PLACEMENT_DBPASS';
+        MariaDB [(none)]> GRANT ALL PRIVILEGES ON placement.* TO 'placement'@'%' \
+          IDENTIFIED BY 'PLACEMENT_DBPASS';
+
+     Replace ``NOVA_DBPASS`` and ``PLACEMENT_DBPASS`` with a suitable password.
 
    * Exit the database access client.
 
@@ -293,8 +300,8 @@ Install and configure components
         # ...
         enabled_apis = osapi_compute,metadata
 
-   * In the ``[api_database]`` and ``[database]`` sections, configure database
-     access:
+   * In the ``[api_database]``, ``[database]``, and ``[placement_database]``
+     sections, configure database access:
 
      .. path /etc/nova/nova.conf
      .. code-block:: ini
@@ -307,8 +314,12 @@ Install and configure components
         # ...
         connection = mysql+pymysql://nova:NOVA_DBPASS@controller/nova
 
+        [placement_database]
+        # ...
+        connection = mysql+pymysql://placement:PLACEMENT_DBPASS@controller/placement
+
      Replace ``NOVA_DBPASS`` with the password you chose for the Compute
-     databases.
+     databases and ``PLACEMENT_DBPASS`` for Placement database.
 
    * In the ``[DEFAULT]`` section, configure ``RabbitMQ`` message queue access:
 
@@ -434,7 +445,7 @@ Install and configure components
       ``placement`` user in the Identity service. Comment out any other options
       in the ``[placement]`` section.
 
-#. Populate the ``nova-api`` database:
+#. Populate the ``nova-api`` and ``placement`` databases:
 
    .. code-block:: console
 
diff --git a/doc/source/install/controller-install-rdo.rst b/doc/source/install/controller-install-rdo.rst
index b3217ea4a..a69deb4da 100644
--- a/doc/source/install/controller-install-rdo.rst
+++ b/doc/source/install/controller-install-rdo.rst
@@ -19,13 +19,14 @@ databases, service credentials, and API endpoints.
 
         $ mysql -u root -p
 
-   * Create the ``nova_api``, ``nova``, and ``nova_cell0`` databases:
+   * Create the ``nova_api``, ``nova``, ``nova_cell0``, and ``placement`` databases:
 
      .. code-block:: console
 
         MariaDB [(none)]> CREATE DATABASE nova_api;
         MariaDB [(none)]> CREATE DATABASE nova;
         MariaDB [(none)]> CREATE DATABASE nova_cell0;
+        MariaDB [(none)]> CREATE DATABASE placement;
 
    * Grant proper access to the databases:
 
@@ -46,7 +47,12 @@ databases, service credentials, and API endpoints.
         MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova_cell0.* TO 'nova'@'%' \
           IDENTIFIED BY 'NOVA_DBPASS';
 
-     Replace ``NOVA_DBPASS`` with a suitable password.
+        MariaDB [(none)]> GRANT ALL PRIVILEGES ON placement.* TO 'placement'@'localhost' \
+          IDENTIFIED BY 'PLACEMENT_DBPASS';
+        MariaDB [(none)]> GRANT ALL PRIVILEGES ON placement.* TO 'placement'@'%' \
+          IDENTIFIED BY 'PLACEMENT_DBPASS';
+
+     Replace ``NOVA_DBPASS`` and ``PLACEMENT_DBPASS`` with a suitable password.
 
    * Exit the database access client.
 
@@ -284,8 +290,8 @@ Install and configure components
         # ...
         enabled_apis = osapi_compute,metadata
 
-   * In the ``[api_database]`` and ``[database]`` sections, configure database
-     access:
+   * In the ``[api_database]``, ``[database]``, and ``[placement_database]``
+     sections, configure database access:
 
      .. path /etc/nova/nova.conf
      .. code-block:: ini
@@ -298,8 +304,12 @@ Install and configure components
         # ...
         connection = mysql+pymysql://nova:NOVA_DBPASS@controller/nova
 
+        [placement_database]
+        # ...
+        connection = mysql+pymysql://placement:PLACEMENT_DBPASS@controller/placement
+
      Replace ``NOVA_DBPASS`` with the password you chose for the Compute
-     databases.
+     databases and ``PLACEMENT_DBPASS`` for Placement database.
 
    * In the ``[DEFAULT]`` section, configure ``RabbitMQ`` message queue access:
 
@@ -448,7 +458,7 @@ Install and configure components
 
         # systemctl restart httpd
 
-#. Populate the ``nova-api`` database:
+#. Populate the ``nova-api`` and ``placement`` databases:
 
    .. code-block:: console
 
diff --git a/doc/source/install/controller-install-ubuntu.rst b/doc/source/install/controller-install-ubuntu.rst
index c97d9d8ad..a8f7b03c9 100644
--- a/doc/source/install/controller-install-ubuntu.rst
+++ b/doc/source/install/controller-install-ubuntu.rst
@@ -19,13 +19,15 @@ databases, service credentials, and API endpoints.
 
         # mysql
 
-   * Create the ``nova_api``, ``nova``, and ``nova_cell0`` databases:
+   * Create the ``nova_api``, ``nova``, ``nova_cell0``, and ``placement``
+     databases:
 
      .. code-block:: console
 
         MariaDB [(none)]> CREATE DATABASE nova_api;
         MariaDB [(none)]> CREATE DATABASE nova;
         MariaDB [(none)]> CREATE DATABASE nova_cell0;
+        MariaDB [(none)]> CREATE DATABASE placement;
 
    * Grant proper access to the databases:
 
@@ -46,6 +48,11 @@ databases, service credentials, and API endpoints.
         MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova_cell0.* TO 'nova'@'%' \
           IDENTIFIED BY 'NOVA_DBPASS';
 
+        MariaDB [(none)]> GRANT ALL PRIVILEGES ON placement.* TO 'placement'@'localhost' \
+          IDENTIFIED BY 'PLACEMENT_DBPASS';
+        MariaDB [(none)]> GRANT ALL PRIVILEGES ON placement.* TO 'placement'@'%' \
+          IDENTIFIED BY 'PLACEMENT_DBPASS';
+
      Replace ``NOVA_DBPASS`` with a suitable password.
 
    * Exit the database access client.
@@ -274,8 +281,8 @@ Install and configure components
 
 #. Edit the ``/etc/nova/nova.conf`` file and complete the following actions:
 
-   * In the ``[api_database]`` and ``[database]`` sections, configure database
-     access:
+   * In the ``[api_database]``, ``[database]``, and ``[placement_database]``
+     sections, configure database access:
 
      .. path /etc/nova/nova.conf
      .. code-block:: ini
@@ -288,8 +295,12 @@ Install and configure components
         # ...
         connection = mysql+pymysql://nova:NOVA_DBPASS@controller/nova
 
+        [placement_database]
+        # ...
+        connection = mysql+pymysql://placement:PLACEMENT_DBPASS@controller/placement
+
      Replace ``NOVA_DBPASS`` with the password you chose for the Compute
-     databases.
+     databases and ``PLACEMENT_DBPASS`` for Placement database.
 
    * In the ``[DEFAULT]`` section, configure ``RabbitMQ`` message queue access:
 
@@ -418,7 +429,7 @@ Install and configure components
       ``placement`` user in the Identity service. Comment out any other options
       in the ``[placement]`` section.
 
-#. Populate the nova-api database:
+#. Populate the ``nova-api`` and ``placement`` databases:
 
    .. code-block:: console