From 95ca7b875096accf95ccc695e07ebdc96dc8e72f Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Thu, 31 Jul 2025 17:39:21 +0200 Subject: [PATCH] Keep compute nodes off when power comes back When the power comes back, we don't know if the AC unit will be operating properly or if the room will be at a safe temperature. So, instead of powering all the machines back, only configure the login to power on, so we can check the state of the room and power the rest of the machines. --- m/apex/configuration.nix | 3 +++ m/common/base.nix | 2 +- m/common/base/always-power-on.nix | 8 -------- m/common/base/power-policy.nix | 9 +++++++++ m/fox/configuration.nix | 3 +++ m/raccoon/configuration.nix | 3 +++ 6 files changed, 19 insertions(+), 9 deletions(-) delete mode 100644 m/common/base/always-power-on.nix create mode 100644 m/common/base/power-policy.nix diff --git a/m/apex/configuration.nix b/m/apex/configuration.nix index 540e5077..f4afe85d 100644 --- a/m/apex/configuration.nix +++ b/m/apex/configuration.nix @@ -5,9 +5,12 @@ ../common/xeon.nix ../common/ssf/hosts.nix ../module/ceph.nix + ../module/power-policy.nix ./nfs.nix ]; + power.policy = "always-on"; + # Don't install grub MBR for now boot.loader.grub.device = "nodev"; diff --git a/m/common/base.nix b/m/common/base.nix index cdd1dc19..2a00ac5d 100644 --- a/m/common/base.nix +++ b/m/common/base.nix @@ -3,7 +3,6 @@ # Includes the basic configuration for an Intel server. imports = [ ./base/agenix.nix - ./base/always-power-on.nix ./base/august-shutdown.nix ./base/boot.nix ./base/env.nix @@ -12,6 +11,7 @@ ./base/net.nix ./base/nix.nix ./base/ntp.nix + ./base/power-policy.nix ./base/rev.nix ./base/ssh.nix ./base/users.nix diff --git a/m/common/base/always-power-on.nix b/m/common/base/always-power-on.nix deleted file mode 100644 index cdee12c6..00000000 --- a/m/common/base/always-power-on.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ - imports = [ - ../../module/power-policy.nix - ]; - - # Turn on as soon as we have power - power.policy = "always-on"; -} diff --git a/m/common/base/power-policy.nix b/m/common/base/power-policy.nix new file mode 100644 index 00000000..48585a89 --- /dev/null +++ b/m/common/base/power-policy.nix @@ -0,0 +1,9 @@ +{ + imports = [ + ../../module/power-policy.nix + ]; + + # By default, keep the machines off as we don't know if the AC will be working + # once the electricity comes back. + power.policy = "always-off"; +} diff --git a/m/fox/configuration.nix b/m/fox/configuration.nix index 436a85ec..e7e8e8f3 100644 --- a/m/fox/configuration.nix +++ b/m/fox/configuration.nix @@ -6,8 +6,11 @@ ../common/xeon/console.nix ../module/emulation.nix ../module/nvidia.nix + ../module/power-policy.nix ]; + power.policy = "always-on"; + # Don't turn off on August as UPC has different dates. # Fox works fine on power cuts. systemd.timers.august-shutdown.enable = false; diff --git a/m/raccoon/configuration.nix b/m/raccoon/configuration.nix index 46f63f56..18603c6f 100644 --- a/m/raccoon/configuration.nix +++ b/m/raccoon/configuration.nix @@ -7,9 +7,12 @@ ../module/debuginfod.nix ../module/ssh-hut-extern.nix ../module/nvidia.nix + ../module/power-policy.nix ../eudy/kernel/perf.nix ]; + power.policy = "always-on"; + # Don't install Grub on the disk yet boot.loader.grub.device = "nodev";