nixos/azure: improve documentation
This commit is contained in:
parent
0a0f6543ad
commit
538efe3263
@ -151,6 +151,8 @@
|
|||||||
|
|
||||||
- Support for CUDA 10 has been dropped, as announced in the 24.11 release notes.
|
- Support for CUDA 10 has been dropped, as announced in the 24.11 release notes.
|
||||||
|
|
||||||
|
- `virtualisation/azure-common.nix`'s filesystem and grub configurations have been moved to `virtualisation/azure-image.nix`. This makes `azure-common.nix` more generic so it could be used for users who generate Azure image using other methods (e.g. nixos-generators and disko). For existing users depending on these configurations, please also import `azure-image.nix`.
|
||||||
|
|
||||||
- `zammad` has had its support for MySQL removed, since it was never working correctly and is now deprecated upstream. Check the [migration guide](https://docs.zammad.org/en/latest/appendix/migrate-to-postgresql.html) for how to convert your database to PostgreSQL.
|
- `zammad` has had its support for MySQL removed, since it was never working correctly and is now deprecated upstream. Check the [migration guide](https://docs.zammad.org/en/latest/appendix/migrate-to-postgresql.html) for how to convert your database to PostgreSQL.
|
||||||
|
|
||||||
- The `earlyoom` service is now using upstream systemd service, which enables
|
- The `earlyoom` service is now using upstream systemd service, which enables
|
||||||
|
|||||||
@ -24,10 +24,16 @@ in
|
|||||||
|
|
||||||
config = {
|
config = {
|
||||||
services.waagent.enable = true;
|
services.waagent.enable = true;
|
||||||
|
|
||||||
|
# Enable cloud-init by default for waagent.
|
||||||
|
# Otherwise waagent would try manage networking using ifupdown,
|
||||||
|
# which is currently not availeble in nixpkgs.
|
||||||
services.cloud-init.enable = true;
|
services.cloud-init.enable = true;
|
||||||
services.cloud-init.network.enable = true;
|
services.cloud-init.network.enable = true;
|
||||||
systemd.services.cloud-config.serviceConfig.Restart = "on-failure";
|
systemd.services.cloud-config.serviceConfig.Restart = "on-failure";
|
||||||
|
|
||||||
|
# Ensure kernel outputs to ttyS0 (Azure Serial Console),
|
||||||
|
# and reboot machine upon fatal boot issues
|
||||||
boot.kernelParams = [
|
boot.kernelParams = [
|
||||||
"console=ttyS0"
|
"console=ttyS0"
|
||||||
"earlyprintk=ttyS0"
|
"earlyprintk=ttyS0"
|
||||||
@ -35,15 +41,18 @@ in
|
|||||||
"panic=1"
|
"panic=1"
|
||||||
"boot.panic_on_fail"
|
"boot.panic_on_fail"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
# Load Hyper-V kernel modules
|
||||||
boot.initrd.kernelModules = [
|
boot.initrd.kernelModules = [
|
||||||
"hv_vmbus"
|
"hv_vmbus"
|
||||||
"hv_netvsc"
|
"hv_netvsc"
|
||||||
"hv_utils"
|
"hv_utils"
|
||||||
"hv_storvsc"
|
"hv_storvsc"
|
||||||
];
|
];
|
||||||
boot.initrd.availableKernelModules = lib.optionals cfg.acceleratedNetworking mlxDrivers;
|
|
||||||
|
|
||||||
# Accelerated networking
|
# Accelerated networking, configured following:
|
||||||
|
# https://learn.microsoft.com/en-us/azure/virtual-network/accelerated-networking-overview
|
||||||
|
boot.initrd.availableKernelModules = lib.optionals cfg.acceleratedNetworking mlxDrivers;
|
||||||
systemd.network.networks."99-azure-unmanaged-devices.network" = lib.mkIf cfg.acceleratedNetworking {
|
systemd.network.networks."99-azure-unmanaged-devices.network" = lib.mkIf cfg.acceleratedNetworking {
|
||||||
matchConfig.Driver = mlxDrivers;
|
matchConfig.Driver = mlxDrivers;
|
||||||
linkConfig.Unmanaged = "yes";
|
linkConfig.Unmanaged = "yes";
|
||||||
|
|||||||
@ -76,12 +76,15 @@ in
|
|||||||
system.build.azureImage = import ../../lib/make-disk-image.nix {
|
system.build.azureImage = import ../../lib/make-disk-image.nix {
|
||||||
name = "azure-image";
|
name = "azure-image";
|
||||||
inherit (config.image) baseName;
|
inherit (config.image) baseName;
|
||||||
|
|
||||||
|
# Azure expects vhd format with fixed size,
|
||||||
|
# generating raw format and convert with subformat args afterwards
|
||||||
|
format = "raw";
|
||||||
postVM = ''
|
postVM = ''
|
||||||
${pkgs.vmTools.qemu}/bin/qemu-img convert -f raw -o subformat=fixed,force_size -O vpc $diskImage $out/${config.image.fileName}
|
${pkgs.vmTools.qemu}/bin/qemu-img convert -f raw -o subformat=fixed,force_size -O vpc $diskImage $out/${config.image.fileName}
|
||||||
rm $diskImage
|
rm $diskImage
|
||||||
'';
|
'';
|
||||||
configFile = ./azure-config-user.nix;
|
configFile = ./azure-config-user.nix;
|
||||||
format = "raw";
|
|
||||||
|
|
||||||
bootSize = "${toString cfg.bootSize}M";
|
bootSize = "${toString cfg.bootSize}M";
|
||||||
partitionTableType = if (cfg.vmGeneration == "v2") then "efi" else "legacy";
|
partitionTableType = if (cfg.vmGeneration == "v2") then "efi" else "legacy";
|
||||||
@ -96,8 +99,13 @@ in
|
|||||||
efiSupport = (cfg.vmGeneration == "v2");
|
efiSupport = (cfg.vmGeneration == "v2");
|
||||||
device = if efiSupport then "nodev" else "/dev/sda";
|
device = if efiSupport then "nodev" else "/dev/sda";
|
||||||
efiInstallAsRemovable = efiSupport;
|
efiInstallAsRemovable = efiSupport;
|
||||||
|
# Force grub to run in text mode and output to console
|
||||||
|
# by disabling font and splash image
|
||||||
font = null;
|
font = null;
|
||||||
splashImage = null;
|
splashImage = null;
|
||||||
|
# For Gen 1 VM, configurate grub output to serial_com0.
|
||||||
|
# Not needed for Gen 2 VM wbere serial_com0 does not exist,
|
||||||
|
# and outputing to console is enough to make Azure Serial Console working
|
||||||
extraConfig = lib.mkIf (!efiSupport) ''
|
extraConfig = lib.mkIf (!efiSupport) ''
|
||||||
serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1
|
serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1
|
||||||
terminal_input --append serial
|
terminal_input --append serial
|
||||||
@ -108,6 +116,7 @@ in
|
|||||||
fileSystems = {
|
fileSystems = {
|
||||||
"/" = {
|
"/" = {
|
||||||
device = "/dev/disk/by-label/${cfg.label}";
|
device = "/dev/disk/by-label/${cfg.label}";
|
||||||
|
inherit (cfg) label;
|
||||||
fsType = "ext4";
|
fsType = "ext4";
|
||||||
autoResize = true;
|
autoResize = true;
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user