본문 바로가기

Cloud/Openstack

[Centos7/Openstack]OpenstackNOVA

Controller

 

Prerequisite

1. To create the databases, complete these steps

[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)]>

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

 

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)

Create the nova_api, nova, and nova_cell0 databases

 

 

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


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


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


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


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


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

Grant proper access to the databases. Replace dkagh1. with a suitable password.

I set a NOVA_DBPASS to dkagh1. 

Then exit the databases access client.

 

 

2. Source the admin credentials to gain access to admin-only CLI connamd

 

3. Create the Compute service credentials

[root@controller ~]# systemctl status openstack-nova-api
● openstack-nova-api.service - OpenStack Nova API Server
   Loaded: loaded (/usr/lib/systemd/system/openstack-nova-api.service; enabled; vendor preset: disabled)
   Active: activating (auto-restart) (Result: exit-code) since Thu 2023-09-28 21:20:10 KST; 94ms ago
  Process: 11513 ExecStart=/usr/bin/nova-api (code=exited, status=1/FAILURE)
 Main PID: 11513 (code=exited, status=1/FAILURE)

Sep 28 21:20:10 controller systemd[1]: Failed to start OpenStack Nova API Server.
Sep 28 21:20:10 controller systemd[1]: Unit openstack-nova-api.service entered failed state.
Sep 28 21:20:10 controller systemd[1]: openstack-nova-api.service failed.
[root@controller ~]# tail /var/lo
local/ lock/  log/
[root@controller ~]# tail /var/log/nova/nova-
nova-api.log            nova-conductor.log      nova-consoleauth.log    nova-manage.log         nova-novncproxy.log     nova-placement-api.log  nova-scheduler.log
[root@controller ~]# tail /var/log/nova/nova-api.log
2023-09-28 21:20:49.158 11711 ERROR nova   File "/usr/lib/python2.7/site-packages/keystonemiddleware/auth_token/__init__.py", line 587, in __init__
2023-09-28 21:20:49.158 11711 ERROR nova     self._auth = self._create_auth_plugin()
2023-09-28 21:20:49.158 11711 ERROR nova   File "/usr/lib/python2.7/site-packages/keystonemiddleware/auth_token/__init__.py", line 926, in _create_auth_plugin
2023-09-28 21:20:49.158 11711 ERROR nova     return plugin_loader.load_from_options_getter(getter)
2023-09-28 21:20:49.158 11711 ERROR nova   File "/usr/lib/python2.7/site-packages/keystoneauth1/loading/base.py", line 187, in load_from_options_getter
2023-09-28 21:20:49.158 11711 ERROR nova     return self.load_from_options(**kwargs)
2023-09-28 21:20:49.158 11711 ERROR nova   File "/usr/lib/python2.7/site-packages/keystoneauth1/loading/base.py", line 162, in load_from_options
2023-09-28 21:20:49.158 11711 ERROR nova     raise exceptions.MissingRequiredOptions(missing_required)
2023-09-28 21:20:49.158 11711 ERROR nova MissingRequiredOptions: Auth plugin requires parameters which were not given: auth_url
2023-09-28 21:20:49.158 11711 ERROR nova
[root@controller ~]# systemctl status openstack-nova-api
● 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 2023-09-28 21:24:18 KST; 5s ago
 Main PID: 12688 (nova-api)
   CGroup: /system.slice/openstack-nova-api.service
           ├─12688 /usr/bin/python2 /usr/bin/nova-api
           ├─12701 /usr/bin/python2 /usr/bin/nova-api
           ├─12702 /usr/bin/python2 /usr/bin/nova-api
           ├─12703 /usr/bin/python2 /usr/bin/nova-api
           ├─12707 /usr/bin/python2 /usr/bin/nova-api
           ├─12708 /usr/bin/python2 /usr/bin/nova-api
           └─12709 /usr/bin/python2 /usr/bin/nova-api

Sep 28 21:24:15 controller systemd[1]: Starting OpenStack Nova API Server...
Sep 28 21:24:18 controller systemd[1]: Started OpenStack Nova API Server.

Compute 

1. Install the packages

 

2. Edit the /etc/nova/nova.conf file and complete the following action

 

 

 

 


Verify

[root@controller ~]# . admin-openrc
[root@controller ~]# openstack compute service list
+----+----------------+------------+----------+---------+-------+----------------------------+
| ID | Binary         | Host       | Zone     | Status  | State | Updated At                 |
+----+----------------+------------+----------+---------+-------+----------------------------+
|  1 | nova-scheduler | controller | internal | enabled | up    | 2023-10-07T01:11:57.000000 |
|  2 | nova-conductor | controller | internal | enabled | up    | 2023-10-07T01:11:57.000000 |
|  6 | nova-compute   | compute1   | nova     | enabled | up    | 2023-10-07T01:11:49.000000 |
+----+----------------+------------+----------+---------+-------+----------------------------+
[root@controller ~]# openstack catalog list
+----------+----------+-----------------------------------------+
| Name     | Type     | Endpoints                               |
+----------+----------+-----------------------------------------+
| neutron  | network  | RegionOne                               |
|          |          |   admin: http://controller:9696         |
|          |          | RegionOne                               |
|          |          |   internal: http://controller:9696      |
|          |          | RegionOne                               |
|          |          |   public: http://controller:9696        |
|          |          |                                         |
| glance   | image    | RegionOne                               |
|          |          |   internal: http://controller:9292      |
|          |          | RegionOne                               |
|          |          |   admin: http://controller:9292         |
|          |          | RegionOne                               |
|          |          |   public: http://controller:9292        |
|          |          |                                         |
| keystone | identity | RegionOne                               |
|          |          |   public: http://controller:5000/v3/    |
|          |          | RegionOne                               |
|          |          |   internal: http://controller:5000/v3/  |
|          |          | RegionOne                               |
|          |          |   admin: http://controller:5000/v3/     |
|          |          |                                         |
| nova     | compute  | RegionOne                               |
|          |          |   internal: http://controller:8774/v2.1 |
|          |          | RegionOne                               |
|          |          |   public: http://controller:8774/v2.1   |
|          |          | RegionOne                               |
|          |          |   admin: http://controller:8774/v2.1    |
|          |          |                                         |
+----------+----------+-----------------------------------------+
[root@controller ~]# openstack image list
+--------------------------------------+--------+--------+
| ID                                   | Name   | Status |
+--------------------------------------+--------+--------+
| a6299471-d40e-43cc-b420-b1025181b968 | cirros | active |
+--------------------------------------+--------+--------+
[root@controller ~]# nova-status upgrade check
+-----------------------------------------------------+
| Upgrade Check Results                               |
+-----------------------------------------------------+
| Check: Cells v2                                     |
| Result: Success                                     |
| Details: None                                       |
+-----------------------------------------------------+
| Check: Placement API                                |
| Result: Failure                                     |
| Details: Placement service credentials do not work. |
+-----------------------------------------------------+
| Check: Ironic Flavor Migration                      |
| Result: Success                                     |
| Details: None                                       |
+-----------------------------------------------------+
| Check: Request Spec Migration                       |
| Result: Success                                     |
| Details: None                                       |
+-----------------------------------------------------+
| Check: Console Auths                                |
| Result: Success                                     |
| Details: None                                       |
+-----------------------------------------------------+