Skip to content
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-osd-device-activation: a systemd service to trigger underlying LVM device activation #281924

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 19 additions & 1 deletion nixos/modules/services/network-filesystems/ceph.nix
Expand Up @@ -56,6 +56,23 @@ let
};
};

osdActivationService."ceph-osd-device-activation" = {
enable = true;
description = "Ceph OSD activation service";
after = [ "network-online.target" "time-sync.target" "ceph-mon.target" ];
wants = [ "network-online.target" "time-sync.target" ];
path = with pkgs; [ lvm2 util-linux ];
serviceConfig = {
Environment = "CLUSTER=${cfg.global.clusterName}";
User = "root";
Group = "root";
ExecStart = "${pkgs.ceph}/bin/ceph-volume lvm activate --all --no-systemd";
PrivateDevices = "no"; # osd needs disk access
RemainAfterExit = "yes";
Type = "oneshot";
};
};

makeTarget = daemonType:
{
"ceph-${daemonType}" = {
Expand Down Expand Up @@ -379,7 +396,8 @@ in
++ optional cfg.mds.enable (makeServices "mds" cfg.mds.daemons)
++ optional cfg.osd.enable (makeServices "osd" cfg.osd.daemons)
++ optional cfg.rgw.enable (makeServices "rgw" cfg.rgw.daemons)
++ optional cfg.mgr.enable (makeServices "mgr" cfg.mgr.daemons);
++ optional cfg.mgr.enable (makeServices "mgr" cfg.mgr.daemons)
++ optional cfg.osd.enable osdActivationService;
in
mkMerge services;

Expand Down