Project

General

Profile

Actions

Bug #36307

open

allow arbitrary OSD IDs to be used when creating+preparing

Added by Alfredo Deza over 5 years ago. Updated over 4 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
% Done:

0%

Source:
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

From the mailing list:

The underlying ceph command (ceph osd new)
very happily accepts an osd-id as an extra optional argument
(after the fsid), and creates and osd with the given ID. In fact, a
quick change to ceph_volume (create_id function in prepare.py) will make
ceph-volume recreate the OSD with a given ID. I'm not a ceph-volume
expert, but a feature to create an OSD with a given ID from scratch
would be nice (given that the underlying raw ceph commands already
support it).

Actions #1

Updated by Marcin W over 4 years ago

--- /usr/lib/python2.7/site-packages/ceph_volume/util/prepare.py.old  2019-10-26 16:45:57.140995418 +0000
+++ /usr/lib/python2.7/site-packages/ceph_volume/util/prepare.py  2019-10-26 16:46:37.615813246 +0000
@@ -199,9 +199,12 @@
     output = json.loads(''.join(stdout).strip())
     osds = output['nodes']
     osd = [osd for osd in osds if str(osd['id']) == str(osd_id)]
-    if osd and osd[0].get('status') == "destroyed":
-        return True
-    return False
+    if osd:
+        if osd[0].get('status') == "destroyed":
+            return True
+        else:
+            return False
+    return True
Actions

Also available in: Atom PDF