]> git.proxmox.com Git - pve-manager.git/commitdiff
api: osd: destroy: remove mclock max iops settings
authorAaron Lauterer <a.lauterer@proxmox.com>
Wed, 8 Nov 2023 12:10:34 +0000 (13:10 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 17 Nov 2023 07:09:15 +0000 (08:09 +0100)
Ceph does a quick benchmark when creating a new OSD and stores the
osd_mclock_max_capacity_iops_{ssd,hdd} settings in the config DB.

When destroying the OSD, Ceph does not automatically remove these
settings. Keeping them can be problematic if a new OSD with potentially
more performance is added and ends up getting the same OSD ID.

Therefore, we remove these settings ourselves when destroying an OSD.
Removing both variants, hdd and ssd should be fine, as the MON does not
complain if the setting does not exist.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
Tested-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
PVE/API2/Ceph/OSD.pm

index 0c07e7ceedca89a3ccffc7574ce90fd00c3562c8..2893456af6de85c7d97d481c6fdf6d33bae6c4fe 100644 (file)
@@ -985,6 +985,10 @@ __PACKAGE__->register_method ({
            print "Remove OSD $osdsection\n";
            $rados->mon_command({ prefix => "osd rm", ids => [ $osdsection ], format => 'plain' });
 
+           print "Remove $osdsection mclock max capacity iops settings from config\n";
+           $rados->mon_command({ prefix => "config rm", who => $osdsection, name => 'osd_mclock_max_capacity_iops_ssd' });
+           $rados->mon_command({ prefix => "config rm", who => $osdsection, name => 'osd_mclock_max_capacity_iops_hdd' });
+
            # try to unmount from standard mount point
            my $mountpoint = "/var/lib/ceph/osd/ceph-$osdid";