Skip to content
Snippets Groups Projects
Commit ec944cc0 authored by Bernardo Dal Seno's avatar Bernardo Dal Seno
Browse files

InstanceRecreateDisks: new assertion for node locks


Make sure that all the nodes where a disk operation is peformed are locked.

Signed-off-by: default avatarBernardo Dal Seno <bdalseno@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent cf8adf26
No related branches found
No related tags found
No related merge requests found
...@@ -7337,6 +7337,9 @@ class LUInstanceRecreateDisks(LogicalUnit): ...@@ -7337,6 +7337,9 @@ class LUInstanceRecreateDisks(LogicalUnit):
if self.op.nodes: if self.op.nodes:
self.cfg.Update(instance, feedback_fn) self.cfg.Update(instance, feedback_fn)
   
# All touched nodes must be locked
mylocks = self.owned_locks(locking.LEVEL_NODE)
assert mylocks.issuperset(frozenset(instance.all_nodes))
_CreateDisks(self, instance, to_skip=to_skip) _CreateDisks(self, instance, to_skip=to_skip)
   
   
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment