]> git.proxmox.com Git - pve-storage.git/blobdiff - PVE/Storage/LVMPlugin.pm
LVM: add lvm_destroy_volume_group
[pve-storage.git] / 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) = @_;