Openstack installation : Compute Service – Nova (On Controller Node)

Content from “openstack.org”, listed here with minor/no changes – just noting down what I did – online notes.

Create databases, service credentials, and API endpoints.

Create the nova_api, nova, nova_cell0, and placement databases:

CREATE DATABASE nova_api;
CREATE DATABASE nova;
CREATE DATABASE nova_cell0;
CREATE DATABASE placement;
GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'localhost' IDENTIFIED BY {password};
GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'%' IDENTIFIED BY {password};
GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost' IDENTIFIED BY {password};
GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' IDENTIFIED BY {password};
GRANT ALL PRIVILEGES ON nova_cell0.* TO 'nova'@'localhost' IDENTIFIED BY {password};
GRANT ALL PRIVILEGES ON nova_cell0.* TO 'nova'@'%' IDENTIFIED BY {password};
GRANT ALL PRIVILEGES ON placement.* TO 'placement'@'localhost' IDENTIFIED BY {password};
GRANT ALL PRIVILEGES ON placement.* TO 'placement'@'%' IDENTIFIED BY {password};

Create the Compute service credentials and create the nova user

$ . admin-openrc 
$ openstack user create --domain default --password-prompt nova
User Password:
Repeat User Password:
+---------------------+----------------------------------+
| Field | Value |
+---------------------+----------------------------------+
| domain_id | default |
| enabled | True |
| id | 8a7dbf5279404537b1c7b86c033620fe |
| name | nova |
| options | {} |
| password_expires_at | None |
+---------------------+----------------------------------+

Add the admin role to the nova user:

$ openstack role add --project service --user nova admin

Create the nova service entity:

$ openstack service create --name nova --description "OpenStack Compute" compute
+-------------+----------------------------------+
| Field | Value |
+-------------+----------------------------------+
| description | OpenStack Compute |
| enabled | True |
| id | 060d59eac51b4594815603d75a00aba2 |
| name | nova |
| type | compute |
+-------------+----------------------------------+

Create the Compute API service endpoints:

$ openstack endpoint create --region RegionOne compute public http://controller:8774/v2.1 
+--------------+-------------------------------------------+
| Field | Value |
+--------------+-------------------------------------------+
| enabled | True |
| id | 3c1caa473bfe4390a11e7177894bcc7b |
| interface | public |
| region | RegionOne |
| region_id | RegionOne |
| service_id | 060d59eac51b4594815603d75a00aba2 |
| service_name | nova |
| service_type | compute |
| url | http://controller:8774/v2.1 |
+--------------+-------------------------------------------+
$ openstack endpoint create --region RegionOne compute internal http://controller:8774/v2.1 
+--------------+-------------------------------------------+
| Field | Value |
+--------------+-------------------------------------------+
| enabled | True |
| id | e3c918de680746a586eac1f2d9bc10ab |
| interface | internal |
| region | RegionOne |
| region_id | RegionOne |
| service_id | 060d59eac51b4594815603d75a00aba2 |
| service_name | nova |
| service_type | compute |
| url | http://controller:8774/v2.1 |
+--------------+-------------------------------------------+
$ openstack endpoint create --region RegionOne compute admin http://controller:8774/v2.1
+--------------+-------------------------------------------+
| Field | Value |
+--------------+-------------------------------------------+
| enabled | True |
| id | 38f7af91666a47cfb97b4dc790b94424 |
| interface | admin |
| region | RegionOne |
| region_id | RegionOne |
| service_id | 060d59eac51b4594815603d75a00aba2 |
| service_name | nova |
| service_type | compute |
| url | http://controller:8774/v2.1 |
+--------------+-------------------------------------------+

Create a Placement service user

$ 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:

$ openstack role add --project service --user placement admin

Create the Placement API entry in the service catalog:

$ 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:

$ 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

Install the packages:

apt install --assume-yes nova-api nova-conductor nova-consoleauth nova-novncproxy nova-scheduler nova-placement-api

Edit the /etc/nova/nova.conf file and complete the following actions:

In the [DEFAULT] section

  • Due to a packaging bug, remove the log_dir option
  • Configure RabbitMQ message queue access
  • Configure the my_ip option to use the management interface IP address of the controller node
  • Enable support for networking. By default, Compute uses an internal firewall driver. Since the Networking service includes a firewall driver, you must disable the Compute firewall driver by using the nova.virt.firewall.NoopFirewallDriver firewall driver.
[DEFAULT]
...
transport_url = rabbit://openstack:{password}@controller
...

my_ip = 10.0.0.31
use_neutron = true
firewall_driver = nova.virt.firewall.NoopFirewallDriver

In the [api_database], [database], and [placement_database] sections, configure database access:

[api_database]
...
connection = mysql+pymysql://nova:{password}@controller/nova_api
...
[database]
connection = mysql+pymysql://nova:{password}@controller/nova
. . .
[placement_database]

connection = mysql+pymysql://placement:{password}@controller/placement

In the [api] and [keystone_authtoken] sections, configure Identity service access:
Comment out or remove any other options in the [keystone_authtoken] section.

[api]
. . .
auth_strategy = keystone
. . .
[keystone_authtoken]
. . .
auth_url = http://controller:5000/v3
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = nova
password = {password}

In the [vnc] section, configure the VNC proxy to use the management interface IP address of the controller node:

[vnc]
...
enabled = true
server_listen = $my_ip
server_proxyclient_address = $my_ip

In the [glance] section, configure the location of the Image service API:

[glance]
...
api_servers = http://controller:9292

In the [oslo_concurrency] section, configure the lock path:

[oslo_concurrency]
...
lock_path = /var/lib/nova/tmp

In the [placement] section, configure the Placement API:
Comment out any other options in the [placement] section.

[placement]
. . .
region_name = RegionOne
project_domain_name = Default
project_name = service
auth_type = password
user_domain_name = Default
auth_url = http://controller:5000/v3
username = placement
password = {password}

Populate the nova & nova-api database (Ignore any deprecation messages in this output)

su -s /bin/sh -c "nova-manage db sync" nova

Populate the nova-api and placement databases:

su -s /bin/sh -c "nova-manage api_db sync" nova

Register the cell0 database:

su -s /bin/sh -c "nova-manage cell_v2 map_cell0" nova

Create the cell1 cell:

su -s /bin/sh -c "nova-manage cell_v2 create_cell --name=cell1 --verbose" nova 
109e1d4b-536a-40d0-83c6-5f121b82b650

Populate the nova database:

su -s /bin/sh -c "nova-manage db sync" nova

Verify nova cell0 and cell1 are registered correctly:

su -s /bin/sh -c "nova-manage cell_v2 list_cells" nova 
+-------+--------------------------------------+
| Name | UUID |
+-------+--------------------------------------+
| cell1 | 109e1d4b-536a-40d0-83c6-5f121b82b650 |
| cell0 | 00000000-0000-0000-0000-000000000000 |
+-------+--------------------------------------+

Finalize installation

service nova-api restart
service nova-scheduler restart
service nova-conductor restart
service nova-novncproxy restart

About sandeep

Passionate about sharing information on "how to".
This entry was posted in Installation / How To, Notes and tagged , , , , , , , , . Bookmark the permalink.