diff --git a/lib/cmdlib.py b/lib/cmdlib.py index e28c7c62132039d11b79305ed6b428d466dd3e29..056f21eff7e6d64bb44fac8ff6569ad0be83a629 100644 --- a/lib/cmdlib.py +++ b/lib/cmdlib.py @@ -9849,8 +9849,6 @@ class LUInstanceCreate(LogicalUnit): # specifying a group on instance creation and then selecting nodes from # that group self.needed_locks[locking.LEVEL_NODE] = locking.ALL_SET - self.needed_locks[locking.LEVEL_NODE_RES] = \ - _CopyLockList(self.needed_locks[locking.LEVEL_NODE]) self.needed_locks[locking.LEVEL_NODE_ALLOC] = locking.ALL_SET else: self.op.pnode = _ExpandNodeName(self.cfg, self.op.pnode) @@ -9859,9 +9857,6 @@ class LUInstanceCreate(LogicalUnit): self.op.snode = _ExpandNodeName(self.cfg, self.op.snode) nodelist.append(self.op.snode) self.needed_locks[locking.LEVEL_NODE] = nodelist - # Lock resources of instance's primary and secondary nodes (copy to - # prevent accidential modification) - self.needed_locks[locking.LEVEL_NODE_RES] = list(nodelist) # in case of import lock the source node too if self.op.mode == constants.INSTANCE_IMPORT: @@ -9887,6 +9882,9 @@ class LUInstanceCreate(LogicalUnit): self.op.src_path = src_path = \ utils.PathJoin(pathutils.EXPORT_DIR, src_path) + self.needed_locks[locking.LEVEL_NODE_RES] = \ + _CopyLockList(self.needed_locks[locking.LEVEL_NODE]) + def _RunAllocator(self): """Run the allocator based on input opcode.