[pve-devel] [PATCH storage 1/6] LVM: add lvm_destroy_volume_group
Fabian Ebner
f.ebner at proxmox.com
Mon Oct 25 15:47:44 CEST 2021
Signed-off-by: Fabian Ebner <f.ebner at proxmox.com>
---
PVE/Storage/LVMPlugin.pm | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/PVE/Storage/LVMPlugin.pm b/PVE/Storage/LVMPlugin.pm
index 139d391..9743ee8 100644
--- a/PVE/Storage/LVMPlugin.pm
+++ b/PVE/Storage/LVMPlugin.pm
@@ -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) = @_;
--
2.30.2
More information about the pve-devel
mailing list