summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vmdb/plugins/lvcreate.mdwn3
-rw-r--r--vmdb/plugins/lvcreate_plugin.py5
2 files changed, 6 insertions, 2 deletions
diff --git a/vmdb/plugins/lvcreate.mdwn b/vmdb/plugins/lvcreate.mdwn
index fcb350d..e1aca3a 100644
--- a/vmdb/plugins/lvcreate.mdwn
+++ b/vmdb/plugins/lvcreate.mdwn
@@ -9,7 +9,8 @@ Step keys:
* `name` — REQUIRED; tag for the new LV block device.
-* `size` — REQUIRED; size of the new LV.
+* `size` — REQUIRED; size of the new LV. The special value `fill` will
+ make the volume use all of the available space.
Example (in the .vmdb file):
diff --git a/vmdb/plugins/lvcreate_plugin.py b/vmdb/plugins/lvcreate_plugin.py
index 5e65b66..5af3926 100644
--- a/vmdb/plugins/lvcreate_plugin.py
+++ b/vmdb/plugins/lvcreate_plugin.py
@@ -35,7 +35,10 @@ class LvcreateStepRunner(vmdb.StepRunnerInterface):
lvname = values["name"]
size = values["size"]
- vmdb.runcmd(["lvcreate", "-qq", "--name", lvname, "--size", size, vgname])
+ if size.lower() == "fill":
+ vmdb.runcmd(["lvcreate", "-qq", "--name", lvname, "--extents", "100%FREE", vgname])
+ else:
+ vmdb.runcmd(["lvcreate", "-qq", "--name", lvname, "--size", size, vgname])
lvdev = "/dev/{}/{}".format(vgname, lvname)
assert os.path.exists(lvdev)