2023-08-22 15:57:25 +02:00
|
|
|
{ config, pkgs, lib, ... }:
|
2023-07-28 19:49:48 +02:00
|
|
|
|
|
|
|
{
|
|
|
|
imports = [
|
|
|
|
../common/main.nix
|
2023-08-29 12:29:41 +02:00
|
|
|
../common/monitoring.nix
|
2023-07-28 19:49:48 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
# Select the this using the ID to avoid mismatches
|
|
|
|
boot.loader.grub.device = "/dev/disk/by-id/wwn-0x55cd2e414d53562d";
|
|
|
|
|
2023-08-22 15:57:25 +02:00
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
ceph
|
|
|
|
];
|
|
|
|
|
|
|
|
services.slurm = {
|
|
|
|
client.enable = lib.mkForce false;
|
|
|
|
};
|
|
|
|
|
2023-07-28 19:49:48 +02:00
|
|
|
networking = {
|
|
|
|
hostName = "bay";
|
|
|
|
interfaces.eno1.ipv4.addresses = [ {
|
|
|
|
address = "10.0.40.40";
|
|
|
|
prefixLength = 24;
|
|
|
|
} ];
|
|
|
|
interfaces.ibp5s0.ipv4.addresses = [ {
|
|
|
|
address = "10.0.42.40";
|
|
|
|
prefixLength = 24;
|
|
|
|
} ];
|
|
|
|
};
|
2023-08-22 15:57:25 +02:00
|
|
|
|
|
|
|
services.ceph = {
|
|
|
|
enable = true;
|
|
|
|
global = {
|
|
|
|
fsid = "9c8d06e0-485f-4aaf-b16b-06d6daf1232b";
|
2023-08-29 14:56:40 +02:00
|
|
|
monHost = "10.0.42.40";
|
|
|
|
monInitialMembers = "10.0.42.40";
|
|
|
|
publicNetwork = "10.0.42.40/24";
|
|
|
|
clusterNetwork = "10.0.42.40/24";
|
2023-08-22 15:57:25 +02:00
|
|
|
};
|
2023-08-28 17:58:08 +02:00
|
|
|
extraConfig = {
|
|
|
|
# Only log to stderr so it appears in the journal
|
|
|
|
"log_file" = "/dev/null";
|
|
|
|
"mon_cluster_log_file" = "/dev/null";
|
|
|
|
"log_to_stderr" = "true";
|
|
|
|
"err_to_stderr" = "true";
|
|
|
|
"log_to_file" = "false";
|
|
|
|
};
|
2023-08-22 15:57:25 +02:00
|
|
|
mds = {
|
|
|
|
enable = true;
|
|
|
|
daemons = [ "mds0" "mds1" ];
|
|
|
|
extraConfig = {
|
2023-08-29 14:56:40 +02:00
|
|
|
"host" = "10.0.42.40";
|
2023-08-22 15:57:25 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
mgr = {
|
|
|
|
enable = true;
|
|
|
|
daemons = [ "bay" ];
|
|
|
|
};
|
|
|
|
mon = {
|
|
|
|
enable = true;
|
|
|
|
daemons = [ "bay" ];
|
|
|
|
};
|
|
|
|
osd = {
|
|
|
|
enable = true;
|
|
|
|
# One daemon per NVME disk
|
|
|
|
daemons = [ "0" "1" "2" "3" ];
|
|
|
|
extraConfig = {
|
|
|
|
"osd crush chooseleaf type" = "0";
|
|
|
|
"osd journal size" = "10000";
|
|
|
|
"osd pool default min size" = "2";
|
|
|
|
"osd pool default pg num" = "200";
|
|
|
|
"osd pool default pgp num" = "200";
|
|
|
|
"osd pool default size" = "3";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
# Missing service for volumes, see:
|
|
|
|
# https://www.reddit.com/r/ceph/comments/14otjyo/comment/jrd69vt/
|
|
|
|
systemd.services.ceph-volume = {
|
|
|
|
enable = true;
|
|
|
|
description = "Ceph Volume activation";
|
|
|
|
unitConfig = {
|
|
|
|
Type = "oneshot";
|
|
|
|
After = "local-fs.target";
|
|
|
|
Wants = "local-fs.target";
|
|
|
|
};
|
|
|
|
path = [ pkgs.ceph pkgs.util-linux pkgs.lvm2 pkgs.cryptsetup ];
|
|
|
|
serviceConfig = {
|
|
|
|
KillMode = "none";
|
|
|
|
Environment = "CEPH_VOLUME_TIMEOUT=10000";
|
|
|
|
ExecStart = "/bin/sh -c 'timeout $CEPH_VOLUME_TIMEOUT ${pkgs.ceph}/bin/ceph-volume lvm activate --all --no-systemd'";
|
|
|
|
TimeoutSec = "0";
|
|
|
|
};
|
|
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
};
|
2023-07-28 19:49:48 +02:00
|
|
|
}
|