From 3a387d729b73c23e584f2430a42b8155b225130f Mon Sep 17 00:00:00 2001 From: "Martin, Chen" Date: Thu, 29 Aug 2019 20:55:50 +0800 Subject: [PATCH] Fix journal disk path incorrect initialize with dedicate journal disk When user provision a storage node with dedicated storage add for journal, it is designated to create journal partition on this dedicated disk for every osd. $ system host-stor-add storage-0 journal $ system host-stor-add storage-0 osd For above case, "ceph-disk prepare" request correct journal partition for initialize and write header and keyring to journal disk. Closes-Bug: 1830736 Change-Id: I70ae1a3bc049ad3842e0ec22851b148de5671781 Signed-off-by: Martin, Chen --- .../src/modules/platform/manifests/ceph.pp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/puppet-manifests/src/modules/platform/manifests/ceph.pp b/puppet-manifests/src/modules/platform/manifests/ceph.pp index 2b1706b6..ce088d4c 100644 --- a/puppet-manifests/src/modules/platform/manifests/ceph.pp +++ b/puppet-manifests/src/modules/platform/manifests/ceph.pp @@ -348,6 +348,15 @@ define platform_ceph_osd( $tier_name, ) { + # If journal path is substring of disk path, it is collocated journal, + # otherwise it is external journal. In external journal case, class ceph::osd + # request journal path as argument for ceph osd initializaiton + if $disk_path in $journal_path { + $journal = '' + } else { + $journal = $journal_path + } + Anchor['platform::networking'] # Make sure networking is up before running ceph commands -> file { "/var/lib/ceph/osd/ceph-${osd_id}": ensure => 'directory', @@ -360,8 +369,9 @@ define platform_ceph_osd( command => template('platform/ceph.osd.create.erb'), } -> ceph::osd { $disk_path: - uuid => $osd_uuid, - osdid => $osd_id, + uuid => $osd_uuid, + osdid => $osd_id, + journal => $journal, } -> exec { "configure journal location ${name}": logoutput => true,