From 56fdc1c973b41d855563e459d23682990e8940bf Mon Sep 17 00:00:00 2001 From: Alfredo Deza Date: Wed, 8 Nov 2017 11:56:36 -0500 Subject: [PATCH] ceph-volume systemd.systemctl masking ceph-disk needs to be done by directly symlinking to dev/null Signed-off-by: Alfredo Deza (cherry picked from commit cda47c247b929401a7dce3f1ef70371ea80eeceb) --- src/ceph-volume/ceph_volume/systemd/systemctl.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/ceph-volume/ceph_volume/systemd/systemctl.py b/src/ceph-volume/ceph_volume/systemd/systemctl.py index 651ed3acf5f..d8d29279c0a 100644 --- a/src/ceph-volume/ceph_volume/systemd/systemctl.py +++ b/src/ceph-volume/ceph_volume/systemd/systemctl.py @@ -44,10 +44,14 @@ 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) +def mask_ceph_disk(): + # systemctl allows using a glob like '*' for masking, but there was a bug + # in that it wouldn't allow this for service templates. This means that + # masking ceph-disk@* will not work, so we must link the service directly. + # /etc/systemd takes precendence regardless of the location of the unit + process.run( + ['sudo', 'ln', '-s', '/dev/null', '/etc/systemd/system/ceph-disk@.service'] + ) # -- 2.47.3