Stop filtering out 'accepted' for in-progress migrations
Live migrations are created with an 'accepted' status. Resource claims
on the destination are done with the migration in 'accepted' status.
The status is set to 'preparing' a bit later, right before running
pre_live_migration(). Migrations with status 'accepted' are filtered
out by the database layer when getting in-progress migrations. Thus,
there's a time window after resource claims but before 'preparing'
during which resources have been claimed but the migration is not
considered in-progress by the database layer. During that window, the
instance's host is the source - that's only updated once the live
migration finishes. If the update available resources periodic task
runs during that window, it'll free the instance's resource from the
destination because neither the instance nor any of its in-progress
migrations are associated with the destination. This means that other
incoming instances are able to consume resources that should not be
available. This patch stops filtering out the 'accepted' status in the
database layer when retrieving in-progress migrations.
Change-Id: I4c56925ed35bc3275ca1ac6c30d7fd641ad84260
Closes-bug: 1845146
(cherry picked from commit 6ec686c26b2c8b18bcff522633bfe9715e0feec3)
Reviewed: https:/ /review. opendev. org/685387 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=45c2ba37bc2 1370d9814b81cd8 92abc3cb8a9f04
Committed: https:/
Submitter: Zuul
Branch: stable/train
commit 45c2ba37bc21370 d9814b81cd892ab c3cb8a9f04
Author: Artom Lifshitz <email address hidden>
Date: Tue Sep 24 13:22:23 2019 -0400
Stop filtering out 'accepted' for in-progress migrations
Live migrations are created with an 'accepted' status. Resource claims live_migration( ). Migrations with status 'accepted' are filtered
on the destination are done with the migration in 'accepted' status.
The status is set to 'preparing' a bit later, right before running
pre_
out by the database layer when getting in-progress migrations. Thus,
there's a time window after resource claims but before 'preparing'
during which resources have been claimed but the migration is not
considered in-progress by the database layer. During that window, the
instance's host is the source - that's only updated once the live
migration finishes. If the update available resources periodic task
runs during that window, it'll free the instance's resource from the
destination because neither the instance nor any of its in-progress
migrations are associated with the destination. This means that other
incoming instances are able to consume resources that should not be
available. This patch stops filtering out the 'accepted' status in the
database layer when retrieving in-progress migrations.
Change-Id: I4c56925ed35bc3 275ca1ac6c30d7f d641ad84260 8bcff522633bfe9 715e0feec3)
Closes-bug: 1845146
(cherry picked from commit 6ec686c26b2c8b1