New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ceph-disk: enable directory backed OSD at boot time #14546

Merged
merged 1 commit into from Apr 14, 2017

Conversation

Projects
None yet
2 participants
@ghost

ghost commented Apr 13, 2017

539385b
introduced a regression preventing directory backed OSD from starting at
boot time.

For device backed OSD the boot sequence starts with ceph-disk@.service
and proceeds to

systemctl enable --runtime ceph-osd@.service

where the --runtime ensure ceph-osd@12 is removed when the machine
reboots so that it does not compete with the ceph-disk@/dev/sdb1 unit at
boot time.

However directory backed OSD solely rely on the ceph-osd@.service unit
to start at boot time and will therefore fail to boot.

The --runtime flag is selectively set for device backed OSD only.

Fixes: http://tracker.ceph.com/issues/19628

Signed-off-by: Loic Dachary loic@dachary.org

@ghost ghost added bug fix core labels Apr 13, 2017

@ghost ghost requested a review from tchaikov Apr 13, 2017

@ghost

This comment has been minimized.

ghost commented Apr 13, 2017

@tchaikov would you have time for a review ? If it looks sensible to you I'll run a ceph-disk suite to confirm it does the right thing.

],
)
def systemd_disable(

This comment has been minimized.

@tchaikov

tchaikov Apr 14, 2017

Contributor

need to add another empty line for the function definition.

'ceph-osd@{osd_id}'.format(osd_id=osd_id),
],
)

This comment has been minimized.

@tchaikov

tchaikov Apr 14, 2017

Contributor

ditto.

This comment has been minimized.

@tchaikov

tchaikov Apr 14, 2017

Contributor

@dachary this comment is not addressed.

This comment has been minimized.

@ghost

ghost Apr 14, 2017

hum, I'm confused, could you re-iterate what the concern is ? I lost the thread I'm afraid...

This comment has been minimized.

@ghost

ghost Apr 14, 2017

oh! it was a flake8 error, fixed now :-)

'systemctl',
'disable',
'ceph-osd@{osd_id}'.format(osd_id=osd_id),
] + style,

This comment has been minimized.

@tchaikov

tchaikov Apr 14, 2017

Contributor

--runtime
When used with enable, disable, edit, (and related commands), make changes only temporarily, so that they are lost on the next reboot. This will have the effect that changes are not made in subdirectories of /etc but in /run, with identical immediate effects, however, since the latter is lost on reboot, the changes are lost too.

so if we want to disable the ceph-osd@<osd_id> unit permanently, we can just use systemdctl disable ceph-osd@<osd_id> without --runtime, right? and i am not sure why we need to disable and then enable then unit just for enabling it.

see https://www.freedesktop.org/software/systemd/man/systemctl.html

This comment has been minimized.

@ghost

ghost Apr 14, 2017

This is for upgrade purposes, to make sure there are no competing units. There can be two units at the same time: one with --runtime and another without it. If, for any reason (manual or ceph-disk) the two units co-exist they will compete with each other.

This comment has been minimized.

@tchaikov

tchaikov Apr 14, 2017

Contributor

thanks. i sort of understand now: the enabled --runtime units and enabled non-runtime units are living in different naming spaces, literally /run and /etc. in other words, we are not able to disable both of them in a single shot without --runtime.

This comment has been minimized.

@ghost

ghost Apr 14, 2017

exactly :-)

'disable',
'ceph-osd@{osd_id}'.format(osd_id=osd_id),
] + style,
)

This comment has been minimized.

@tchaikov

tchaikov Apr 14, 2017

Contributor

probably due to the same reason, we choose to temporarily disable the unit if the osd is mounted. but i just cannot figure it out. could you elaborate it a little bit?

@ghost

This comment has been minimized.

ghost commented Apr 14, 2017

@tchaikov thanks for the quick review :-) I updated the draft to clarify the intent of the double systemctl disable and isolated it in a separate function. Does that help ?

'ceph-osd@{osd_id}'.format(osd_id=osd_id),
],
)

This comment has been minimized.

@tchaikov

tchaikov Apr 14, 2017

Contributor

@dachary this comment is not addressed.

ceph-disk: enable directory backed OSD at boot time
539385b
introduced a regression preventing directory backed OSD from starting at
boot time.

For device backed OSD the boot sequence starts with ceph-disk@.service
and proceeds to

    systemctl enable --runtime ceph-osd@.service

where the --runtime ensure ceph-osd@12 is removed when the machine
reboots so that it does not compete with the ceph-disk@/dev/sdb1 unit at
boot time.

However directory backed OSD solely rely on the ceph-osd@.service unit
to start at boot time and will therefore fail to boot.

The --runtime flag is selectively set for device backed OSD only.

Fixes: http://tracker.ceph.com/issues/19628

Signed-off-by: Loic Dachary <loic@dachary.org>
@ghost

This comment has been minimized.

ghost commented Apr 14, 2017

pushed to ceph-ci

@ghost

This comment has been minimized.

ghost commented Apr 14, 2017

teuthology-suite -k distro --verbose --suite ceph-disk --ceph wip-19628-directory-boot --machine-type vps

@tchaikov tchaikov merged commit 43a2f3e into ceph:master Apr 14, 2017

3 checks passed

Signed-off-by all commits in this PR are signed
Details
Unmodifed Submodules submodules for project are unmodified
Details
default Build finished.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment