diff --git a/hosts/server10/default.nix b/hosts/server10/default.nix index 8e985d9f..1b829a29 100644 --- a/hosts/server10/default.nix +++ b/hosts/server10/default.nix @@ -11,7 +11,7 @@ hq.statistics.enable = true; }; - boot= { + boot = { loader.grub = { enable = true; version = 2; @@ -49,6 +49,7 @@ "data-hoarder" "staging-data-hoarder" ]; + skyflake.nomad.client.meta."c3d2.cpuSpeed" = "4"; system.stateVersion = "21.11"; # Did you read the comment? } diff --git a/hosts/server8/default.nix b/hosts/server8/default.nix index da572ea3..e84a6b59 100644 --- a/hosts/server8/default.nix +++ b/hosts/server8/default.nix @@ -38,4 +38,5 @@ # deployment.microvmBaseZfsDataset = "tank/storage"; hq.statistics.enable = true; }; + skyflake.nomad.client.meta."c3d2.cpuSpeed" = "3"; } diff --git a/hosts/server9/default.nix b/hosts/server9/default.nix index 0c88f765..ea5a2b4c 100644 --- a/hosts/server9/default.nix +++ b/hosts/server9/default.nix @@ -35,6 +35,7 @@ deployment.microvmBaseZfsDataset = "tank/storage"; hq.statistics.enable = true; }; + skyflake.nomad.client.meta."c3d2.cpuSpeed" = "3"; # XXX: enable for zw-ev and poelzi-ha until we find a better solution virtualisation.libvirtd = { diff --git a/modules/cluster/deployment-options.nix b/modules/cluster/deployment-options.nix index 13248180..be567046 100644 --- a/modules/cluster/deployment-options.nix +++ b/modules/cluster/deployment-options.nix @@ -21,6 +21,16 @@ storage = mkOption { type = types.enum [ "fast" "big" ]; default = "fast"; + description = '' + Which glusterfs volume to use for persistedShares + ''; + }; + needForSpeed = mkOption { + type = types.bool; + default = false; + description = '' + Prefer deployment on Nomad clients with a higher c3d2.cpuSpeed + ''; }; }; } diff --git a/modules/cluster/deployment.nix b/modules/cluster/deployment.nix index 46468380..b6096ea3 100644 --- a/modules/cluster/deployment.nix +++ b/modules/cluster/deployment.nix @@ -77,10 +77,17 @@ in }; skyflake = { - nomadJob.constraints = lib.optionals (config.deployment.storage == "big") [ { - attribute = "\${meta.c3d2.storage}"; - value = "big"; - } ]; + nomadJob = { + constraints = lib.optionals (config.deployment.storage == "big") [ { + attribute = "\${meta.c3d2.storage}"; + value = "big"; + } ]; + affinities = lib.optionals config.deployment.needForSpeed (builtins.genList (i: { + attribute = "\${meta.c3d2.cpuSpeed}"; + value = toString (i + 1); + weight = 10 + i; + }) 10); + }; }; networking = {