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 <disk uuid>
    $ system host-stor-add storage-0 osd <disk uuid>

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 <haochuan.z.chen@intel.com>
This commit is contained in:
Martin, Chen 2019-08-29 20:55:50 +08:00 committed by chen haochuan
parent 5291624d0f
commit 3a387d729b
1 changed files with 12 additions and 2 deletions

View File

@ -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,