]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commit
ceph-osd: use OSD id with systemd ceph-disk
authorDimitri Savineau <dsavinea@redhat.com>
Mon, 13 May 2019 21:18:52 +0000 (17:18 -0400)
committerDimitri Savineau <savineau.dimitri@gmail.com>
Fri, 26 Jul 2019 20:07:22 +0000 (16:07 -0400)
commitbedc0ab69df6a8cadc3993d8b56288b511846802
treef981efce3ca71489c50ecd81c065e73da69c0178
parentdf46d10c27cea7b069b8328d03d9f43946e0d51a
ceph-osd: use OSD id with systemd ceph-disk

When using containerized deployment we have to create the systemd
service unit based on a template.
The current implementation with ceph-disk is using the device name
as paramater to the systemd service and for the container name too.

$ systemctl start ceph-osd@sdb
$ docker ps --filter 'name=ceph-osd-*'
CONTAINER ID IMAGE                        NAMES
065530d0a27f ceph/daemon:latest-luminous  ceph-osd-strg0-sdb

This is the only scenario (compared to non containerized or
ceph-volume based deployment) that isn't using the OSD id.

$ systemctl start ceph-osd@0
$ docker ps --filter 'name=ceph-osd-*'
CONTAINER ID IMAGE                        NAMES
d34552ec157e ceph/daemon:latest-luminous  ceph-osd-0

Also if the device mapping doesn't persist to system reboot (ie sdb
might be remapped to sde) then the OSD service won't come back after
the reboot.

This patch allows to use the OSD id with the ceph-osd systemd service
but requires to activate the OSD manually with ceph-disk first in
order to affect the ID to that OSD.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1670734
Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
roles/ceph-handler/templates/restart_osd_daemon.sh.j2
roles/ceph-osd/tasks/start_osds.yml
roles/ceph-osd/templates/ceph-osd-run.sh.j2
roles/ceph-osd/templates/systemd-device-to-id.sh.j2 [new file with mode: 0644]