From 5df1c9aa629a86419642850f46338482710221e4 Mon Sep 17 00:00:00 2001 From: Michael Hanselmann <hansmi@google.com> Date: Fri, 23 Nov 2012 04:43:48 +0100 Subject: [PATCH] LUInstanceMultiAlloc: Use node allocation lock Avoid conflicts between instance allocations. Signed-off-by: Michael Hanselmann <hansmi@google.com> Reviewed-by: Guido Trotter <ultrotter@google.com> --- lib/cmdlib.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/cmdlib.py b/lib/cmdlib.py index eacf9ea7d..b84e99e8c 100644 --- a/lib/cmdlib.py +++ b/lib/cmdlib.py @@ -10811,7 +10811,11 @@ class LUInstanceMultiAlloc(NoHooksLU): """ self.share_locks = _ShareAll() - self.needed_locks = {} + self.needed_locks = { + # iallocator will select nodes and even if no iallocator is used, + # collisions with LUInstanceCreate should be avoided + locking.LEVEL_NODE_ALLOC: locking.ALL_SET, + } if self.op.iallocator: self.needed_locks[locking.LEVEL_NODE] = locking.ALL_SET -- GitLab