From: Alfredo Deza Date: Mon, 23 Oct 2017 13:44:27 +0000 (-0400) Subject: ceph-volume lvm.activate only prime-osd-dir when directory is empty X-Git-Tag: v13.0.1~463^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9bb6cfd867c2d8e972093d023622f8c2e5b440d4;p=ceph.git ceph-volume lvm.activate only prime-osd-dir when directory is empty Signed-off-by: Alfredo Deza --- diff --git a/src/ceph-volume/ceph_volume/devices/lvm/activate.py b/src/ceph-volume/ceph_volume/devices/lvm/activate.py index b41d508e4d61..d4abb944a61d 100644 --- a/src/ceph-volume/ceph_volume/devices/lvm/activate.py +++ b/src/ceph-volume/ceph_volume/devices/lvm/activate.py @@ -93,11 +93,13 @@ def activate_bluestore(lvs): if not system.path_is_mounted(osd_path): # mkdir -p and mount as tmpfs prepare_utils.create_osd_path(osd_id, tmpfs=True) - - process.run([ - 'sudo', 'ceph-bluestore-tool', - 'prime-osd-dir', '--dev', osd_lv.lv_path, - '--path', osd_path]) + # if the osd dir was not mounted via tmpfs, it means that the files are + # gone, so it needs to be 'primed' again. The command would otherwise + # fail if the directory was already populated + process.run([ + 'sudo', 'ceph-bluestore-tool', + 'prime-osd-dir', '--dev', osd_lv.lv_path, + '--path', osd_path]) # always re-do the symlink regardless if it exists, so that the block, # block.wal, and block.db devices that may have changed can be mapped # correctly every time