Steps to Install and configure Controller Node in OpenStack – Part 2


Openstack

This is the second and the final part of the steps to Install and configure controller node in OpenStack. In the first part of this article I shared the steps to configure below services to configure a controller node in an OpenStack setup.

  • MariaDB
  • RabbitMQ
  • Memcached
  • Keystone

Steps to Install and configure Controller Node in OpenStack - Part 2

 

Now in this article we will continue and will share the steps to configure below services

  • Glance
  • Nova Compute

 

Steps to Install and Configure Controller node in OpenStack

Below are the detailed list of topics which I will cover in this article

  • Glance Installation and configuration
    • Create Glance Database
    • Create glance user and role
    • Create glance service entity
    • Create the image service API endpoints
    • Install the glance package
    • Update glance configuration files
    • Populate the Image service database
    • Enable glance API and registry services
    • Verify glance api and registry services
    • Configure Compute
  • Create compute database
    • Create the nova user and assign role
    • Create the nova service entity
    • Create compute service endpoints
    • Create a Placement service user and assign role
    • Create the Placement API entry in the service catalog
    • Create the Placement API service endpoints
    • Deploy and configure nova packages
    • Populate the nova-api database
    • Register the cell0 database
    • Create the cell1 cell
    • Populate the nova database
    • Verify nova cell0 and cell1 are registered correctly

 

Glance Installation and configuration

The Image service (glance) enables users to discover, register, and retrieve virtual machine images. It offers a REST API that enables you to query virtual machine image metadata and retrieve an actual image. You can store virtual machine images made available through the Image service in a variety of locations, from simple file systems to object-storage systems like OpenStack Object Storage.

 

Create Glance database

Use the database access client to connect to the database server as the root user:

[root@controller ~]# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or g.
Your MariaDB connection id is 6
Server version: 10.1.20-MariaDB MariaDB Server

Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.

MariaDB [(none)]> CREATE DATABASE glance;
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'localhost' IDENTIFIED BY 'redhat';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%' IDENTIFIED BY 'redhat';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> exit
Bye
NOTE:
Here redhat is the password for my nova database

 

Create the glance user and role

[root@controller ~]# openstack user create --domain default --password-prompt glance
User Password:
Repeat User Password:
+---------------------+----------------------------------+
| Field               | Value                            |
+---------------------+----------------------------------+
| domain_id           | 0267824b7d934264aa9d560e7650681b |
| enabled             | True                             |
| id                  | 4b773850572c4faf8319a64f5bb5bad7 |
| name                | glance                           |
| options             | {}                               |
| password_expires_at | None                             |
+---------------------+----------------------------------+

Add the admin role to the glance user and service project:

[root@controller ~]# openstack role add --project service --user glance admin

 

Create the glance service entity

[root@controller ~]# openstack service create --name glance --description "OpenStack Image" image
+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | OpenStack Image                  |
| enabled     | True                             |
| id          | 123bf6d523e948a2abcd4b571e8cbadd |
| name        | glance                           |
| type        | image                            |
+-------------+----------------------------------+

 

Create the Image service API endpoints

[root@controller ~]# openstack endpoint create --region RegionOne image public http://controller:9292
+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | eedcb15d360644bf9fecc7d7b2a8f22a |
| interface    | public                           |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | 123bf6d523e948a2abcd4b571e8cbadd |
| service_name | glance                           |
| service_type | image                            |
| url          | http://controller:9292           |
+--------------+----------------------------------+

[root@controller ~]# openstack endpoint create --region RegionOne image internal http://controller:9292
+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | 6423afef595b4d07bbf16435c8537521 |
| interface    | internal                         |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | 123bf6d523e948a2abcd4b571e8cbadd |
| service_name | glance                           |
| service_type | image                            |
| url          | http://controller:9292           |
+--------------+----------------------------------+

[root@controller ~]# openstack endpoint create --region RegionOne image admin http://controller:9292
+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | 3de13f6576d34e9d873856a55e43b36d |
| interface    | admin                            |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | 123bf6d523e948a2abcd4b571e8cbadd |
| service_name | glance                           |
| service_type | image                            |
| url          | http://controller:9292           |
+--------------+----------------------------------+

 

Install the glance packages

[root@controller ~]# yum install openstack-glance -y

 

Update glance configuration files

Update the /etc/glance/glance-api.conf file and complete the following actions:

NOTE:
Replace GLANCE_PASS and GLANCE_DBPASS with the password of your glance user and glance database password assigned in the above steps
[root@controller ~]# openstack-config --set /etc/glance/glance-api.conf database connection mysql+pymysql://glance:GLANCE_DBPASS@controller/glance
[root@controller ~]# openstack-config --set /etc/glance/glance-api.conf keystone_authtoken auth_uri http://controller:5000
[root@controller ~]# openstack-config --set /etc/glance/glance-api.conf keystone_authtoken auth_url http://controller:35357
[root@controller ~]# openstack-config --set /etc/glance/glance-api.conf keystone_authtoken memcached_servers controller:11211
[root@controller ~]# openstack-config --set /etc/glance/glance-api.conf keystone_authtoken auth_type password
[root@controller ~]# openstack-config --set /etc/glance/glance-api.conf keystone_authtoken project_domain_name Default
[root@controller ~]# openstack-config --set /etc/glance/glance-api.conf keystone_authtoken user_domain_name Default
[root@controller ~]# openstack-config --set /etc/glance/glance-api.conf keystone_authtoken project_name service
[root@controller ~]# openstack-config --set /etc/glance/glance-api.conf keystone_authtoken username glance
[root@controller ~]# openstack-config --set /etc/glance/glance-api.conf keystone_authtoken password GLANCE_PASS
[root@controller ~]# openstack-config --set /etc/glance/glance-api.conf paste_deploy flavor keystone
[root@controller ~]# openstack-config --set /etc/glance/glance-api.conf glance_store stores file,http
[root@controller ~]# openstack-config --set /etc/glance/glance-api.conf glance_store default_store file
[root@controller ~]# openstack-config --set /etc/glance/glance-api.conf glance_store filesystem_store_datadir /var/lib/glance/images/

Update the /etc/glance/glance-registry.conf file and complete the following actions:

NOTE:
Replace GLANCE_PASS and GLANCE_DBPASS with the password of your glance user and glance database password assigned in the above steps
[root@controller ~]# openstack-config --set /etc/glance/glance-registry.conf database connection mysql+pymysql://glance:GLANCE_DBPASS@controller/glance
[root@controller ~]# openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken auth_uri http://controller:5000
[root@controller ~]# openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken auth_url http://controller:35357
[root@controller ~]# openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken memcached_servers controller:11211
[root@controller ~]# openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken auth_type password
[root@controller ~]# openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken project_domain_name default
[root@controller ~]# openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken user_domain_name default
[root@controller ~]# openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken project_name service
[root@controller ~]# openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken username glance
[root@controller ~]# openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken password GLANCE_PASS
[root@controller ~]# openstack-config --set /etc/glance/glance-registry.conf paste_deploy flavor keystone

 

Populate the Image service database

[root@controller ~]# su -s /bin/sh -c "glance-manage db_sync" glance
/usr/lib/python2.7/site-packages/oslo_db/sqlalchemy/enginefacade.py:1336: OsloDBDeprecationWarning: EngineFacade is deprecated; please use oslo_db.sqlalchemy.enginefacade
  expire_on_commit=expire_on_commit, _conf=conf)
INFO  [alembic.runtime.migration] Context impl MySQLImpl.
INFO  [alembic.runtime.migration] Will assume non-transactional DDL.
INFO  [alembic.runtime.migration] Running upgrade  -> liberty, liberty initial
INFO  [alembic.runtime.migration] Running upgrade liberty -> mitaka01, add index on created_at and updated_at columns of 'images' table
INFO  [alembic.runtime.migration] Running upgrade mitaka01 -> mitaka02, update metadef os_nova_server
INFO  [alembic.runtime.migration] Running upgrade mitaka02 -> ocata_expand01, add visibility to images
INFO  [alembic.runtime.migration] Running upgrade ocata_expand01 -> pike_expand01, empty expand for symmetry with pike_contract01
INFO  [alembic.runtime.migration] Running upgrade pike_expand01 -> queens_expand01
INFO  [alembic.runtime.migration] Context impl MySQLImpl.
INFO  [alembic.runtime.migration] Will assume non-transactional DDL.
Upgraded database to: queens_expand01, current revision(s): queens_expand01
INFO  [alembic.runtime.migration] Context impl MySQLImpl.
INFO  [alembic.runtime.migration] Will assume non-transactional DDL.
INFO  [alembic.runtime.migration] Context impl MySQLImpl.
INFO  [alembic.runtime.migration] Will assume non-transactional DDL.
Database migration is up to date. No migration needed.
INFO  [alembic.runtime.migration] Context impl MySQLImpl.
INFO  [alembic.runtime.migration] Will assume non-transactional DDL.
INFO  [alembic.runtime.migration] Context impl MySQLImpl.
INFO  [alembic.runtime.migration] Will assume non-transactional DDL.
INFO  [alembic.runtime.migration] Running upgrade mitaka02 -> ocata_contract01, remove is_public from images
INFO  [alembic.runtime.migration] Running upgrade ocata_contract01 -> pike_contract01, drop glare artifacts tables
INFO  [alembic.runtime.migration] Running upgrade pike_contract01 -> queens_contract01
INFO  [alembic.runtime.migration] Context impl MySQLImpl.
INFO  [alembic.runtime.migration] Will assume non-transactional DDL.
Upgraded database to: queens_contract01, current revision(s): queens_contract01
INFO  [alembic.runtime.migration] Context impl MySQLImpl.
INFO  [alembic.runtime.migration] Will assume non-transactional DDL.
Database is synced successfully.
NOTE:
Ignore any deprecation messages in this output.

 

