Commit dfb0bc93 authored by Bernardo Dal Seno's avatar Bernardo Dal Seno
Browse files

recreate-disks honors the prealloc_wipe_disks flag

Now even recreate-disks wipes the newly-created disks, if the flag is set.
Signed-off-by: default avatarBernardo Dal Seno <>
Reviewed-by: default avatarHelga Velroyen <>
parent b867e218
......@@ -7905,7 +7905,14 @@ class LUInstanceRecreateDisks(LogicalUnit):
# 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)
new_disks = _CreateDisks(self, instance, to_skip=to_skip)
# TODO: Release node locks before wiping, or explain why it's not possible
if self.cfg.GetClusterInfo().prealloc_wipe_disks:
wipedisks = [(idx, disk, 0)
for (idx, disk) in enumerate(instance.disks)
if idx not in to_skip]
_WipeOrCleanupDisks(self, instance, disks=wipedisks, cleanup=new_disks)
class LUInstanceRename(LogicalUnit):
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment