]> git.proxmox.com Git - pve-storage.git/commitdiff
LVM: add lvm_destroy_volume_group
authorFabian Ebner <f.ebner@proxmox.com>
Mon, 25 Oct 2021 13:47:44 +0000 (15:47 +0200)
committerFabian Grünbichler <f.gruenbichler@proxmox.com>
Wed, 10 Nov 2021 11:14:32 +0000 (12:14 +0100)
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
PVE/Storage/LVMPlugin.pm

index 40c1613a03c2d4df660f9c38b69a5c741b9abdd0..b6c8475fb9307756121a97db2b0be2781a78aaf0 100644 (file)
@@ -97,6 +97,17 @@ sub lvm_create_volume_group {
     run_command($cmd, errmsg => "vgcreate $vgname $device error", errfunc => $ignore_no_medium_warnings, outfunc => $ignore_no_medium_warnings);
 }
 
+sub lvm_destroy_volume_group {
+    my ($vgname) = @_;
+
+    run_command(
+       ['vgremove', '-y', $vgname],
+       errmsg => "unable to remove volume group $vgname",
+       errfunc => $ignore_no_medium_warnings,
+       outfunc => $ignore_no_medium_warnings,
+    );
+}
+
 sub lvm_vgs {
     my ($includepvs) = @_;