Enable Glance API and Glance registry services

[root@controller ~]# systemctl enable openstack-glance-api.service openstack-glance-registry.service
[root@controller ~]# systemctl start openstack-glance-api.service openstack-glance-registry.service

 

Verify Glance API and Glance Registry services

Verify operation of the Image service using CirrOS, a small Linux image that helps you test your OpenStack deployment.

[root@controller ~]# source adminrc

 

Download the cirros source image

[root@controller ~]# wget http://download.cirros-cloud.net/0.4.0/cirros-0.4.0-x86_64-disk.img
--2018-11-01 16:43:44--  http://download.cirros-cloud.net/0.4.0/cirros-0.4.0-x86_64-disk.img
Resolving download.cirros-cloud.net (download.cirros-cloud.net)... 64.90.42.85, 2607:f298:6:a036::bd6:a72a
Connecting to download.cirros-cloud.net (download.cirros-cloud.net)|64.90.42.85|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 12716032 (12M) [text/plain]
Saving to: ‘cirros-0.4.0-x86_64-disk.img’

100%[======================================================================================================>] 12,716,032  1.72MB/s   in 25s

2018-11-01 16:44:11 (490 KB/s) - ‘cirros-0.4.0-x86_64-disk.img’ saved [12716032/12716032]

Check if the file is downloaded

[root@controller ~]# ls -lh cirros-0.4.0-x86_64-disk.img
-rw-r--r-- 1 root root 13M Nov 20 2017 cirros-0.4.0-x86_64-disk.img

Upload the image to the Image service using the QCOW2 disk format, bare container format, and public visibility so all projects can access it:

[root@controller ~]# openstack image create cirros --file ~/cirros-0.4.0-x86_64-disk.img --disk-format qcow2 --public
+------------------+------------------------------------------------------+
| Field            | Value                                                |
+------------------+------------------------------------------------------+
| checksum         | 443b7623e27ecf03dc9e01ee93f67afe                     |
| container_format | bare                                                 |
| created_at       | 2018-11-01T11:53:50Z                                 |
| disk_format      | qcow2                                                |
| file             | /v2/images/169bc19c-e9c9-4de3-ade4-c9cc9a443162/file |
| id               | 169bc19c-e9c9-4de3-ade4-c9cc9a443162                 |
| min_disk         | 0                                                    |
| min_ram          | 0                                                    |
| name             | cirros                                               |
| owner            | 8bb9c0b1fa7947778a4f914ea0752cfc                     |
| protected        | False                                                |
| schema           | /v2/schemas/image                                    |
| size             | 12716032                                             |
| status           | active                                               |
| tags             |                                                      |
| updated_at       | 2018-11-01T11:53:51Z                                 |
| virtual_size     | None                                                 |
| visibility       | public                                               |
+------------------+------------------------------------------------------+

Confirm upload of the image and validate attributes:

[root@controller ~]# openstack image list
+--------------------------------------+--------+--------+
| ID                                   | Name   | Status |
+--------------------------------------+--------+--------+
| 169bc19c-e9c9-4de3-ade4-c9cc9a443162 | cirros | active |
+--------------------------------------+--------+--------+

You can also directly upload the image from the web to the glance image database using (--copy-from)

[root@controller ~]# openstack image create "cirros-1" --file ~/cirros-0.4.0-x86_64-disk.img --disk-format qcow2 --public --copy-from http://download.cirros-cloud.net/0.4.0/cirros-0.4.0-x86_64-disk.img
ERROR: --copy-from was given, which is an Image v1 option that is no longer supported in Image v2
NOTE:
The argument --copy-from is supported only with V1 version of OS_IMAGE_API_VERSION. So we need to manually change the API version for this variable.
[root@controller ~]# cat adminrc
export OS_PROJECT_DOMAIN_NAME=default
export OS_USER_DOMAIN_NAME=default
export OS_PROJECT_NAME=admin
export OS_USERNAME=admin
export OS_PASSWORD=redhat
export OS_AUTH_URL=http://controller:35357/v3
export OS_IDENTITY_API_VERSION=3
export OS_IMAGE_API_VERSION=2
[root@controller ~]# export OS_IMAGE_API_VERSION=1

Next re-attempt the upload

[root@controller ~]# openstack image create "cirros-1" --file ~/cirros-0.4.0-x86_64-disk.img --disk-format qcow2 --public --copy-from http://download.cirros-cloud.net/0.4.0/cirros-0.4.0-x86_64-disk.img
+------------------+--------------------------------------+
| Field            | Value                                |
+------------------+--------------------------------------+
| checksum         | None                                 |
| container_format | bare                                 |
| created_at       | 2018-11-01T12:51:21.000000           |
| deleted          | False                                |
| deleted_at       | None                                 |
| disk_format      | qcow2                                |
| id               | b28add75-85ec-46a3-8b8b-3de77944ee26 |
| is_public        | True                                 |
| min_disk         | 0                                    |
| min_ram          | 0                                    |
| name             | cirros-1                             |
| owner            | None                                 |
| properties       |                                      |
| protected        | False                                |
| size             | 12716032                             |
| status           | queued                               |
| updated_at       | 2018-11-01T12:51:21.000000           |
| virtual_size     | None                                 |
+------------------+--------------------------------------+

