diff --git a/lib/cmdlib.py b/lib/cmdlib.py index c89e9a0cb06b749f2f77763c33986075ebe8538b..ae50552450595a680e529872434d8b359207aebe 100644 --- a/lib/cmdlib.py +++ b/lib/cmdlib.py @@ -3941,8 +3941,15 @@ class LUCreateInstance(LogicalUnit): # Remove the temp. assignements for the instance's drbds self.cfg.ReleaseDRBDMinors(instance) # Unlock all the nodes - self.context.glm.release(locking.LEVEL_NODE) - del self.acquired_locks[locking.LEVEL_NODE] + if self.op.mode == constants.INSTANCE_IMPORT: + nodes_keep = [self.op.src_node] + nodes_release = [node for node in self.acquired_locks[locking.LEVEL_NODE] + if node != self.op.src_node] + self.context.glm.release(locking.LEVEL_NODE, nodes_release) + self.acquired_locks[locking.LEVEL_NODE] = nodes_keep + else: + self.context.glm.release(locking.LEVEL_NODE) + del self.acquired_locks[locking.LEVEL_NODE] if self.op.wait_for_sync: disk_abort = not _WaitForSync(self, iobj)