Commit 8de1f1ee authored by Iustin Pop's avatar Iustin Pop
Browse files

Remove the obsolete EvacuateNode OpCode/LU



All code has been switched to the new-style LU… time for cleanup.
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
parent 941b9309
......@@ -7322,93 +7322,6 @@ class LUReplaceDisks(LogicalUnit):
return env, nl, nl
class LUEvacuateNode(LogicalUnit):
"""Relocate the secondary instances from a node.
"""
HPATH = "node-evacuate"
HTYPE = constants.HTYPE_NODE
_OP_REQP = ["node_name"]
_OP_DEFS = [
("remote_node", None),
("iallocator", None),
("early_release", False),
]
REQ_BGL = False
def CheckArguments(self):
TLReplaceDisks.CheckArguments(constants.REPLACE_DISK_CHG,
self.op.remote_node,
self.op.iallocator)
def ExpandNames(self):
self.op.node_name = _ExpandNodeName(self.cfg, self.op.node_name)
self.needed_locks = {}
# Declare node locks
if self.op.iallocator is not None:
self.needed_locks[locking.LEVEL_NODE] = locking.ALL_SET
elif self.op.remote_node is not None:
self.op.remote_node = _ExpandNodeName(self.cfg, self.op.remote_node)
# Warning: do not remove the locking of the new secondary here
# unless DRBD8.AddChildren is changed to work in parallel;
# currently it doesn't since parallel invocations of
# FindUnusedMinor will conflict
self.needed_locks[locking.LEVEL_NODE] = [self.op.remote_node]
self.recalculate_locks[locking.LEVEL_NODE] = constants.LOCKS_APPEND
else:
raise errors.OpPrereqError("Invalid parameters", errors.ECODE_INVAL)
# Create tasklets for replacing disks for all secondary instances on this
# node
names = []
tasklets = []
for inst in _GetNodeSecondaryInstances(self.cfg, self.op.node_name):
logging.debug("Replacing disks for instance %s", inst.name)
names.append(inst.name)
replacer = TLReplaceDisks(self, inst.name, constants.REPLACE_DISK_CHG,
self.op.iallocator, self.op.remote_node, [],
True, self.op.early_release)
tasklets.append(replacer)
self.tasklets = tasklets
self.instance_names = names
# Declare instance locks
self.needed_locks[locking.LEVEL_INSTANCE] = self.instance_names
def DeclareLocks(self, level):
# If we're not already locking all nodes in the set we have to declare the
# instance's primary/secondary nodes.
if (level == locking.LEVEL_NODE and
self.needed_locks[locking.LEVEL_NODE] is not locking.ALL_SET):
self._LockInstancesNodes()
def BuildHooksEnv(self):
"""Build hooks env.
This runs on the master, the primary and all the secondaries.
"""
env = {
"NODE_NAME": self.op.node_name,
}
nl = [self.cfg.GetMasterNode()]
if self.op.remote_node is not None:
env["NEW_SECONDARY"] = self.op.remote_node
nl.append(self.op.remote_node)
return (env, nl, nl)
class TLReplaceDisks(Tasklet):
"""Replaces disks for an instance.
......
......@@ -183,7 +183,6 @@ class Processor(object):
opcodes.OpRemoveNode: cmdlib.LURemoveNode,
opcodes.OpSetNodeParams: cmdlib.LUSetNodeParams,
opcodes.OpPowercycleNode: cmdlib.LUPowercycleNode,
opcodes.OpEvacuateNode: cmdlib.LUEvacuateNode,
opcodes.OpMigrateNode: cmdlib.LUMigrateNode,
opcodes.OpNodeEvacuationStrategy: cmdlib.LUNodeEvacuationStrategy,
# instance lu
......
......@@ -432,15 +432,6 @@ class OpPowercycleNode(OpCode):
]
class OpEvacuateNode(OpCode):
"""Relocate secondary instances from a node."""
OP_ID = "OP_NODE_EVACUATE"
OP_DSC_FIELD = "node_name"
__slots__ = [
"node_name", "remote_node", "iallocator", "early_release",
]
class OpMigrateNode(OpCode):
"""Migrate all instances from a node."""
OP_ID = "OP_NODE_MIGRATE"
......
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