[pve-devel] [PATCH manager 4/5] ceph tools: add destroy crush rule destroy function

Aaron Lauterer a.lauterer at proxmox.com
Thu Apr 28 13:58:08 CEST 2022


Signed-off-by: Aaron Lauterer <a.lauterer at proxmox.com>
---
 PVE/Ceph/Tools.pm | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/PVE/Ceph/Tools.pm b/PVE/Ceph/Tools.pm
index b5e60783..7e94ee58 100644
--- a/PVE/Ceph/Tools.pm
+++ b/PVE/Ceph/Tools.pm
@@ -592,5 +592,15 @@ sub get_ecprofile_name {
     return "pve_ec_${name}";
 }
 
+sub destroy_crush_rule {
+    my ($rule) = @_;
+    my $rados = PVE::RADOS->new();
+    my $command = {
+	prefix => 'osd crush rule rm',
+	name => $rule,
+	format => 'plain',
+    };
+    return $rados->mon_command($command);
+}
 
 1;
-- 
2.30.2






More information about the pve-devel mailing list