Check the uploaded image list

[root@controller ~]# openstack image list
+--------------------------------------+----------+--------+
| ID                                   | Name     | Status |
+--------------------------------------+----------+--------+
| 169bc19c-e9c9-4de3-ade4-c9cc9a443162 | cirros   | active |
| b28add75-85ec-46a3-8b8b-3de77944ee26 | cirros-1 | active |
+--------------------------------------+----------+--------+

 

Configure Compute

OpenStack Compute interacts with OpenStack Identity for authentication; OpenStack Image service for disk and server images; and OpenStack dashboard for the user and administrative interface. Image access is limited by projects, and by users; quotas are limited per project (the number of instances, for example). OpenStack Compute can scale horizontally on standard hardware, and download images to launch instances.

 

Create compute database

Use the database access client to connect to the database server as the root user:

[root@controller ~]# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or g.
Your MariaDB connection id is 9
Server version: 10.1.20-MariaDB MariaDB Server

Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.

MariaDB [(none)]> CREATE DATABASE nova_api;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> CREATE DATABASE nova;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> CREATE DATABASE nova_cell0;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'localhost' IDENTIFIED BY 'redhat';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'%' IDENTIFIED BY 'redhat';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost' IDENTIFIED BY 'redhat';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' IDENTIFIED BY 'redhat';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]>  GRANT ALL PRIVILEGES ON nova_cell0.* TO 'nova'@'localhost' IDENTIFIED BY 'redhat';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova_cell0.* TO 'nova'@'%' IDENTIFIED BY 'redhat';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> exit
Bye
NOTE:
Here redhat is the password for my nova database.

Source the admin credentials to gain access to admin-only CLI commands:

[root@controller ~]# source adminrc

 

Create the nova user and assign role

[root@controller ~]# openstack user create --domain default --password-prompt nova
User Password:
Repeat User Password:
+---------------------+----------------------------------+
| Field               | Value                            |
+---------------------+----------------------------------+
| domain_id           | 0267824b7d934264aa9d560e7650681b |
| enabled             | True                             |
| id                  | bb849e7b1b3d444b9304ffc5956f9433 |
| name                | nova                             |
| options             | {}                               |
| password_expires_at | None                             |
+---------------------+----------------------------------+

Add the admin role to the nova user:

[root@controller ~]# openstack role add --project service --user nova admin

 

Create the nova service entity

[root@controller ~]# openstack service create --name nova   --description "OpenStack Compute" compute
+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | OpenStack Compute                |
| enabled     | True                             |
| id          | d9a2621eea464566ae90e00f456811dc |
| name        | nova                             |
| type        | compute                          |
+-------------+----------------------------------+

 

Create the Compute service API endpoints

[root@controller ~]# openstack endpoint create --region RegionOne compute public http://controller:8774/v2.1
+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | 7091591858f14f29a1df0a479ca9d644 |
| interface    | public                           |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | d9a2621eea464566ae90e00f456811dc |
| service_name | nova                             |
| service_type | compute                          |
| url          | http://controller:8774/v2.1      |
+--------------+----------------------------------+

[root@controller ~]# openstack endpoint create --region RegionOne compute internal http://controller:8774/v2.1
+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | 808837731e284e3e9c700514d13669fa |
| interface    | internal                         |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | d9a2621eea464566ae90e00f456811dc |
| service_name | nova                             |
| service_type | compute                          |
| url          | http://controller:8774/v2.1      |
+--------------+----------------------------------+

[root@controller ~]# openstack endpoint create --region RegionOne  compute admin http://controller:8774/v2.1
+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | 8fd0dccb2b4e4f89a68d69f7052cc225 |
| interface    | admin                            |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | d9a2621eea464566ae90e00f456811dc |
| service_name | nova                             |
| service_type | compute                          |
| url          | http://controller:8774/v2.1      |
+--------------+----------------------------------+

 

Create a Placement service user and assign role

[root@controller ~]# openstack user create --domain default --password-prompt placement
User Password:
Repeat User Password:
+---------------------+----------------------------------+
| Field               | Value                            |
+---------------------+----------------------------------+
| domain_id           | 0267824b7d934264aa9d560e7650681b |
| enabled             | True                             |
| id                  | 2101cf2e577a41eeb2c1c2eb053d7e40 |
| name                | placement                        |
| options             | {}                               |
| password_expires_at | None                             |
+---------------------+----------------------------------+

Add the Placement user to the service project with the admin role:

[root@controller ~]# openstack role add --project service --user placement admin

 

Create the Placement API entry in the service catalog

[root@controller ~]# openstack service create --name placement --description "Placement API" placement
+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | Placement API                    |
| enabled     | True                             |
| id          | 841a363675d840b3afc3a253c812449b |
| name        | placement                        |
| type        | placement                        |
+-------------+----------------------------------+

 

