When ceph-disk prepares the disk, it triggers udev events and each of
them ceph-disk activate. If systemctl stop ceph-osd@2 happens while
there still are ceph-disk activate in flight, the systemctl stop may be
cancelled by the systemctl enable issued by one of the pending ceph-disk
activate.
This only matters in a test environment where disks are destroyed
shortly after they are activated.
Signed-off-by: Loic Dachary <loic@dachary.org>
def main_deactivate(args):
+ activate_lock.acquire() # noqa
+ try:
+ main_deactivate_locked(args)
+ finally:
+ activate_lock.release() # noqa
+
+def main_deactivate_locked(args):
osd_id = args.deactivate_by_id
path = args.path
target_dev = None
if dmcrypt:
dmcrypt_unmap(part_uuid)
- return
-
###########################
def _remove_from_crush_map(cluster, osd_id):