feat: move /home and /opt to cephfs and tweak mounts
This commit is contained in:
@@ -11,26 +11,6 @@ let
|
|||||||
|
|
||||||
compute = {
|
compute = {
|
||||||
deployment.tags = [ "compute" "c0" "cluster" ];
|
deployment.tags = [ "compute" "c0" "cluster" ];
|
||||||
|
|
||||||
fileSystems = {
|
|
||||||
"/users" = {
|
|
||||||
device = "172.16.239.222:/home";
|
|
||||||
fsType = "nfs4";
|
|
||||||
options = [
|
|
||||||
"soft"
|
|
||||||
"defaults"
|
|
||||||
"noauto"
|
|
||||||
"x-systemd.automount"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
systemd.automounts = [
|
|
||||||
{
|
|
||||||
where = "/users";
|
|
||||||
wantedBy = [ "default.target" ];
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
mkCompute = host:
|
mkCompute = host:
|
||||||
@@ -46,9 +26,9 @@ let
|
|||||||
automount.enable = true;
|
automount.enable = true;
|
||||||
users = true;
|
users = true;
|
||||||
opt = true;
|
opt = true;
|
||||||
work = false;
|
work = true;
|
||||||
data = false;
|
data = true;
|
||||||
ceph = false;
|
ceph = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ let
|
|||||||
map (n: (
|
map (n: (
|
||||||
rec {
|
rec {
|
||||||
idx = 110 + n;
|
idx = 110 + n;
|
||||||
iface = if n < 11 then "enp34s0np0" else "enp33s0np0";
|
iface = if n > 1 && n < 11 then "enp34s0np0" else "enp33s0np0";
|
||||||
name = "c0-${toString n}";
|
name = "c0-${toString n}";
|
||||||
address = "172.16.239.${toString idx}";
|
address = "172.16.239.${toString idx}";
|
||||||
ipoib = "10.1.6.${toString idx}";
|
ipoib = "10.1.6.${toString idx}";
|
||||||
|
|||||||
@@ -23,11 +23,11 @@ in
|
|||||||
mounts = {
|
mounts = {
|
||||||
rdma.enable = false;
|
rdma.enable = false;
|
||||||
automount.enable = true;
|
automount.enable = true;
|
||||||
users = false;
|
users = true;
|
||||||
opt = false;
|
opt = true;
|
||||||
work = false;
|
work = true;
|
||||||
data = false;
|
data = true;
|
||||||
ceph = false;
|
ceph = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -170,28 +170,8 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
fileSystems = {
|
fileSystems = {
|
||||||
"/exports/home" = {
|
"/home" = {
|
||||||
device = "/home";
|
device = "/ceph/volumes/nfs/home";
|
||||||
options = [ "bind" ];
|
|
||||||
};
|
|
||||||
"/exports/opt/bin" = {
|
|
||||||
device = "/opt/bin";
|
|
||||||
options = [ "bind" ];
|
|
||||||
};
|
|
||||||
"/exports/opt/sif" = {
|
|
||||||
device = "/opt/sif";
|
|
||||||
options = [ "bind" ];
|
|
||||||
};
|
|
||||||
"/exports/opt/singularity" = {
|
|
||||||
device = "/opt/singularity";
|
|
||||||
options = [ "bind" ];
|
|
||||||
};
|
|
||||||
"/exports/nfs-provisioner" = {
|
|
||||||
device = "/vol/nfs-provisioner";
|
|
||||||
options = [ "bind" ];
|
|
||||||
};
|
|
||||||
"/users" = {
|
|
||||||
device = "/home";
|
|
||||||
options = [ "bind" ];
|
options = [ "bind" ];
|
||||||
};
|
};
|
||||||
"/vol/local-storage/vol1" = {
|
"/vol/local-storage/vol1" = {
|
||||||
@@ -202,8 +182,42 @@ in
|
|||||||
device = "/vol/vol2";
|
device = "/vol/vol2";
|
||||||
options = [ "bind" ];
|
options = [ "bind" ];
|
||||||
};
|
};
|
||||||
|
# "/exports/home" = {
|
||||||
|
# device = "/home";
|
||||||
|
# options = [ "bind" ];
|
||||||
|
# };
|
||||||
|
# "/exports/opt/bin" = {
|
||||||
|
# device = "/opt/bin";
|
||||||
|
# options = [ "bind" ];
|
||||||
|
# };
|
||||||
|
# "/exports/opt/sif" = {
|
||||||
|
# device = "/opt/sif";
|
||||||
|
# options = [ "bind" ];
|
||||||
|
# };
|
||||||
|
# "/exports/opt/singularity" = {
|
||||||
|
# device = "/opt/singularity";
|
||||||
|
# options = [ "bind" ];
|
||||||
|
# };
|
||||||
|
# "/exports/nfs-provisioner" = {
|
||||||
|
# device = "/vol/nfs-provisioner";
|
||||||
|
# options = [ "bind" ];
|
||||||
|
# };
|
||||||
|
# "/users" = {
|
||||||
|
# device = "/home";
|
||||||
|
# options = [ "bind" ];
|
||||||
|
# };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
systemd.automounts = [
|
||||||
|
# {
|
||||||
|
# wantedBy = [ "multi-user.target" ];
|
||||||
|
# automountConfig = {
|
||||||
|
# TimeoutIdleSec = "600";
|
||||||
|
# };
|
||||||
|
# where = "/home";
|
||||||
|
# }
|
||||||
|
];
|
||||||
|
|
||||||
nix.extraOptions = ''
|
nix.extraOptions = ''
|
||||||
# secret-key-files = /etc/nix/rossby.key
|
# secret-key-files = /etc/nix/rossby.key
|
||||||
'';
|
'';
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ in {
|
|||||||
mounts = {
|
mounts = {
|
||||||
rdma.enable = false;
|
rdma.enable = false;
|
||||||
automount.enable = true;
|
automount.enable = true;
|
||||||
users = true;
|
users = false;
|
||||||
opt = true;
|
opt = true;
|
||||||
work = true;
|
work = true;
|
||||||
data = true;
|
data = true;
|
||||||
@@ -320,6 +320,19 @@ in {
|
|||||||
"--advertise-routes=172.16.239.0/24,172.16.238.0/24"
|
"--advertise-routes=172.16.239.0/24,172.16.238.0/24"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
services.networkd-dispatcher = {
|
||||||
|
enable = true;
|
||||||
|
rules = {
|
||||||
|
"tailscale-router" = {
|
||||||
|
onState = [ "routable" ];
|
||||||
|
script = ''
|
||||||
|
#!${pkgs.runtimeShell}
|
||||||
|
${pkgs.ethtool}/bin/ethtool -K enp65s0np0 rx-udp-gro-forwarding on rx-gro-list off
|
||||||
|
exit 0
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
|
|||||||
@@ -5,41 +5,29 @@ let
|
|||||||
|
|
||||||
options =
|
options =
|
||||||
[ "soft" "defaults" "vers=4.2" ] ++
|
[ "soft" "defaults" "vers=4.2" ] ++
|
||||||
(if cfg.automount.enable then [ "noauto" "x-systemd.automount" ] else []);
|
(if cfg.automount.enable then [ "x-systemd.automount" ] else []);
|
||||||
|
|
||||||
users =
|
users =
|
||||||
if cfg.users then {
|
if cfg.users then {
|
||||||
"/users" = {
|
"/users" = {
|
||||||
device = "172.16.239.222:/home";
|
device = "/ceph/volumes/nfs/home";
|
||||||
fsType = "nfs4";
|
options = [ "bind" ];
|
||||||
options = [
|
|
||||||
"soft"
|
|
||||||
"defaults"
|
|
||||||
"noauto"
|
|
||||||
"x-systemd.automount"
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
} else {};
|
} else {};
|
||||||
|
|
||||||
opt =
|
opt =
|
||||||
let
|
|
||||||
server = "172.16.239.222";
|
|
||||||
in
|
|
||||||
if cfg.opt then {
|
if cfg.opt then {
|
||||||
"/opt/bin" = {
|
"/opt/bin" = {
|
||||||
device = "${server}:/opt/bin";
|
device = "/ceph/volumes/nfs/opt/bin";
|
||||||
fsType = "nfs4";
|
options = [ "bind" ];
|
||||||
inherit options;
|
|
||||||
};
|
};
|
||||||
"/opt/sif" = {
|
"/opt/sif" = {
|
||||||
device = "${server}:/opt/sif";
|
device = "/ceph/volumes/nfs/opt/sif";
|
||||||
fsType = "nfs4";
|
options = [ "bind" ];
|
||||||
inherit options;
|
|
||||||
};
|
};
|
||||||
"/opt/singularity" = {
|
"/opt/singularity" = {
|
||||||
device = "${server}:/opt/singularity";
|
device = "/ceph/volumes/nfs/opt/singularity";
|
||||||
fsType = "nfs4";
|
options = [ "bind" ];
|
||||||
inherit options;
|
|
||||||
};
|
};
|
||||||
} else {};
|
} else {};
|
||||||
|
|
||||||
@@ -68,6 +56,7 @@ let
|
|||||||
options = [
|
options = [
|
||||||
"mon_addr=172.16.239.211/172.16.239.212/172.16.239.213:6789"
|
"mon_addr=172.16.239.211/172.16.239.212/172.16.239.213:6789"
|
||||||
"_netdev"
|
"_netdev"
|
||||||
|
"x-systemd.automount"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
} else {};
|
} else {};
|
||||||
@@ -100,7 +89,7 @@ let
|
|||||||
mon_host = 172.16.239.211:6789,172.16.239.212:6789,172.16.239.213:6789
|
mon_host = 172.16.239.211:6789,172.16.239.212:6789,172.16.239.213:6789
|
||||||
log file = /tmp/ceph-$pid.log
|
log file = /tmp/ceph-$pid.log
|
||||||
[client.oceanbox]
|
[client.oceanbox]
|
||||||
key = replaceme
|
key = AQDb7sZokwnUAxAANjnzxX0p+W/FUtSYryuyqg==
|
||||||
[client.rbd]
|
[client.rbd]
|
||||||
key = replaceme
|
key = replaceme
|
||||||
'';
|
'';
|
||||||
@@ -113,7 +102,6 @@ in
|
|||||||
{
|
{
|
||||||
options.cluster.mounts = {
|
options.cluster.mounts = {
|
||||||
rdma.enable = mkEnableOption "Enable NFS over RDMA";
|
rdma.enable = mkEnableOption "Enable NFS over RDMA";
|
||||||
gbe100.enable = mkEnableOption "Enable NFS over 100 GbE";
|
|
||||||
automount.enable = mkEnableOption "Enable NFS automounting";
|
automount.enable = mkEnableOption "Enable NFS automounting";
|
||||||
users = mkEnableOption "Enable /users";
|
users = mkEnableOption "Enable /users";
|
||||||
opt = mkEnableOption "Enable /opt";
|
opt = mkEnableOption "Enable /opt";
|
||||||
|
|||||||
Reference in New Issue
Block a user