From 412612a2861bcbb46059b706bde788eed0e62b87 Mon Sep 17 00:00:00 2001 From: Gabor Meszaros Date: Fri, 31 Aug 2018 19:21:59 +0200 Subject: [PATCH] Provide the real path of device for ceph to prepare This is a followup patch for the previous commits that are addressing issues with bcache based configuration. Providing dname path for ceph-disk is unsafe, the prepare command uses gdisk which breaks the dname symlinks. Change-Id: Id3f360c90d40b77720d7bc7c1bf94b79f71b6827 Closes-Bug: 1790186 Signed-off-by: Gabor Meszaros --- ceph/utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ceph/utils.py b/ceph/utils.py index 53281ea..de8f8a0 100644 --- a/ceph/utils.py +++ b/ceph/utils.py @@ -1525,7 +1525,8 @@ def _ceph_disk(dev, osd_format, osd_journal, encrypt=False, bluestore=False): """ Prepare a device for usage as a Ceph OSD using ceph-disk - :param: dev: Full path to use for OSD block device setup + :param: dev: Full path to use for OSD block device setup, + The function looks up realpath of the device :param: osd_journal: List of block devices to use for OSD journals :param: encrypt: Use block device encryption (unsupported) :param: bluestore: Use bluestore storage for OSD @@ -1557,7 +1558,7 @@ def _ceph_disk(dev, osd_format, osd_journal, encrypt=False, bluestore=False): elif cmp_pkgrevno('ceph', '12.1.0') >= 0 and not bluestore: cmd.append('--filestore') - cmd.append(dev) + cmd.append(os.path.realpath(dev)) if osd_journal: least_used = find_least_used_utility_device(osd_journal)