Create the Placement API service endpoints

[root@controller ~]# openstack endpoint create --region RegionOne placement public http://controller:8778
+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | 92ac4235f27d490a99afe67b69b0cee4 |
| interface    | public                           |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | 841a363675d840b3afc3a253c812449b |
| service_name | placement                        |
| service_type | placement                        |
| url          | http://controller:8778           |
+--------------+----------------------------------+

[root@controller ~]# openstack endpoint create --region RegionOne placement internal http://controller:8778
+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | 22249b972b744cf2b027125ff59bf745 |
| interface    | internal                         |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | 841a363675d840b3afc3a253c812449b |
| service_name | placement                        |
| service_type | placement                        |
| url          | http://controller:8778           |
+--------------+----------------------------------+

[root@controller ~]# openstack endpoint create --region RegionOne placement admin http://controller:8778
+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | 73fcdcbb61c54b898f18cbe91fca31f4 |
| interface    | admin                            |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | 841a363675d840b3afc3a253c812449b |
| service_name | placement                        |
| service_type | placement                        |
| url          | http://controller:8778           |
+--------------+----------------------------------+

 

Deploy and configure nova packages

Install the packages:

[root@controller ~]# yum -y install openstack-nova-api openstack-nova-conductor openstack-nova-console openstack-nova-novncproxy openstack-nova-scheduler

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

NOTE:
Replace RABBIT_PASS, NOVA_DBPASS, NOVA_PASS, PLACEMENT_PASS with the respective password. Replace 10.0.2.10 with your controller IP Address
[root@controller ~]# openstack-config --set /etc/nova/nova.conf database connection mysql+pymysql://nova:NOVA_DBPASS@controller/nova

[root@controller ~]# openstack-config --set /etc/nova/nova.conf DEFAULT enabled_apis osapi_compute,metadata
[root@controller ~]# openstack-config --set /etc/nova/nova.conf DEFAULT my_ip 10.0.2.10
[root@controller ~]# openstack-config --set /etc/nova/nova.conf DEFAULT use_neutron True
[root@controller ~]# openstack-config --set /etc/nova/nova.conf DEFAULT firewall_driver  nova.virt.firewall.NoopFirewallDriver
[root@controller ~]# openstack-config --set /etc/nova/nova.conf DEFAULT transport_url = rabbit://openstack:RABBIT_PASS@controller

[root@controller ~]# openstack-config --set /etc/nova/nova.conf api auth_strategy keystone
[root@controller ~]# openstack-config --set /etc/nova/nova.conf api_database connection  mysql+pymysql://nova:NOVA_DBPASS@controller/nova_api
[root@controller ~]# openstack-config --set /etc/nova/nova.conf database connection = mysql+pymysql://nova:NOVA_DBPASS@controller/nova

[root@controller ~]# openstack-config --set /etc/nova/nova.conf oslo_messaging_rabbit rabbit_host  controller
[root@controller ~]# openstack-config --set /etc/nova/nova.conf oslo_messaging_rabbit rabbit_userid  openstack
[root@controller ~]# openstack-config --set /etc/nova/nova.conf oslo_messaging_rabbit rabbit_password RABBIT_PASS

[root@controller ~]# openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_url  http://controller:5000/v3
[root@controller ~]# openstack-config --set /etc/nova/nova.conf keystone_authtoken memcached_servers  controller:11211
[root@controller ~]# openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_type  password
[root@controller ~]# openstack-config --set /etc/nova/nova.conf keystone_authtoken project_domain_name default
[root@controller ~]# openstack-config --set /etc/nova/nova.conf keystone_authtoken user_domain_name default
[root@controller ~]# openstack-config --set /etc/nova/nova.conf keystone_authtoken project_name service
[root@controller ~]# openstack-config --set /etc/nova/nova.conf keystone_authtoken username nova
[root@controller ~]# openstack-config --set /etc/nova/nova.conf keystone_authtoken password NOVA_PASS

[root@controller ~]# openstack-config --set /etc/nova/nova.conf vnc emabled true
[root@controller ~]# openstack-config --set /etc/nova/nova.conf vnc server_listen 10.0.2.10
[root@controller ~]# openstack-config --set /etc/nova/nova.conf vnc server_proxyclient_address 10.0.2.10

[root@controller ~]# openstack-config --set /etc/nova/nova.conf glance api_servers http://controller:9292
[root@controller ~]# openstack-config --set /etc/nova/nova.conf oslo_concurrency lock_path /var/lib/nova/tmp

