From e36e96b4963c3674ad2dd7d6e39f0f2131012b18 Mon Sep 17 00:00:00 2001
From: Guido Trotter <ultrotter@google.com>
Date: Mon, 24 Nov 2008 09:47:45 +0000
Subject: [PATCH] LUCreateInstance unlock all nodes mid-way

When creating a new instance, after saving the instance data to the config file
and creating the disks, but before waiting for sync and installing the OS, we
release the node locks, to allow for more instance creations to proceed in
parallel.

Reviewed-by: iustinp
---
 lib/cmdlib.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/cmdlib.py b/lib/cmdlib.py
index c931bb755..54f632a76 100644
--- a/lib/cmdlib.py
+++ b/lib/cmdlib.py
@@ -3768,6 +3768,9 @@ class LUCreateInstance(LogicalUnit):
     del self.remove_locks[locking.LEVEL_INSTANCE]
     # 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.wait_for_sync:
       disk_abort = not _WaitForSync(self, iobj)
-- 
GitLab