Commit dcfb969a authored by Apollon Oikonomopoulos's avatar Apollon Oikonomopoulos Committed by Iustin Pop
Browse files

TLMigrateInstance: do not migrate to self

Check that the instance is not being migrated to its current primary node
during CheckPrereq. Otherwise migration is aborted because the instance is
already running and cleaned-up, which causes the running instance to be killed.
Signed-off-by: default avatarApollon Oikonomopoulos <>
Signed-off-by: default avatarIustin Pop <>
Reviewed-by: default avatarIustin Pop <>
parent 3dbe3ddf
......@@ -6565,6 +6565,10 @@ class TLMigrateInstance(Tasklet):
# self.target_node is already populated, either directly or by the
# iallocator run
target_node = self.target_node
if self.target_node == instance.primary_node:
raise errors.OpPrereqError("Cannot migrate instance %s"
" to its primary (%s)" %
(, instance.primary_node))
if len( == 1:
# It is safe to release locks only when we're the only tasklet
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment