Remove Old or Failed Hosts from Openstack

09/06/2014 // 0 Comments

If you are testing or running production Openstack environment, you will probably face a failed host. Unfortunately, there is no “button” to remove it from Openstack. It would be a nice touch, but there are lots of important things to develop. You can remove the host by removing from database. I try to guide you about it. Before doing anything: BACKUP your database!!! Do not do anything before backing up your database, you should be aware of that. These commands tested with Openstack Havana version installed in Ubuntu 12.04 LTS servers. Mysql server is 5.5.   Firstly, backup your database!!! Login to your mysql db and select Nova database (I used default database name here);

Check your host and it’s ID;

As you can see, we have a service_id and id for our hosts. I want to remove NODE05. Clean compute_node_stats table: Now, we need to clean the stats of NODE05 from compute_node_stats table. We need to use id number of compute_nodes table. As you can see, id is 3 for NODE05;

Clean compute_nodes table: We will use service_id of NODE05 in the compute_nodes table to delete the data:

Clean services table:

Check the dashboard, it will no longer display NODE05.