From eaa5099ad88a17ac492c247cfc2ff53522451d23 Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Thu, 13 Jul 2023 08:09:03 +0000 Subject: [PATCH] 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) --- src/ceph-volume/ceph_volume/devices/raw/common.py | 6 ++++++ src/ceph-volume/ceph_volume/devices/raw/prepare.py | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/ceph-volume/ceph_volume/devices/raw/common.py b/src/ceph-volume/ceph_volume/devices/raw/common.py index 19de81fe5ef8a..89ee285be5b42 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 3c96eedacf34a..0f18c764778ba 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, -- 2.39.5