[root@controller ~]# openstack-config --set /etc/nova/nova.conf placement os_region_name RegionOne
[root@controller ~]# openstack-config --set /etc/nova/nova.conf placement project_domain_name Default
[root@controller ~]# openstack-config --set /etc/nova/nova.conf placement project_name service
[root@controller ~]# openstack-config --set /etc/nova/nova.conf placement auth_type password
[root@controller ~]# openstack-config --set /etc/nova/nova.conf placement user_domain_name Default
[root@controller ~]# openstack-config --set /etc/nova/nova.conf placement auth_url http://controller:5000/v3
[root@controller ~]# openstack-config --set /etc/nova/nova.conf placement username placement
[root@controller ~]# openstack-config --set /etc/nova/nova.conf placement password PLACEMENT_PASS

 

NOTE:
Ignore any deprecation related output message in the below commands

Populate the nova-api database

[root@controller ~]# su -s /bin/sh -c "nova-manage api_db sync" nova
/usr/lib/python2.7/site-packages/oslo_db/sqlalchemy/enginefacade.py:332: NotSupportedWarning: Configuration option(s) ['use_tpool'] not ssuported
  exception.NotSupportedWarning

 

Register the cell0 database

[root@controller ~]# su -s /bin/sh -c "nova-manage cell_v2 map_cell0" nova
/usr/lib/python2.7/site-packages/oslo_db/sqlalchemy/enginefacade.py:332: NotSupportedWarning: Configuration option(s) ['use_tpool'] not ssuported
  exception.NotSupportedWarning

 

Create the cell1 cell

[root@controller ~]# su -s /bin/sh -c "nova-manage cell_v2 create_cell --name=cell1 --verbose" nova
/usr/lib/python2.7/site-packages/oslo_db/sqlalchemy/enginefacade.py:332: NotSupportedWarning: Configuration option(s) ['use_tpool'] not ssuported
  exception.NotSupportedWarning
f671ab47-a48f-4ca2-80bb-444f5cfa84dd

 

Populate the nova database

[root@controller ~]# su -s /bin/sh -c "nova-manage db sync" nova
/usr/lib/python2.7/site-packages/oslo_db/sqlalchemy/enginefacade.py:332: NotSupportedWarning: Configuration option(s) ['use_tpool'] not ssuported
  exception.NotSupportedWarning
/usr/lib/python2.7/site-packages/pymysql/cursors.py:166: Warning: (1831, u'Duplicate index `block_device_mapping_instance_uuid_virtual_name_device_name_idx`. This is deprecated and will be disallowed in a future release.')
  result = self._query(query)
/usr/lib/python2.7/site-packages/pymysql/cursors.py:166: Warning: (1831, u'Duplicate index `uniq_instances0uuid`. This is deprecated and w                                                                                                   ill be disallowed in a future release.')
  result = self._query(query)

 

Verify nova cell0 and cell1 are registered correctly

[root@controller ~]# nova-manage cell_v2 list_cells
/usr/lib/python2.7/site-packages/oslo_db/sqlalchemy/enginefacade.py:332: NotSupportedWarning: Configuration option(s) ['use_tpool'] not supported
  exception.NotSupportedWarning
+-------+--------------------------------------+------------------------------------+-------------------------------------------------+
|  Name |                 UUID                 |           Transport URL            |               Database Connection               |
+-------+--------------------------------------+------------------------------------+-------------------------------------------------+
| cell0 | 00000000-0000-0000-0000-000000000000 |               none:/               | mysql+pymysql://nova:****@controller/nova_cell0 |
| cell1 | f671ab47-a48f-4ca2-80bb-444f5cfa84dd | rabbit://openstack:****@controller |    mysql+pymysql://nova:****@controller/nova    |
+-------+--------------------------------------+------------------------------------+-------------------------------------------------+

 

Start the Compute services and configure them to start when the system boots

[root@controller ~]# systemctl enable openstack-nova-api.service   openstack-nova-consoleauth.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service

[root@controller ~]# systemctl start openstack-nova-api.service   openstack-nova-consoleauth.service openstack-nova-scheduler.service   openstack-nova-conductor.service openstack-nova-novncproxy.service

 

Check the nova service status

[root@controller ~]# systemctl status openstack-nova-api.service   openstack-nova-consoleauth.service openstack-nova-scheduler.service   openstack-nova-conductor.service openstack-nova-novncproxy.service
● openstack-nova-api.service - OpenStack Nova API Server
   Loaded: loaded (/usr/lib/systemd/system/openstack-nova-api.service; enabled; vendor preset: disabled)
   Active: active (running) since Thu 2018-11-01 20:11:47 IST; 2min 51s ago
 Main PID: 14061 (nova-api)
   CGroup: /system.slice/openstack-nova-api.service
           ├─14061 /usr/bin/python2 /usr/bin/nova-api
           ├─14157 /usr/bin/python2 /usr/bin/nova-api
           └─14159 /usr/bin/python2 /usr/bin/nova-api

Nov 01 20:11:15 controller.example.com systemd[1]: openstack-nova-api.service holdoff time over, scheduling restart.
Nov 01 20:11:15 controller.example.com systemd[1]: Starting OpenStack Nova API Server...
Nov 01 20:11:23 controller.example.com nova-api[14061]: /usr/lib/python2.7/site-packages/oslo_db/sqlalchemy/enginefacade.py:332: NotSupportedWarning: Configuration option(s) ['use_tpool'] not supported
Nov 01 20:11:23 controller.example.com nova-api[14061]: exception.NotSupportedWarning
Nov 01 20:11:47 controller.example.com systemd[1]: Started OpenStack Nova API Server.

