Use the fsid to activate new OSDs

This commit is contained in:
Joshua Boniface 2019-06-18 20:22:28 -04:00
parent 443108f53d
commit 3adeef6fdd
1 changed files with 22 additions and 3 deletions

View File

@ -102,10 +102,29 @@ def add_osd(zk_conn, logger, node, device, weight):
print(stderr)
raise
# 4. Activate the OSD
# 4a. Get OSD FSID
retcode, stdout, stderr = common.run_os_command(
'ceph-volume lvm activate --bluestore {osdid}'.format(
osdid=osd_id
'ceph-volume lvm list {device}'.format(
osdid=osd_id,
device=device
)
)
for line in stdout.split('\n'):
if 'osd fsid' in line:
osd_fsid = line.split()[-1]
if not osd_fsid:
print('ceph-volume lvm list')
print('Could not find OSD fsid in data:')
print(stdout)
print(stderr)
raise
# 4b. Activate the OSD
retcode, stdout, stderr = common.run_os_command(
'ceph-volume lvm activate --bluestore {osdid} {osdfsid}'.format(
osdid=osd_id,
osdfsid=osd_fsid
)
)
if retcode: