]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume lvm.activate only prime-osd-dir when directory is empty 18448/head
authorAlfredo Deza <adeza@redhat.com>
Mon, 23 Oct 2017 13:44:27 +0000 (09:44 -0400)
committerAlfredo Deza <adeza@redhat.com>
Mon, 23 Oct 2017 13:44:27 +0000 (09:44 -0400)
Signed-off-by: Alfredo Deza <adeza@redhat.com>
src/ceph-volume/ceph_volume/devices/lvm/activate.py

index b41d508e4d617687dd4c9af948fe9e456f93d7d5..d4abb944a61d846d8b2f23faa97389075464d4b9 100644 (file)
@@ -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