Calculate correct affected nodes set in InstanceChangeGroup
authorOleg Ponomarev <oponomarev@google.com>
Fri, 20 Nov 2015 20:45:11 +0000 (21:45 +0100)
committerOleg Ponomarev <oponomarev@google.com>
Mon, 23 Nov 2015 11:08:03 +0000 (12:08 +0100)
This is the fix for the issue 1144. The nodes affected by the
InstanceChangeGroup logical unit were calculated incorrectly and that
broke 'gnt-instance change-group --to' operation. This patch fixes it.

Signed-off-by: Oleg Ponomarev <oponomarev@google.com>
Reviewed-by: Lisa Velden <velden@google.com>

lib/cmdlib/instance.py

index 4e5d191..9fc14d4 100644 (file)
@@ -4137,7 +4137,7 @@ class LUInstanceChangeGroup(LogicalUnit):
         self._LockInstancesNodes()
 
         # Lock all nodes in all potential target groups
-        lock_groups = (frozenset(self.owned_locks(locking.LEVEL_NODEGROUP)) -
+        lock_groups = (frozenset(self.owned_locks(locking.LEVEL_NODEGROUP)) |
                        self.cfg.GetInstanceNodeGroups(self.op.instance_uuid))
         member_nodes = [node_uuid
                         for group in lock_groups