Ask Your Question
0

Compute host already mapped during previous installation

asked 2018-04-25 03:06:21 -0500

full_moon gravatar image

updated 2018-04-30 06:14:09 -0500

Due to problems I have reinstalled Nova and Neutron on a compute node named "compute1" (same FQDN as the previous installation).

Compute1 information:

openstack-nova-common-16.1.1-1.el7.noarch
python2-novaclient-9.1.1-1.el7.noarch
python-nova-16.1.1-1.el7.noarch
openstack-nova-compute-16.1.1-1.el7.noarch

Controller information:

openstack pike 3.12.0
openstack-nova-scheduler-16.0.3-2.el7.noarch
openstack-nova-compute-16.0.3-2.el7.noarch
openstack-nova-console-16.0.3-2.el7.noarch
python2-novaclient-9.1.1-1.el7.noarch
python-nova-16.0.3-2.el7.noarch
openstack-nova-common-16.0.3-2.el7.noarch
openstack-nova-conductor-16.0.3-2.el7.noarch
openstack-nova-api-16.0.3-2.el7.noarch
openstack-nova-placement-api-16.0.3-2.el7.noarch
openstack-nova-novncproxy-16.0.3-2.el7.noarch

When adding this node to the controller :

[root@controller]# 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': aa272958-d52a-4403-b3a7-4a9413693210
Found 1 unmapped computes in cell: aa272958-d52a-4403-b3a7-4a9413693210
Checking host mapping for compute host 'compute1': 2e7ba8e7-61f6-4990-aa5c-8d1b9b9aede3

The following line is missing due to the fact that compute1 is already added in the cell (during first install):

Creating host mapping for compute host 'compute1': 2e7ba8e7-61f6-4990-a5c-8d1b9b9aede3

Compute1 is (already) listed by nova-manage:

[root@controller]# nova-manage host list
host                         zone          
...         
compute1                 nova          

[root@controller]# nova-manage cell_v2 map_cell_and_hosts --verbose
Host compute1 is already mapped to cell aa272958-d52a-4403-b3a7-4a9413693210
All hosts are already mapped to cell(s), exiting.

How to (re)create/erase the mapping between compute1 and cell1 ?

If the compute node is already present in the cell, but with an other id, how to reset it or how to remove the compute node from nova controller ?

Why this node is unmapped for command :

nova-manage cell_v2 discover_host

and mapped for command :

nova-manage host list

I can't find the delete_host command:

[root@computer1]# nova-manage cell_v2 delete_host --cell_uuid aa272958-d52a-4403-b3a7-4a9413693210 --host computer1
usage: nova-manage cell_v2 [-h]

                           {create_cell,delete_cell,discover_hosts,list_cells,map_cell0,map_cell_and_hosts,map_instances,simple_cell_setup,update_cell,verify_instance}
                           ...
nova-manage cell_v2: error: argument action: invalid choice: 'delete_host' (choose from 'create_cell', 'delete_cell', 'discover_hosts', 'list_cells', 'map_cell0', 'map_cell_and_hosts', 'map_instances', 'simple_cell_setup', 'update_cell', 'verify_instance')


[root@computer1]# nova-manage --version
16.0.3

What is the procedure when reinstalling a node and keeping the hostname ?

It seems that there is no procedure to perform that...

Thanks a lot for your help !

edit retag flag offensive close merge delete

Comments

I would have thought that nothing needs to be done at cell level. But there is a delete_host command, did you try it? In the worst case, find compute1 in the database and remove it manually.

Bernd Bausch gravatar imageBernd Bausch ( 2018-04-29 20:43:10 -0500 )edit

I have seen this command in the doc but this action doesn't exists (I add the result of command in my post). It seems to be a new feature since v17.0.0 (Queens) and I use Pike (v16.0.3). So, How can I delete it from DB ? From which tables ?

Thanks for your help.

full_moon gravatar imagefull_moon ( 2018-04-30 06:12:53 -0500 )edit

I don't have an installation handy, but from my Pike notes, it's probably the table host_mappings in the nova_api database.

mysql> use nova_api
mysql> select * from host_mappings;

There is also an instance_mappings table, which tells you which instances are in which cell.

Bernd Bausch gravatar imageBernd Bausch ( 2018-04-30 19:39:27 -0500 )edit

Sorry, I have no best practices for replacing a host. Perhaps it should be removed from the cell before rebuilding it.

Bernd Bausch gravatar imageBernd Bausch ( 2018-04-30 19:40:05 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2018-05-01 07:05:07 -0500

full_moon gravatar image

updated 2018-05-02 07:25:52 -0500

Ok Bernd Bausch, here are results:

MariaDB [nova_api]> select * from host_mappings;
+---------------------+------------+----+---------+--------------------------+
| created_at          | updated_at | id | cell_id | host            |
+---------------------+------------+----+---------+--------------------------+
|.....                                                                             |
| 2018-02-19 13:38:22 | NULL       |  8 |       2 | computer1 |
+---------------------+------------+----+---------+--------------------------+

All hosts are in cell_id=2

I only have to remove this entry ? Nothing to remove/update in other tables or database ?

Instance_mappings table contents 201 rows. If no VM runs on computer1 I have no action to perform on this table, right ?

Thanks for your help !


To remove a node (not running any VM) under Pike in case of a re-installation (same FQDN) and adding it again we have to remove it manually from DB and insert it again via nova-manage:

MariaDB [(none)]> use nova_api;

Database changed
MariaDB [nova_api]> select * from host_mappings;
+---------------------+------------+----+---------+--------------------------+
| created_at          | updated_at | id | cell_id | host                   |
+---------------------+------------+----+---------+--------------------------+
| 2018-02-19 13:38:22 | NULL       |  8 |       2 | computer1     |
+---------------------+------------+----+---------+--------------------------+
8 rows in set (0,00 sec)

MariaDB [nova_api]> delete from host_mappings where id=8;
Query OK, 1 row affected (0,02 sec)

[root@controller]# 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': aa272958-d52a-4403-b3a7-4a9413693210
Found 1 unmapped computes in cell: aa272958-d52a-4403-b3a7-4a9413693210
Checking host mapping for compute host 'computer1': 2e7ba8e7-61f6-4990-aa5c-8d1b9b9aede3
Creating host mapping for compute host 'computer1': 2e7ba8e7-61f6-4990-aa5c-8d1b9b9aede3

Thanks Bernd Bausch for your help !

edit flag offensive delete link more

Comments

Well, I am not 100% certain, but it's very probably yes in both cases. Usually the tables have constraints that will prevent you from causing too much damage.

Bernd Bausch gravatar imageBernd Bausch ( 2018-05-01 09:34:46 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

Stats

Asked: 2018-04-25 03:06:21 -0500

Seen: 244 times

Last updated: May 02