Skip to content

Commit

Permalink
azure-image: add an internal memSize option to workaround potential OOM
Browse files Browse the repository at this point in the history
  • Loading branch information
codgician committed Dec 21, 2024
1 parent 67e4045 commit eac97da
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion nixos/modules/virtualisation/azure-image.nix
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,16 @@ in
For v2, secure boot needs to be turned off during creation.
'';
};

memSize = mkOption {
type = types.nullOr types.int;
default = null;
internal = true;
description = ''
Guest memory allocation size during image generation, in MiB.
Only change this when you face Out-Of-Memory issue in QEMU when generating image.
'';
};
};

config = {
Expand All @@ -89,7 +99,7 @@ in
bootSize = "${toString cfg.bootSize}M";
partitionTableType = if (cfg.vmGeneration == "v2") then "efi" else "legacy";

inherit (cfg) contents label;
inherit (cfg) contents label memSize;
inherit (config.virtualisation) diskSize;
inherit config lib pkgs;
};
Expand Down

0 comments on commit eac97da

Please sign in to comment.