integ/ceph/ceph
Felipe Sanches Zanoni 08a571dc86 Enable ceph init script to use already mounted osd filesystem
Ceph initialization script /etc/init.d/ceph was failing to start osd
when osd disk is already mounted and the umount fails because disk is
in use.

The script line has an umount command that fails if the partition is
in use. Then, the next mount command will fail returning 32.
If the error is that the partition is already mounted, look for
'already mounted on ${fs_path}' text in the output and then ignore
the mount error returning success and continuing the start script.

An example of error text output:
 === osd.0 ===
 Mounting xfs on controller-0:/var/lib/ceph/osd/ceph-0
 umount: /var/lib/ceph/osd/ceph-0: target is busy.
 mount: /var/lib/ceph/osd/ceph-0: /dev/nvme2n1p1 already mounted
   on /var/lib/ceph/osd/ceph-0.
 failed: 'modprobe xfs ; egrep -q '^[^ ]+ /var/lib/ceph/osd/ceph-0 '
   /proc/mounts && umount /var/lib/ceph/osd/ceph-0 ;
   mount -t xfs -o rw,noatime,inode64,logbufs=8,logbsize=256k
   /dev/disk/by-path/pci-0000:11:00.0-nvme-1-part1
   /var/lib/ceph/osd/ceph-0'

Test-Plan:
  PASS: Validate the new script with partition already mounted
   on right location in AIO-SX and AIO-DX.
  PASS: Validate the new script with partition already mounted
   but on a different location in AIO-SX and AIO-DX.
  PASS: Validate the new script with partition not mounted in
   AIO-SX and AIO-DX.

Closes-bug: 1999826

Signed-off-by: Felipe Sanches Zanoni <Felipe.SanchesZanoni@windriver.com>
Change-Id: I6f0c1a3c2742de62040a690dd3d65785bdc1de73
2023-01-20 17:06:47 +00:00
..
centos Merge "Enable generation of Ceph's Python 3 packages" 2022-01-21 00:26:05 +00:00
debian Enable ceph init script to use already mounted osd filesystem 2023-01-20 17:06:47 +00:00
files Merge "ceph-manage-journal: add support for mpath device" 2022-05-24 15:58:07 +00:00