Compute host already mapped during previous installation
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 !
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.
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.
I don't have an installation handy, but from my Pike notes, it's probably the table host_mappings in the nova_api database.
There is also an instance_mappings table, which tells you which instances are in which cell.
Sorry, I have no best practices for replacing a host. Perhaps it should be removed from the cell before rebuilding it.
@Bernd Bausch I has the same problem and this command mysql> select * from host_mappings; return an empty set how can solve this?