Commit abd8e836 authored by Iustin Pop's avatar Iustin Pop
Browse files

Run instance hooks on more nodes



This should fix issue 68: some hooks should be run on more nodes than
currently. GrowDisk runs on both nodes, remove run the post hook on the
instance's nodes, and failover and migrate run the post hook on the
source node too.

Thanks to Maxence for the initial investigation and patch.
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent 08eec276
......@@ -262,7 +262,7 @@ and secondary before failover.
:directory: instance-failover
:env. vars: IGNORE_CONSISTENCY, OLD_SECONDARY, OLD_PRIMARY, NEW_SECONDARY, NEW_PRIMARY
:pre-execution: master node, secondary node
:post-execution: master node, secondary node
:post-execution: master node, primary and secondary nodes
OP_INSTANCE_MIGRATE
++++++++++++++++++++
......@@ -274,7 +274,7 @@ and secondary before migration.
:directory: instance-migrate
:env. vars: MIGRATE_LIVE, MIGRATE_CLEANUP, OLD_SECONDARY, OLD_PRIMARY, NEW_SECONDARY, NEW_PRIMARY
:pre-execution: master node, secondary node
:post-execution: master node, secondary node
:post-execution: master node, primary and secondary nodes
OP_INSTANCE_REMOVE
......@@ -285,7 +285,7 @@ Remove an instance.
:directory: instance-remove
:env. vars: only the standard instance vars
:pre-execution: master node
:post-execution: master node
:post-execution: master node, primary and secondary nodes
OP_INSTANCE_REPLACE_DISKS
+++++++++++++++++++++++++
......@@ -304,8 +304,8 @@ Grows the disk of an instance.
:directory: disk-grow
:env. vars: DISK, AMOUNT
:pre-execution: master node, primary node
:post-execution: master node, primary node
:pre-execution: master node, primary and secondary nodes
:post-execution: master node, primary and secondary nodes
OP_INSTANCE_RENAME
++++++++++++++++++
......
......@@ -4228,7 +4228,8 @@ class LURemoveInstance(LogicalUnit):
env = _BuildInstanceHookEnvByObject(self, self.instance)
env["SHUTDOWN_TIMEOUT"] = self.shutdown_timeout
nl = [self.cfg.GetMasterNode()]
return env, nl, nl
nl_post = list(self.instance.all_nodes) + nl
return env, nl, nl_post
def CheckPrereq(self):
"""Check prerequisites.
......@@ -4600,7 +4601,9 @@ class LUFailoverInstance(LogicalUnit):
}
env.update(_BuildInstanceHookEnvByObject(self, instance))
nl = [self.cfg.GetMasterNode()] + list(instance.secondary_nodes)
return env, nl, nl
nl_post = list(nl)
nl_post.append(source_node)
return env, nl, nl_post
def CheckPrereq(self):
"""Check prerequisites.
......@@ -4754,7 +4757,9 @@ class LUMigrateInstance(LogicalUnit):
"NEW_SECONDARY": source_node,
})
nl = [self.cfg.GetMasterNode()] + list(instance.secondary_nodes)
return env, nl, nl
nl_post = list(nl)
nl_post.append(source_node)
return env, nl, nl_post
class LUMoveInstance(LogicalUnit):
......@@ -7272,10 +7277,7 @@ class LUGrowDisk(LogicalUnit):
"AMOUNT": self.op.amount,
}
env.update(_BuildInstanceHookEnvByObject(self, self.instance))
nl = [
self.cfg.GetMasterNode(),
self.instance.primary_node,
]
nl = [self.cfg.GetMasterNode()] + list(self.instance.all_nodes)
return env, nl, nl
def CheckPrereq(self):
......
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