From 3da23fa4caea8c9dc91da3eee5b5acc1860bf242 Mon Sep 17 00:00:00 2001 From: Alfredo Deza Date: Fri, 3 Nov 2017 14:36:38 -0400 Subject: [PATCH] ceph-volume systemd.systemctl helpers to mask ceph-disk Signed-off-by: Alfredo Deza --- src/ceph-volume/ceph_volume/systemd/systemctl.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/ceph-volume/ceph_volume/systemd/systemctl.py b/src/ceph-volume/ceph_volume/systemd/systemctl.py index 9bb4d7d3a0e..2a5364ae79a 100644 --- a/src/ceph-volume/ceph_volume/systemd/systemctl.py +++ b/src/ceph-volume/ceph_volume/systemd/systemctl.py @@ -20,6 +20,10 @@ def disable(unit): process.run(['sudo', 'systemctl', 'disable', unit]) +def mask(unit): + process.run(['sudo', 'systemctl', 'disable', unit]) + + def start_osd(id_): return start(osd_unit % id_) @@ -40,9 +44,16 @@ def enable_volume(id_, fsid, device_type='lvm'): return enable(volume_unit % (device_type, id_, fsid)) +def mask_ceph_disk(instance='*'): + # ``instance`` will probably be '*' all the time, because ceph-volume will + # want all instances disabled at once, not just one + return mask(ceph_disk_unit % instance) + + # # templates # osd_unit = "ceph-osd@%s" +ceph_disk_unit = "ceph-disk@%s" volume_unit = "ceph-volume@%s-%s-%s"