Comment 0 for bug 1821594

Revision history for this message
Rodrigo Barbieri (rodrigo-barbieri2010) wrote : Error in confirm_migration leaves stale allocations and 'confirming' migration state

Description:

When performing a cold migration, if an exception is raised by the driver during confirm_migration (this runs in the source node), the migration record is stuck in "confirming" state and the allocations against the source node are not removed.

The instance is fine at the destination in this stage, but the source host has allocations that is not possible to clean without going to the database or invoking the Placement API via curl. After several migration attempts that fail in the same spot, the source node is filled with these allocations that prevent new instances from being created or instances migrated to this node.

When confirm_migration fails in this stage, the migrating instance can be saved through a hard reboot or a reset state to active.

Steps to reproduce:

Unfortunately, I don't have logs of the real root cause of the problem inside driver.confirm_migration running libvirt driver. However, the stale allocations and migration status problem can be easily reproduced by raising an exception in libvirt driver's confirm_migration method, and it would affect any driver.

Expected results:

Discussed this issue with efried and mriedem over #openstack-nova on March 25th, 2019. They confirmed that allocations not being cleared up is a bug.

Actual results:

Instance is fine at the destination after a reset-state. Source node has stale allocations that prevent new instances from being created/migrated to the source node. Migration record is stuck in "confirming" state.

Environment:

I verified this bug on on pike, queens and stein branches. Running libvirt KVM driver.