Skip to content

Commit 1672965

Browse files
authored
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 <[email protected]>
1 parent d304ee1 commit 1672965

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/ceph-volume/ceph_volume/devices/raw/common.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,10 @@ def create_parser(prog, description):
4949
action='store_true',
5050
help='Enable device encryption via dm-crypt',
5151
)
52+
parser.add_argument(
53+
'--osd-id',
54+
help='Reuse an existing OSD id',
55+
default=None,
56+
type=arg_validators.valid_osd_id,
57+
)
5258
return parser

src/ceph-volume/ceph_volume/devices/raw/prepare.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,9 @@ def prepare(self):
122122

123123
# reuse a given ID if it exists, otherwise create a new ID
124124
self.osd_id = prepare_utils.create_id(
125-
osd_fsid, json.dumps(secrets))
125+
osd_fsid,
126+
json.dumps(secrets),
127+
osd_id=self.args.osd_id)
126128

127129
prepare_bluestore(
128130
self.args.data,

0 commit comments

Comments
 (0)