Every entity in openstack maintains db in MySQL,  which is the first thing to do before installing any component during openstack installation. If you change hostname for any node after installation what happens is it will show both new and old entries.

For instance take a look at neutron agent-list on my network node.
root@stack:/var/log/nova# neutron agent-list
+--------------------------------------+--------------------+----------+-------+----------------+---------------------------+
| id                                   | agent_type         | host     | alive | admin_state_up | binary                    |
+--------------------------------------+--------------------+----------+-------+----------------+---------------------------+
| 03588302-7014-41a9-a1a7-b22dba6c8c4b | Open vSwitch agent | ubuntu   | xxx   | True           | neutron-openvswitch-agent |
| 2a7c7776-3e53-4c38-8663-a5ff2e337eed | Metadata agent     | ubuntu   | xxx   | True           | neutron-metadata-agent    |
| 66e550af-af58-4d96-a035-00f3bc2057c7 | DHCP agent         | network  | :-)   | True           | neutron-dhcp-agent        |
| 732e5f52-35ea-4ba8-be8b-c6b26f10d5df | Metadata agent     | network  | :-)   | True           | neutron-metadata-agent    |
| 759d8e43-a2f8-4305-bae5-85793ac1b46a | Open vSwitch agent | compute1 | :-)   | True           | neutron-openvswitch-agent |
| 964ae8a8-4e5e-45f1-893f-4dec689e7e03 | L3 agent           | network  | :-)   | True           | neutron-l3-agent          |
| a2d42630-3cdd-41d0-ac0e-32e97b599f6c | DHCP agent         | ubuntu   | xxx   | True           | neutron-dhcp-agent        |
| df4d1f59-8f68-4a0c-9288-61922b77c6dd | Open vSwitch agent | network  | :-)   | True           | neutron-openvswitch-agent |
| e4eddde1-0bb1-44d5-b9d9-6ed6882dd46d | L3 agent           | ubuntu   | xxx   | True           | neutron-l3-agent          |
+--------------------------------------+--------------------+----------+-------+----------------+---------------------------+
if you observe “host” and “alive” column, ubuntu host is not reachable, so “alive” column shows “xxx”. As a matter of fact it there is no host with name “ubuntu”. It was old name for network node. After changing hostname it is connected to controller and agent-list shows all my agent services and status as “:)” which mean fine. // But old entries looks ugly and difficult during debug. I want to get rid of them so i only way is to delete entries for host ubuntu in MySQL. // If you are familiar with MySQL with command line, you can delete them as i show here, other wise you can setup phpmyadmin which is a gui management tool for MySQL and easy to do stuff like this. // Let’s try command line for now. //
root@stack:~# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 373
Server version: 5.5.44-MariaDB-1ubuntu0.14.04.1 (Ubuntu)

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

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

MariaDB [(none)]> use neutron
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
MariaDB [neutron]> DELETE FROM agents WHERE host='ubuntu';
Query OK, 4 rows affected (0.00 sec)

MariaDB [neutron]> exit
Bye
you can follow the same procedure for other entities in case they have db.
Note: Becareful while deleting entries via MySQL command line.

gil ...