Issues related to Instance removal in OpenStack February 2, 2018
Posted by supportec in OpenStack.add a comment
If cinder volume is not properly removed you could see the following entry in instance and you will not be able to delete it as well.
# nova show ad613fb6-7fa3-484f-8aab-72c058a58794 | grep os-extended-volumes
| os-extended-volumes:volumes_attached | [{“id”: “8b52e42b-3f49-48a6-a90f-a122b763f18f”}] |
In this case for removing os-extended-volumes entry from instance, we need to update corresponding database tables:
[nova]> select id from block_device_mapping where instance_uuid=’ad613fb6-7fa3-484f-8aab-72c058a58794′ AND volume_id=’8b52e42b-3f49-48a6-a90f-a122b763f18f’ AND deleted=0 \G
From this you will get id of the entry which need to be modified.
begin;
update block_device_mapping set deleted= <id from above query> where instance_uuid=’ad613fb6-7fa3-484f-8aab-72c058a58794′ AND volume_id=’8b52e42b-3f49-48a6-a90f-a122b763f18f’ AND deleted=0;
commit;
Here after you will be able to remove instance.
Inconsistency in DB occurs when connection error occurs while updating DB, from logs:
grep -R DBConnectionError /var/log/{nova,cinder}/ |tail -n5