logger = logging.getLogger(__name__)
-def activate_bluestore(meta, tmpfs, systemd, block_wal=None, block_db=None):
+def activate_bluestore(meta, tmpfs, systemd):
# find the osd
osd_id = meta['osd_id']
osd_uuid = meta['osd_uuid']
# correctly every time
prepare_utils.link_block(meta['device'], osd_id)
- if block_db:
- prepare_utils.link_db(block_db, osd_id, osd_uuid)
- elif 'device_db' in meta:
+ if 'device_db' in meta:
prepare_utils.link_db(meta['device_db'], osd_id, osd_uuid)
- if block_wal:
- prepare_utils.link_wal(block_wal, osd_id, osd_uuid)
- elif 'device_wal' in meta:
+ if 'device_wal' in meta:
prepare_utils.link_wal(meta['device_wal'], osd_id, osd_uuid)
system.chown(osd_path)
self.args = None
@decorators.needs_root
- def activate(self, device, start_osd_id, start_osd_uuid,
- tmpfs, systemd, block_wal, block_db):
+ def activate(self, devs, start_osd_id, start_osd_uuid,
+ tmpfs, systemd):
"""
:param args: The parsed arguments coming from the CLI
"""
- assert device or start_osd_id or start_osd_uuid
- found = direct_report(device)
+ assert devs or start_osd_id or start_osd_uuid
+ found = direct_report(devs)
activated_any = False
for osd_uuid, meta in found.items():
osd_id, osd_uuid, meta['ceph_fsid']))
activate_bluestore(meta,
tmpfs=tmpfs,
- systemd=systemd,
- block_wal=block_wal,
- block_db=block_db)
+ systemd=systemd)
activated_any = True
if not activated_any:
def main(self):
sub_command_help = dedent("""
- Activate (BlueStore) OSD on a raw block device based on the
+ Activate (BlueStore) OSD on a raw block device(s) based on the
device label (normally the first block of the device).
- ceph-volume raw activate --device /dev/sdb
+ ceph-volume raw activate [/dev/sdb2 ...]
- The device(s) associated with the OSD needs to have been prepared
+ or
+
+ ceph-volume raw activate --osd-id NUM --osd-uuid UUID
+
+ The device(s) associated with the OSD need to have been prepared
previously, so that all needed tags and metadata exist.
""")
parser = argparse.ArgumentParser(
if not args.no_systemd:
terminal.error('systemd support not yet implemented')
raise SystemExit(1)
- self.activate(device=args.device,
+
+ devs = [args.device]
+ if args.block_wal:
+ devs.append(args.block_wal)
+ if args.block_db:
+ devs.append(args.block_db)
+
+ self.activate(devs=devs,
start_osd_id=args.osd_id,
start_osd_uuid=args.osd_uuid,
tmpfs=not args.no_tmpfs,
- systemd=not self.args.no_systemd,
- block_wal=self.args.block_wal,
- block_db=self.args.block_db)
+ systemd=not self.args.no_systemd)