# Instance marked as deleted but still present on host?

I have deployed Openstack in a testing environment consisting of three hosts. One controller node and two compute nodes (using KVM).

At one point in my testing, I terminated all instances. However, for some reason nova-compute was not responding on the second compute node. The VM which was active on this node is now no longer present in Openstack, e.g. using:

nova-manage vm list
nova list --all-tenants



I get the following in nova-compute.log from the second compute node:

 WARNING nova.compute.manager [-] [instance: a4705c75-96e5-42ba-8da6-d998d05fdda6] Detected instance with name label 'instance-0000002b' which is marked as DELETED but still present on host.


How do I force deletion of this instance?

Thank you very much in advance

edit retag close merge delete

Sort by » oldest newest most voted

Hello,

I found the following option for nova.conf

 running_deleted_instance_action=log

(StrOpt) Action to take if a running deleted instance is detected.Valid options are 'noop', 'log' and 'reap'. Set to 'noop' to disable.


By setting it to "reap" the instances are deleted automatically.

more

2

( 2013-06-28 06:17:05 -0500 )edit

Hi , I have also faced such issue long time back. Usually in openstack when you delete an instance the corresponding entry in DB is marked as deleted and nova-compute trigger the destroy instance from Hypervisor, but in your case compute service stops working in between. If you want to destroy those instance from that compute node you can try : virsh destroy <VM>

more

For reference this method did not work in our case /var/log/nova/compute.log showed:

2014-08-20 10:50:09.606 32739 WARNING nova.compute.manager [-] [instance: 9be70f4c-a697-49ea-b426-673d87aa1bd3] Periodic cleanup failed to delete instance: Info cache for instance 9be70f4c-a697-49ea-b426-673d87aa1bd3 could not be found.

more

cleanup_running_deleted_instances in nova.conf works for me but there is timeout option to i believe default is 300 so around 5 minute.

more

Hi, I think you have found the answer for your question (so this question can be closed now)!

Following is a detailed explanation for better understanding: Nova Compute has a periodic task '_cleanup_running_deleted_instances' which monitors any such instances which are marked deleted in (nova) DB but are running on the hypervisor. But AFAIR the default action of this periodic task is 'log' which only emits a log message.

Solution: For such instances to be cleaned up/destroyed, change the action for this periodic task to 'reap' by setting this value for 'running_deleted_instance_action' config parameter in nova.conf.

more