diff --git a/lib/cmdlib.py b/lib/cmdlib.py index 277a2aa00e7cac8dedf889e59c3219325187435a..d02021dea4a463291f5ed8104277932877bf6f5f 100644 --- a/lib/cmdlib.py +++ b/lib/cmdlib.py @@ -13188,10 +13188,11 @@ class IAllocator(object): fn = compat.partial(self._NodesToGroups, node2group, self.in_data["nodegroups"]) - request_groups = fn(self.relocate_from) - result_groups = fn(rdict["result"]) + instance = self.cfg.GetInstanceInfo(self.name) + request_groups = fn(self.relocate_from + [instance.primary_node]) + result_groups = fn(rdict["result"] + [instance.primary_node]) - if self.success and result_groups != request_groups: + if self.success and not set(result_groups).issubset(request_groups): raise errors.OpExecError("Groups of nodes returned by iallocator (%s)" " differ from original groups (%s)" % (utils.CommaJoin(result_groups),