Commit f0edfcf6 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

Remove iallocator's “multi-evacuate” mode



It is no longer used and has been deprecated in 2.5.
Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 58aa30d7
......@@ -190,15 +190,16 @@ In all cases, it includes:
type
the request type; this can be either ``allocate``, ``relocate``,
``change-group``, ``node-evacuate`` or ``multi-evacuate``. The
``change-group`` or ``node-evacuate``. The
``allocate`` request is used when a new instance needs to be placed
on the cluster. The ``relocate`` request is used when an existing
instance needs to be moved within its node group.
The ``multi-evacuate`` protocol used to request that the script
computes the optimal relocate solution for all secondary instances
of the given nodes. It is now deprecated and should no longer be
used.
of the given nodes. It is now deprecated and needs only be
implemented if backwards compatibility with Ganeti 2.4 and lower is
needed.
The ``change-group`` request is used to relocate multiple instances
across multiple node groups. ``node-evacuate`` evacuates instances
......@@ -302,12 +303,6 @@ As for ``node-evacuate``, it needs the following request arguments:
should be considered for relocating instances to; type
*list of strings*
Finally, in the case of multi-evacuate, there's one single request
argument (in addition to ``type``):
evac_nodes
the names of the nodes to be evacuated; type *list of strings*
Response message
~~~~~~~~~~~~~~~~
......@@ -335,9 +330,6 @@ result
serialized opcodes; see the :ref:`design document
<multi-reloc-result>` for a detailed description
for multi-evacuation mode, this is a list of lists; each element of
the list is a list of instance name and the new secondary node
.. note:: Current Ganeti version accepts either ``result`` or ``nodes``
as a backwards-compatibility measure (older versions only supported
``nodes``)
......@@ -505,19 +497,6 @@ Input message, reallocation::
}
}
Input message, node evacuation::
{
"version": 2,
...
"request": {
"type": "multi-evacuate",
"evac_nodes": [
"node2"
],
}
}
Response messages
~~~~~~~~~~~~~~~~~
......
......@@ -163,7 +163,6 @@ def TestAllocator(opts, args):
op = opcodes.OpTestAllocator(mode=opts.mode,
name=args[0],
evac_nodes=args,
instances=args,
memory=opts.memory,
disks=disks,
......
......@@ -12759,7 +12759,6 @@ class IAllocator(object):
self.hypervisor = None
self.relocate_from = None
self.name = None
self.evac_nodes = None
self.instances = None
self.evac_mode = None
self.target_groups = []
......@@ -13041,15 +13040,6 @@ class IAllocator(object):
}
return request
def _AddEvacuateNodes(self):
"""Add evacuate nodes data to allocator structure.
"""
request = {
"evac_nodes": self.evac_nodes
}
return request
def _AddNodeEvacuate(self):
"""Get data for node-evacuate requests.
......@@ -13130,9 +13120,6 @@ class IAllocator(object):
(_AddRelocateInstance,
[("name", ht.TString), ("relocate_from", _STRING_LIST)],
ht.TList),
constants.IALLOCATOR_MODE_MEVAC:
(_AddEvacuateNodes, [("evac_nodes", _STRING_LIST)],
ht.TListOf(ht.TAnd(ht.TIsLength(2), _STRING_LIST))),
constants.IALLOCATOR_MODE_NODE_EVAC:
(_AddNodeEvacuate, [
("instances", _STRING_LIST),
......@@ -13191,8 +13178,7 @@ class IAllocator(object):
(self._result_check, self.result),
errors.ECODE_INVAL)
if self.mode in (constants.IALLOCATOR_MODE_RELOC,
constants.IALLOCATOR_MODE_MEVAC):
if self.mode == constants.IALLOCATOR_MODE_RELOC:
node2group = dict((name, ndata["group"])
for (name, ndata) in self.in_data["nodes"].items())
......@@ -13211,17 +13197,6 @@ class IAllocator(object):
" differ from original groups (%s)" %
(utils.CommaJoin(result_groups),
utils.CommaJoin(request_groups)))
elif self.mode == constants.IALLOCATOR_MODE_MEVAC:
request_groups = fn(self.evac_nodes)
for (instance_name, secnode) in self.result:
result_groups = fn([secnode])
if result_groups != request_groups:
raise errors.OpExecError("Iallocator returned new secondary node"
" '%s' (group '%s') for instance '%s'"
" which is not in original group '%s'" %
(secnode, utils.CommaJoin(result_groups),
instance_name,
utils.CommaJoin(request_groups)))
else:
raise errors.ProgrammerError("Unhandled mode '%s'" % self.mode)
......@@ -13307,10 +13282,6 @@ class LUTestAllocator(NoHooksLU):
self.op.name = fname
self.relocate_from = \
list(self.cfg.GetInstanceInfo(fname).secondary_nodes)
elif self.op.mode == constants.IALLOCATOR_MODE_MEVAC:
if not hasattr(self.op, "evac_nodes"):
raise errors.OpPrereqError("Missing attribute 'evac_nodes' on"
" opcode input", errors.ECODE_INVAL)
elif self.op.mode in (constants.IALLOCATOR_MODE_CHG_GROUP,
constants.IALLOCATOR_MODE_NODE_EVAC):
if not self.op.instances:
......@@ -13351,10 +13322,6 @@ class LUTestAllocator(NoHooksLU):
name=self.op.name,
relocate_from=list(self.relocate_from),
)
elif self.op.mode == constants.IALLOCATOR_MODE_MEVAC:
ial = IAllocator(self.cfg, self.rpc,
mode=self.op.mode,
evac_nodes=self.op.evac_nodes)
elif self.op.mode == constants.IALLOCATOR_MODE_CHG_GROUP:
ial = IAllocator(self.cfg, self.rpc,
mode=self.op.mode,
......
......@@ -1025,13 +1025,11 @@ VALID_IALLOCATOR_DIRECTIONS = frozenset([
])
IALLOCATOR_MODE_ALLOC = "allocate"
IALLOCATOR_MODE_RELOC = "relocate"
IALLOCATOR_MODE_MEVAC = "multi-evacuate"
IALLOCATOR_MODE_CHG_GROUP = "change-group"
IALLOCATOR_MODE_NODE_EVAC = "node-evacuate"
VALID_IALLOCATOR_MODES = frozenset([
IALLOCATOR_MODE_ALLOC,
IALLOCATOR_MODE_RELOC,
IALLOCATOR_MODE_MEVAC,
IALLOCATOR_MODE_CHG_GROUP,
IALLOCATOR_MODE_NODE_EVAC,
])
......
......@@ -1541,8 +1541,6 @@ class OpTestAllocator(OpCode):
("vcpus", None, ht.TOr(ht.TNone, ht.TPositiveInt), None),
("os", None, ht.TMaybeString, None),
("disk_template", None, ht.TMaybeString, None),
("evac_nodes", None, ht.TOr(ht.TNone, ht.TListOf(ht.TNonEmptyString)),
None),
("instances", None, ht.TOr(ht.TNone, ht.TListOf(ht.TNonEmptyString)),
None),
("evac_mode", None,
......
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