● openstack-nova-consoleauth.service - OpenStack Nova VNC console auth Server
   Loaded: loaded (/usr/lib/systemd/system/openstack-nova-consoleauth.service; disabled; vendor preset: disabled)
   Active: active (running) since Thu 2018-11-01 20:14:29 IST; 9s ago
 Main PID: 14245 (nova-consoleaut)
   CGroup: /system.slice/openstack-nova-consoleauth.service
           └─14245 /usr/bin/python2 /usr/bin/nova-consoleauth

Nov 01 20:13:33 controller.example.com systemd[1]: Starting OpenStack Nova VNC console auth Server...
Nov 01 20:14:02 controller.example.com nova-consoleauth[14245]: /usr/lib/python2.7/site-packages/oslo_db/sqlalchemy/enginefacade.py:332: NotSupportedWarning: Configuration option(s) ['use_tpool'] not supported
Nov 01 20:14:02 controller.example.com nova-consoleauth[14245]: exception.NotSupportedWarning
Nov 01 20:14:29 controller.example.com systemd[1]: Started OpenStack Nova VNC console auth Server.

● openstack-nova-scheduler.service - OpenStack Nova Scheduler Server
   Loaded: loaded (/usr/lib/systemd/system/openstack-nova-scheduler.service; enabled; vendor preset: disabled)
   Active: active (running) since Thu 2018-11-01 20:14:31 IST; 7s ago
 Main PID: 14246 (nova-scheduler)
   CGroup: /system.slice/openstack-nova-scheduler.service
           └─14246 /usr/bin/python2 /usr/bin/nova-scheduler

Nov 01 20:13:33 controller.example.com systemd[1]: Starting OpenStack Nova Scheduler Server...
Nov 01 20:14:01 controller.example.com nova-scheduler[14246]: /usr/lib/python2.7/site-packages/oslo_db/sqlalchemy/enginefacade.py:332: NotSupportedWarning: Configuration option(s) ['use_tpool'] not supported
Nov 01 20:14:01 controller.example.com nova-scheduler[14246]: exception.NotSupportedWarning
Nov 01 20:14:31 controller.example.com systemd[1]: Started OpenStack Nova Scheduler Server.

● openstack-nova-conductor.service - OpenStack Nova Conductor Server
   Loaded: loaded (/usr/lib/systemd/system/openstack-nova-conductor.service; enabled; vendor preset: disabled)
   Active: active (running) since Thu 2018-11-01 20:14:29 IST; 9s ago
 Main PID: 14247 (nova-conductor)
   CGroup: /system.slice/openstack-nova-conductor.service
           └─14247 /usr/bin/python2 /usr/bin/nova-conductor

Nov 01 20:13:33 controller.example.com systemd[1]: Starting OpenStack Nova Conductor Server...
Nov 01 20:14:02 controller.example.com nova-conductor[14247]: /usr/lib/python2.7/site-packages/oslo_db/sqlalchemy/enginefacade.py:332: NotSupportedWarning: Configuration option(s) ['use_tpool'] not supported
Nov 01 20:14:02 controller.example.com nova-conductor[14247]: exception.NotSupportedWarning
Nov 01 20:14:29 controller.example.com systemd[1]: Started OpenStack Nova Conductor Server.

● openstack-nova-novncproxy.service - OpenStack Nova NoVNC Proxy Server
   Loaded: loaded (/usr/lib/systemd/system/openstack-nova-novncproxy.service; enabled; vendor preset: disabled)
   Active: active (running) since Thu 2018-11-01 20:13:33 IST; 1min 5s ago
 Main PID: 14248 (nova-novncproxy)
   CGroup: /system.slice/openstack-nova-novncproxy.service
           └─14248 /usr/bin/python2 /usr/bin/nova-novncproxy --web /usr/share/novnc/

Nov 01 20:13:33 controller.example.com systemd[1]: Started OpenStack Nova NoVNC Proxy Server.
Nov 01 20:13:33 controller.example.com systemd[1]: Starting OpenStack Nova NoVNC Proxy Server...
Nov 01 20:14:02 controller.example.com nova-novncproxy[14248]: /usr/lib/python2.7/site-packages/oslo_db/sqlalchemy/enginefacade.py:332: NotSupportedWarning: Configuration option(s) ['use_tpool'] not supported
Nov 01 20:14:02 controller.example.com nova-novncproxy[14248]: exception.NotSupportedWarning

 

So this is all, now you can check the overall OpenStack service status running on your Controller node.

