From 3adeef6fdd7ef2e021ce3ce23eeafc2b4be0f8f5 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Tue, 18 Jun 2019 20:22:28 -0400 Subject: [PATCH] Use the fsid to activate new OSDs --- node-daemon/pvcd/CephInstance.py | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/node-daemon/pvcd/CephInstance.py b/node-daemon/pvcd/CephInstance.py index 221a797a..372fee87 100644 --- a/node-daemon/pvcd/CephInstance.py +++ b/node-daemon/pvcd/CephInstance.py @@ -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: