]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
cephadm: handle adopting offline OSDSs
authorTim Serong <tserong@suse.com>
Wed, 15 Apr 2020 09:26:19 +0000 (19:26 +1000)
committerTim Serong <tserong@suse.com>
Thu, 16 Apr 2020 04:55:58 +0000 (14:55 +1000)
commit9169119bd3c0ac976871e7f3321d9d7a53335c82
tree381d7db9b5f6e79c29752f2127a2ff80c9e3fb12
parent32c240fd7d1b76e50b1028caeb3d5f74c77b8db9
cephadm: handle adopting offline OSDSs

The current adopt behavior expects OSDs to be online, in order to read
/var/lib/ceph/osd/ceph-$ID/fsid.  To handle the case where OSDs
are offline, this change first checks to see if that file is present,
and if not, falls back to calling `ceph-volume lvm list` to see if
there's a matching OSD there, and if that doesn't work, it checks
/etc/ceph/osd/*.json to see if there's a matching old-style simple
OSD present.

For LVM OSDs, the only thing we need is the ODS's fsid; the remainer
of the adopt procedure "just works", as the various other files
in /var/lib/ceph/$FSID/osd.$ID are created by magic anyway when the
OSD is activated, so it doesn't matter if they're not present at
adoption time.

For simple (ceph-disk created) OSDs, we actually need all the files under
/var/lib/ceph/osd/ceph-$ID/ to be moved to /var/lib/ceph/$FSID/osd.$ID
so if a simple OSD is found, it's mounted first, so the existing
move_files() a bit further down around line 3200 continues to work.

Fixes: https://tracker.ceph.com/issues/45095
Signed-off-by: Tim Serong <tserong@suse.com>
src/cephadm/cephadm