:directory: instance-failover
:env. vars: IGNORE_CONSISTENCY, SHUTDOWN_TIMEOUT, OLD_PRIMARY, OLD_SECONDARY, NEW_PRIMARY, NEW_SECONDARY
-:pre-execution: master node, secondary node
-:post-execution: master node, primary and secondary nodes
+:pre-execution: master node, secondary (target) node
+:post-execution: master node, primary (source) and secondary (target) nodes
OP_INSTANCE_MIGRATE
++++++++++++++++++++
:directory: instance-migrate
:env. vars: MIGRATE_LIVE, MIGRATE_CLEANUP, OLD_PRIMARY, OLD_SECONDARY, NEW_PRIMARY, NEW_SECONDARY
-:pre-execution: master node, primary and secondary nodes
-:post-execution: master node, primary and secondary nodes
+:pre-execution: master node, primary (source) and secondary (target) nodes
+:post-execution: master node, primary (source) and secondary (target) nodes
OP_INSTANCE_REMOVE
"""
instance = self._migrater.instance
source_node = instance.primary_node
- target_node = self.op.target_node
+ target_node = self._migrater.target_node
env = {
"IGNORE_CONSISTENCY": self.op.ignore_consistency,
"SHUTDOWN_TIMEOUT": self.op.shutdown_timeout,
"""
instance = self._migrater.instance
nl = [self.cfg.GetMasterNode()] + list(instance.secondary_nodes)
+ nl.append(self._migrater.target_node)
return (nl, nl + [instance.primary_node])
"""
instance = self._migrater.instance
source_node = instance.primary_node
- target_node = self.op.target_node
+ target_node = self._migrater.target_node
env = BuildInstanceHookEnvByObject(self, instance)
env.update({
"MIGRATE_LIVE": self._migrater.live,
env["OLD_SECONDARY"] = target_node
env["NEW_SECONDARY"] = source_node
else:
- env["OLD_SECONDARY"] = env["NEW_SECONDARY"] = None
+ env["OLD_SECONDARY"] = env["NEW_SECONDARY"] = ""
return env
instance = self._migrater.instance
snodes = list(instance.secondary_nodes)
nl = [self.cfg.GetMasterNode(), instance.primary_node] + snodes
+ nl.append(self._migrater.target_node)
return (nl, nl)
raise errors.ConfigurationError("No secondary node but using"
" %s disk template" %
instance.disk_template)
- target_node = secondary_nodes[0]
+ self.target_node = target_node = secondary_nodes[0]
if self.lu.op.iallocator or (self.lu.op.target_node and
self.lu.op.target_node != target_node):
if self.failover: