[pve-devel] [PATCH manager] ceph: disable OSD unit in destroyosd

Fabian Gr├╝nbichler f.gruenbichler at proxmox.com
Tue Oct 10 11:54:54 CEST 2017


while OSDs units should only be runtime enable and disappear on reboots,
this serves as an additional safeguard to ensure no leftover units can
exist.

Signed-off-by: Fabian Gr├╝nbichler <f.gruenbichler at proxmox.com>
---
Note: runtime enabling was broken in Luminous < 12.2.1-pve3 .. so any OSDs
destroyed on those versions will have an enabled, failing unit lying around
needing manual cleanup..

 PVE/API2/Ceph.pm | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/PVE/API2/Ceph.pm b/PVE/API2/Ceph.pm
index e9211325..e1c6c114 100644
--- a/PVE/API2/Ceph.pm
+++ b/PVE/API2/Ceph.pm
@@ -379,7 +379,10 @@ __PACKAGE__->register_method ({
 
 	    print "destroy OSD $osdsection\n";
 
-	    eval { PVE::CephTools::ceph_service_cmd('stop', $osdsection); };
+	    eval {
+		PVE::CephTools::ceph_service_cmd('stop', $osdsection);
+		PVE::CephTools::ceph_service_cmd('disable', $osdsection);
+	    };
 	    warn $@ if $@;
 
 	    print "Remove $osdsection from the CRUSH map\n";
-- 
2.14.1




More information about the pve-devel mailing list