mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-03-07 23:24:03 +01:00
nixos/amazon: move nvme_core.io_timeout to runtime module
This kernel parameter was accidentally added to the image builder module
in 2018 (e4777ae2d8) when it should have been in the runtime config.
This causes a mismatch between AMIs built with the builder and systems
configured with just the runtime module.
Move it to modules/virtualisation/amazon-image.nix so that all EC2
instances get the recommended NVMe timeout, regardless of how they
were provisioned.
This commit is contained in:
parent
84786db9e0
commit
323d269a24
2 changed files with 13 additions and 15 deletions
|
|
@ -11,7 +11,6 @@ let
|
|||
mkOption
|
||||
optionalString
|
||||
types
|
||||
versionAtLeast
|
||||
;
|
||||
inherit (lib.options) literalExpression;
|
||||
cfg = config.amazonImage;
|
||||
|
|
@ -46,16 +45,6 @@ in
|
|||
})
|
||||
];
|
||||
|
||||
# Amazon recommends setting this to the highest possible value for a good EBS
|
||||
# experience, which prior to 4.15 was 255.
|
||||
# https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/nvme-ebs-volumes.html#timeout-nvme-ebs-volumes
|
||||
config.boot.kernelParams =
|
||||
let
|
||||
timeout =
|
||||
if versionAtLeast config.boot.kernelPackages.kernel.version "4.15" then "4294967295" else "255";
|
||||
in
|
||||
[ "nvme_core.io_timeout=${timeout}" ];
|
||||
|
||||
options.amazonImage = {
|
||||
contents = mkOption {
|
||||
example = literalExpression ''
|
||||
|
|
|
|||
|
|
@ -59,10 +59,19 @@ in
|
|||
];
|
||||
boot.initrd.kernelModules = [ "xen-blkfront" ];
|
||||
boot.initrd.availableKernelModules = [ "nvme" ];
|
||||
boot.kernelParams = [
|
||||
"console=ttyS0,115200n8"
|
||||
"random.trust_cpu=on"
|
||||
];
|
||||
boot.kernelParams =
|
||||
let
|
||||
# Amazon recommends setting this to the highest possible value for a good EBS
|
||||
# experience, which prior to 4.15 was 255.
|
||||
# https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/nvme-ebs-volumes.html#timeout-nvme-ebs-volumes
|
||||
nvmeTimeout =
|
||||
if lib.versionAtLeast config.boot.kernelPackages.kernel.version "4.15" then "4294967295" else "255";
|
||||
in
|
||||
[
|
||||
"console=ttyS0,115200n8"
|
||||
"random.trust_cpu=on"
|
||||
"nvme_core.io_timeout=${nvmeTimeout}"
|
||||
];
|
||||
|
||||
# Prevent the nouveau kernel module from being loaded, as it
|
||||
# interferes with the nvidia/nvidia-uvm modules needed for CUDA.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue