diff --git a/doc/common/get-started-compute.rst b/doc/common/get-started-compute.rst index 840cf5d2db..8d1817f595 100644 --- a/doc/common/get-started-compute.rst +++ b/doc/common/get-started-compute.rst @@ -44,6 +44,10 @@ OpenStack Compute consists of the following areas and their components: from the queue and performs a series of system commands such as launching a KVM instance and updating its state in the database. +``nova-placement-api`` service + Tracks the inventory and usage of each provider. For details, see + `Placement API `__. + ``nova-scheduler`` service Takes a virtual machine instance request from the queue and determines on which compute server host it runs. diff --git a/doc/install-guide/source/environment-security.rst b/doc/install-guide/source/environment-security.rst index 61d88e0c3b..6d8645e84e 100644 --- a/doc/install-guide/source/environment-security.rst +++ b/doc/install-guide/source/environment-security.rst @@ -58,6 +58,8 @@ and their associated references in the guide. - Database password for Compute service * - ``NOVA_PASS`` - Password of Compute service user ``nova`` + * - ``PLACEMENT_PASS`` + - Password of the Placement service user ``placement`` * - ``RABBIT_PASS`` - Password of user guest of RabbitMQ diff --git a/doc/install-guide/source/nova-compute-install.rst b/doc/install-guide/source/nova-compute-install.rst index 438735c0f3..c9d126778e 100644 --- a/doc/install-guide/source/nova-compute-install.rst +++ b/doc/install-guide/source/nova-compute-install.rst @@ -296,6 +296,27 @@ Install and configure components .. endonly + + * In the ``[placement]`` section, configure the Placement API: + + .. path /etc/nova/nova.conf + .. code-block:: ini + + [placement] + # ... + os_region_name = RegionOne + project_domain_name = Default + project_name = service + auth_type = password + user_domain_name = Default + auth_url = http://controller:35357/v3 + username = placement + password = PLACEMENT_PASS + + Replace ``PLACEMENT_PASS`` with the password you choose for the + ``placement`` user in the Identity service. Comment out any other options + in the ``[placement]`` section. + .. only:: obs or debian 3. Ensure the kernel module ``nbd`` is loaded. @@ -411,3 +432,43 @@ Finalize installation the firewall on the controller node is preventing access to port 5672. Configure the firewall to open port 5672 on the controller node and restart ``nova-compute`` service on the compute node. + +Add the compute node to the cell database +----------------------------------------- + +.. important:: + + Run the following commands on the **controller** node. + +#. Source the admin credentials to enable admin-only CLI commands, then + confirm there are compute hosts in the database: + + .. code-block:: console + + $ . admin-openrc + + $ openstack hypervisor list + +----+---------------------+-----------------+-----------+-------+ + | ID | Hypervisor Hostname | Hypervisor Type | Host IP | State | + +----+---------------------+-----------------+-----------+-------+ + | 1 | compute1 | QEMU | 10.0.0.31 | up | + +----+---------------------+-----------------+-----------+-------+ + +#. Discover compute hosts: + + .. code-block:: console + + # su -s /bin/sh -c "nova-manage cell_v2 discover_hosts --verbose" nova + + Found 2 cell mappings. + Skipping cell0 since it does not contain hosts. + Getting compute nodes from cell 'cell1': ad5a5985-a719-4567-98d8-8d148aaae4bc + Found 1 computes in cell: ad5a5985-a719-4567-98d8-8d148aaae4bc + Checking host mapping for compute host 'compute': fe58ddc1-1d65-4f87-9456-bc040dc106b3 + Creating host mapping for compute host 'compute': fe58ddc1-1d65-4f87-9456-bc040dc106b3 + + .. note:: + + When you add new compute nodes, you must run ``nova-manage cell_v2 + discover_hosts`` on the controller node to register those new compute + nodes. diff --git a/doc/install-guide/source/nova-controller-install.rst b/doc/install-guide/source/nova-controller-install.rst index f2f6b5e7e6..73e9062b39 100644 --- a/doc/install-guide/source/nova-controller-install.rst +++ b/doc/install-guide/source/nova-controller-install.rst @@ -44,6 +44,7 @@ create databases, service credentials, and API endpoints. MariaDB [(none)]> CREATE DATABASE nova_api; MariaDB [(none)]> CREATE DATABASE nova; + MariaDB [(none)]> CREATE DATABASE nova_cell0; .. end @@ -55,11 +56,17 @@ create databases, service credentials, and API endpoints. IDENTIFIED BY 'NOVA_DBPASS'; MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'%' \ IDENTIFIED BY 'NOVA_DBPASS'; + MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost' \ IDENTIFIED BY 'NOVA_DBPASS'; MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' \ IDENTIFIED BY 'NOVA_DBPASS'; + MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova_cell0.* TO 'nova'@'localhost' \ + IDENTIFIED BY 'NOVA_DBPASS'; + MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova_cell0.* TO 'nova'@'%' \ + IDENTIFIED BY 'NOVA_DBPASS'; + .. end Replace ``NOVA_DBPASS`` with a suitable password. @@ -75,14 +82,13 @@ create databases, service credentials, and API endpoints. .. end -#. To create the service credentials, complete these steps: +#. Create the Compute service credentials: * Create the ``nova`` user: .. code-block:: console - $ openstack user create --domain default \ - --password-prompt nova + $ openstack user create --domain default --password-prompt nova User Password: Repeat User Password: @@ -130,7 +136,7 @@ create databases, service credentials, and API endpoints. .. end -#. Create the Compute service API endpoints: +#. Create the Compute API service endpoints: .. code-block:: console @@ -187,6 +193,99 @@ create databases, service credentials, and API endpoints. .. end +#. Create a Placement service user using your chosen ``PLACEMENT_PASS``: + + .. code-block:: console + + $ openstack user create --domain default --password-prompt placement + + User Password: + Repeat User Password: + +---------------------+----------------------------------+ + | Field | Value | + +---------------------+----------------------------------+ + | domain_id | default | + | enabled | True | + | id | fa742015a6494a949f67629884fc7ec8 | + | name | placement | + | options | {} | + | password_expires_at | None | + +---------------------+----------------------------------+ + +#. Add the Placement user to the service project with the admin role: + + .. code-block:: console + + $ openstack role add --project service --user placement admin + + .. note:: + + This command provides no output. + +#. Create the Placement API entry in the service catalog: + + .. code-block:: console + + $ openstack service create --name placement --description "Placement API" placement + +-------------+----------------------------------+ + | Field | Value | + +-------------+----------------------------------+ + | description | Placement API | + | enabled | True | + | id | 2d1a27022e6e4185b86adac4444c495f | + | name | placement | + | type | placement | + +-------------+----------------------------------+ + +#. Create the Placement API service endpoints: + + .. code-block:: console + + $ openstack endpoint create --region RegionOne placement public http://controller:8778 + +--------------+----------------------------------+ + | Field | Value | + +--------------+----------------------------------+ + | enabled | True | + | id | 2b1b2637908b4137a9c2e0470487cbc0 | + | interface | public | + | region | RegionOne | + | region_id | RegionOne | + | service_id | 2d1a27022e6e4185b86adac4444c495f | + | service_name | placement | + | service_type | placement | + | url | http://controller:8778 | + +--------------+----------------------------------+ + + $ openstack endpoint create --region RegionOne placement internal http://controller:8778 + +--------------+----------------------------------+ + | Field | Value | + +--------------+----------------------------------+ + | enabled | True | + | id | 02bcda9a150a4bd7993ff4879df971ab | + | interface | internal | + | region | RegionOne | + | region_id | RegionOne | + | service_id | 2d1a27022e6e4185b86adac4444c495f | + | service_name | placement | + | service_type | placement | + | url | http://controller:8778 | + +--------------+----------------------------------+ + + $ openstack endpoint create --region RegionOne placement admin http://controller:8778 + +--------------+----------------------------------+ + | Field | Value | + +--------------+----------------------------------+ + | enabled | True | + | id | 3d71177b9e0f406f98cbff198d74b182 | + | interface | admin | + | region | RegionOne | + | region_id | RegionOne | + | service_id | 2d1a27022e6e4185b86adac4444c495f | + | service_name | placement | + | service_type | placement | + | url | http://controller:8778 | + +--------------+----------------------------------+ + Install and configure components -------------------------------- @@ -200,7 +299,8 @@ Install and configure components # zypper install openstack-nova-api openstack-nova-scheduler \ openstack-nova-conductor openstack-nova-consoleauth \ - openstack-nova-novncproxy iptables + openstack-nova-novncproxy openstack-nova-placement-api \ + iptables .. end @@ -214,7 +314,7 @@ Install and configure components # yum install openstack-nova-api openstack-nova-conductor \ openstack-nova-console openstack-nova-novncproxy \ - openstack-nova-scheduler + openstack-nova-scheduler openstack-nova-placement-api .. end @@ -227,7 +327,7 @@ Install and configure components .. code-block:: console # apt install nova-api nova-conductor nova-consoleauth \ - nova-novncproxy nova-scheduler + nova-novncproxy nova-scheduler nova-placement-api .. end @@ -476,14 +576,55 @@ Install and configure components .. endonly -.. only:: rdo or ubuntu or debian +* In the ``[placement]`` section, configure the Placement API: - 3. Populate the Compute databases: + .. path /etc/nova/nova.conf + .. code-block:: ini + + [placement] + # ... + os_region_name = RegionOne + project_domain_name = Default + project_name = service + auth_type = password + user_domain_name = Default + auth_url = http://controller:35357/v3 + username = placement + password = PLACEMENT_PASS + + Replace ``PLACEMENT_PASS`` with the password you choose for the + ``placement`` user in the Identity service. Comment out any other options in + the ``[placement]`` section. + +.. only:: rdo + + * Due to a `packaging bug + `_, you must enable + access to the Placement API by adding the following configuration to + ``/etc/httpd/conf.d/00-nova-placement-api.conf``: + + .. path /etc/httpd/conf.d/00-nova-placement-api.conf + .. code-block:: ini + + + = 2.4> + Require all granted + + + Order allow,deny + Allow from all + + + +.. endonly + +.. only:: rdo or ubuntu or debian or obs + + 3. Populate the nova-api database: .. code-block:: console # su -s /bin/sh -c "nova-manage api_db sync" nova - # su -s /bin/sh -c "nova-manage db sync" nova .. end @@ -491,6 +632,43 @@ Install and configure components Ignore any deprecation messages in this output. + 4. Register the ``cell0`` database: + + .. code-block:: console + + # su -s /bin/sh -c "nova-manage cell_v2 map_cell0" nova + + .. end + + 5. Create the ``cell1`` cell: + + .. code-block:: console + + # su -s /bin/sh -c "nova-manage cell_v2 create_cell --name=cell1 --verbose" nova + 109e1d4b-536a-40d0-83c6-5f121b82b650 + + .. end + + 6. Populate the nova database: + + .. code-block:: console + + # su -s /bin/sh -c "nova-manage db sync" nova + + 7. Verify nova cell0 and cell1 are registered correctly: + + .. code-block:: console + + # nova-manage cell_v2 list_cells + +-------+--------------------------------------+ + | Name | UUID | + +-------+--------------------------------------+ + | cell1 | 109e1d4b-536a-40d0-83c6-5f121b82b650 | + | cell0 | 00000000-0000-0000-0000-000000000000 | + +-------+--------------------------------------+ + + .. end + .. endonly Finalize installation diff --git a/doc/install-guide/source/nova-verify.rst b/doc/install-guide/source/nova-verify.rst index 64b3f3110f..4ff93b180a 100644 --- a/doc/install-guide/source/nova-verify.rst +++ b/doc/install-guide/source/nova-verify.rst @@ -51,31 +51,38 @@ Verify operation of the Compute service. $ openstack catalog list - +----------+----------+-----------------------------------------+ - | Name | Type | Endpoints | - +----------+----------+-----------------------------------------+ - | keystone | identity | RegionOne | - | | | public: http://controller:5000/v3/ | - | | | RegionOne | - | | | internal: http://controller:5000/v3/ | - | | | RegionOne | - | | | admin: http://controller:35357/v3/ | - | | | | - | glance | image | RegionOne | - | | | admin: http://controller:9292 | - | | | RegionOne | - | | | public: http://controller:9292 | - | | | RegionOne | - | | | internal: http://controller:9292 | - | | | | - | nova | compute | RegionOne | - | | | admin: http://controller:8774/v2.1 | - | | | RegionOne | - | | | internal: http://controller:8774/v2.1 | - | | | RegionOne | - | | | public: http://controller:8774/v2.1 | - | | | | - +----------+----------+-----------------------------------------+ + +-----------+-----------+-----------------------------------------+ + | Name | Type | Endpoints | + +-----------+-----------+-----------------------------------------+ + | keystone | identity | RegionOne | + | | | public: http://controller:5000/v3/ | + | | | RegionOne | + | | | internal: http://controller:5000/v3/ | + | | | RegionOne | + | | | admin: http://controller:35357/v3/ | + | | | | + | glance | image | RegionOne | + | | | admin: http://controller:9292 | + | | | RegionOne | + | | | public: http://controller:9292 | + | | | RegionOne | + | | | internal: http://controller:9292 | + | | | | + | nova | compute | RegionOne | + | | | admin: http://controller:8774/v2.1 | + | | | RegionOne | + | | | internal: http://controller:8774/v2.1 | + | | | RegionOne | + | | | public: http://controller:8774/v2.1 | + | | | | + | placement | placement | RegionOne | + | | | public: http://controller:8778 | + | | | RegionOne | + | | | admin: http://controller:8778 | + | | | RegionOne | + | | | internal: http://controller:8778 | + | | | | + +-----------+-----------+-----------------------------------------+ .. note::