Commit ff8ab07e authored by Iustin Pop's avatar Iustin Pop
Browse files

Use the new dry-run mode in cmdlib



This will hopefully detect potential LVM (or any other storage, when
they implement it) issues before committing changes just on some
nodes.

Unfortunately due to the dry_run opcode handling, we can't integrate
this into the usual handling (as we need to activate the disks before
doing any tests, which belongs in Exec not in CheckPrereq).
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
parent a59faf4b
......@@ -9517,6 +9517,14 @@ class LUInstanceGrowDisk(LogicalUnit):
if not disks_ok:
raise errors.OpExecError("Cannot activate block device to grow")
# First run all grow ops in dry-run mode
for node in instance.all_nodes:
self.cfg.SetDiskID(disk, node)
result = self.rpc.call_blockdev_grow(node, disk, self.op.amount, True)
result.Raise("Grow request failed to node %s" % node)
# We know that (as far as we can test) operations across different
# nodes will succeed, time to run it for real
for node in instance.all_nodes:
self.cfg.SetDiskID(disk, node)
result = self.rpc.call_blockdev_grow(node, disk, self.op.amount, False)
......
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