[openstack-dev] [Nova][libvirt]when deleting instance which is in migrating state, instance files can be stay in destination node forever

王宏 w.wanghong1 at gmail.com
Mon Dec 16 11:32:20 UTC 2013

Hi all.
When I try to fix a bug:https://bugs.launchpad.net/nova/+bug/1242961,
I get a trouble.

To reproduce the bug is very easy. Live migrate a vm in block_migration
and then delelte the vm immediately.

The reason of this bug is as follow:
1. Because live migrate costs more time, so the vm will be deleted
   before live migrate complete. And then, we will get an exception while
2. After live migrate failed, we start to rollback. But, in the rollback
   we will get or modify the info of vm from db. Because the vm has been
   already, so we will get instance_not_found exception and rollback will be
   faild too.

I have two ways to fix the bug:
i)Add check in nova-api. When try to delete a vm, we return an error
message if
the vm_state is LIVE_MIGRATING. This way is very simple, but need to
consider. I have found a related discussion:
it has no result in the discussion.
ii)Before live migrate we get all the data needed by rollback method, and
add a
new rollback method. The new method will clean up resources at destination
on the above data(The resouces at source has been already cleaned up by

I have no idea whitch one I should choose. Or, any other ideas?:)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20131216/0c7587b0/attachment.html>

More information about the OpenStack-dev mailing list