From: Guillaume Abrioux Date: Thu, 13 Jul 2023 08:09:03 +0000 (+0000) Subject: ceph-volume: add --osd-id option to raw prepare X-Git-Tag: v17.2.7~209^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F52929%2Fhead;p=ceph.git ceph-volume: add --osd-id option to raw prepare This adds the support of the --osd-id option to the raw prepare command. Fixes: https://tracker.ceph.com/issues/61995 Signed-off-by: Guillaume Abrioux (cherry picked from commit 16729656aa208deeedd631dcf871d501d6eba7f5) --- diff --git a/src/ceph-volume/ceph_volume/devices/raw/common.py b/src/ceph-volume/ceph_volume/devices/raw/common.py index 19de81fe5ef8..89ee285be5b4 100644 --- a/src/ceph-volume/ceph_volume/devices/raw/common.py +++ b/src/ceph-volume/ceph_volume/devices/raw/common.py @@ -49,4 +49,10 @@ def create_parser(prog, description): action='store_true', help='Enable device encryption via dm-crypt', ) + parser.add_argument( + '--osd-id', + help='Reuse an existing OSD id', + default=None, + type=arg_validators.valid_osd_id, + ) return parser diff --git a/src/ceph-volume/ceph_volume/devices/raw/prepare.py b/src/ceph-volume/ceph_volume/devices/raw/prepare.py index 3c96eedacf34..0f18c764778b 100644 --- a/src/ceph-volume/ceph_volume/devices/raw/prepare.py +++ b/src/ceph-volume/ceph_volume/devices/raw/prepare.py @@ -122,7 +122,9 @@ class Prepare(object): # reuse a given ID if it exists, otherwise create a new ID self.osd_id = prepare_utils.create_id( - osd_fsid, json.dumps(secrets)) + osd_fsid, + json.dumps(secrets), + osd_id=self.args.osd_id) prepare_bluestore( self.args.data,