[root@controller ~]# source adminrc
[root@controller ~]# openstack-status
== Nova services ==
openstack-nova-api:                     active
openstack-nova-compute:                 inactive  (disabled on boot)
openstack-nova-network:                 inactive  (disabled on boot)
openstack-nova-scheduler:               active
openstack-nova-conductor:               active
openstack-nova-console:                 active
openstack-nova-consoleauth:             active    (disabled on boot)
openstack-nova-xvpvncproxy:             inactive  (disabled on boot)
== Glance services ==
openstack-glance-api:                   active
openstack-glance-registry:              active
== Keystone service ==
openstack-keystone:                     inactive  (disabled on boot)
== Horizon service ==
openstack-dashboard:                    active
== Support services ==
mariadb:                                active
dbus:                                   active
rabbitmq-server:                        active
memcached:                              active
== Keystone users ==
+----------------------------------+-----------+
| ID                               | Name      |
+----------------------------------+-----------+
| 1774158c0048410ea8114a35b7e2db7e | admin     |
| 2101cf2e577a41eeb2c1c2eb053d7e40 | placement |
| 4b773850572c4faf8319a64f5bb5bad7 | glance    |
| bb849e7b1b3d444b9304ffc5956f9433 | nova      |
| c9c4f121493144be98097c67ad9feeb0 | demo      |
+----------------------------------+-----------+
== Glance images ==
+--------------------------------------+----------+
| ID                                   | Name     |
+--------------------------------------+----------+
| 169bc19c-e9c9-4de3-ade4-c9cc9a443162 | cirros   |
| b28add75-85ec-46a3-8b8b-3de77944ee26 | cirros-1 |
+--------------------------------------+----------+
== Nova managed services ==
+--------------------------------------+------------------+------------------------+----------+---------+-------+------------                                                                                                                ----------------+-----------------+-------------+
| Id                                   | Binary           | Host                   | Zone     | Status  | State | Updated_at                                                                                                                                 | Disabled Reason | Forced down |
+--------------------------------------+------------------+------------------------+----------+---------+-------+------------                                                                                                                ----------------+-----------------+-------------+
| b282f419-a2ff-47da-9e67-7fdf91d6840a | nova-console     | controller.example.com | internal | enabled | up    | 2018-11-02T                                                                                                                08:44:03.000000 | -               | False       |
| 48074945-992e-4eb1-b0fe-851b9a4a644e | nova-consoleauth | controller.example.com | internal | enabled | up    | 2018-11-02T                                                                                                                08:44:00.000000 | -               | False       |
| 15a3f6c8-fb3b-4f0d-bef2-32bff32b3e97 | nova-scheduler   | controller.example.com | internal | enabled | up    | 2018-11-02T                                                                                                                08:44:01.000000 | -               | False       |
| acaa6b72-fc6b-4cde-b3e7-8f1bdd25a211 | nova-conductor   | controller.example.com | internal | enabled | up    | 2018-11-02T                                                                                                                08:44:01.000000 | -               | False       |
+--------------------------------------+------------------+------------------------+----------+---------+-------+------------                                                                                                                ----------------+-----------------+-------------+
== Nova networks ==
== Nova instance flavors ==
+----+------+-----------+------+-----------+------+-------+-------------+-----------+-------------+
| ID | Name | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public | Description |
+----+------+-----------+------+-----------+------+-------+-------------+-----------+-------------+
+----+------+-----------+------+-----------+------+-------+-------------+-----------+-------------+
== Nova instances ==
+----+------+-----------+--------+------------+-------------+----------+
| ID | Name | Tenant ID | Status | Task State | Power State | Networks |
+----+------+-----------+--------+------------+-------------+----------+
+----+------+-----------+--------+------------+-------------+----------+

 

Lastly I hope the steps from the article to Install and Configure Controller node in OpenStack was helpful. So, let me know your suggestions and feedback using the comment section.

In my upcoming articles I will share the steps to Install and Configure Compute Node, Network Node, Block Storage manually in OpenStack.

 

Deepak Prasad

Deepak Prasad

He is the founder of GoLinuxCloud and brings over a decade of expertise in Linux, Python, Go, Laravel, DevOps, Kubernetes, Git, Shell scripting, OpenShift, AWS, Networking, and Security. With extensive experience, he excels in various domains, from development to DevOps, Networking, and Security, ensuring robust and efficient solutions for diverse projects. You can connect with him on his LinkedIn profile.

Can't find what you're searching for? Let us assist you.

Enter your query below, and we'll provide instant results tailored to your needs.

If my articles on GoLinuxCloud has helped you, kindly consider buying me a coffee as a token of appreciation.

Buy GoLinuxCloud a Coffee

For any other feedbacks or questions you can send mail to admin@golinuxcloud.com

Thank You for your support!!

2 thoughts on “Steps to Install and configure Controller Node in OpenStack – Part 2”

  1. I try install openstack multi node on Virtualbox. I still confuse to set up Floating IP and Network configuration on virtualbox. I still can’t remote instance from my host. If you will post next tutorial, explaination until to create external network, launch instance, and remote from host to instance through floating IP.

    Thanks you. Your tutorial help for me to understanding Openstack.

    Reply

Leave a Comment