Project

General

Profile

Bug #24152

Starting all OSDs created by ceph-volume via systemd fails

Added by Andras Pataki over 1 year ago. Updated about 1 year ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
05/16/2018
Due date:
% Done:

0%

Source:
Community (user)
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:

Description

Currently when ceph-volume creates a new OSD, it creates a systemd unit instance in /etc/systemd/system/multi-user.target.wants. This makes the OSD start at boot, but it is inconvenient to start all OSDs on the same host (for upgrades without reboots for example).

Perhaps it would be preferable to move the ceph-volume@.service to live under ceph-osd.target instead. That way systemctl start ceph-osd.target would start all OSDs (which currently does not work), and systemctl stop ceph-osd.target stops them (which currently does work).

When that is done, however, a different problem rears its head. When running systemctl start 'ceph-osd.target', it executes the unit(s) , which in turn run ceph-volume lvm trigger OSDID-OSDUUID. That command internally runs activate, which, among other things runs something like
systemctl enable ceph-volume@OSDID-OSDUUID
(and then starts the OSD). This means that the unit that is being run is trying to activate itself. In CentOS, this causes multiple invocations of the systemctl start ceph-osd.target command to hang and not return (even though the OSDs start correctly).

It would be preferable not to test the edge cases of systemd, and not have the unit that runs try to activate itself.

For example, in systemd.py replacing

def enable(unit):
process.run(['systemctl', 'enable', unit])

with

def enable(unit):
stdout, stderr, retcode = process.call(['systemctl', 'is-enabled',
unit], show_command=True)
if retcode != 0:
process.run(['systemctl', 'enable', unit])

is one way to resolve this.

Or perhaps some flag to activate to distinguish the cases when it is called for creating an osd (ceph-volume activate) vs. by systemd (ceph-volume trigger).

History

#1 Updated by Dan van der Ster about 1 year ago

Does this cover your use-case? https://github.com/ceph/ceph/pull/23321

#2 Updated by Alfredo Deza about 1 year ago

  • Status changed from New to Resolved

Also available in: Atom PDF