back to qcow over size difference

Signed-off-by: Kiara Grouwstra <kiara@procolix.eu>
This commit is contained in:
Kiara Grouwstra 2025-09-24 22:26:46 +02:00
parent 8a3cd4a903
commit fd05b9a462
Signed by: kiara
SSH key fingerprint: SHA256:COspvLoLJ5WC5rFb9ZDe5urVCkK4LJZOsjfF4duRJFU
2 changed files with 9 additions and 4 deletions

View file

@ -466,6 +466,7 @@ let
inherit sources system;
configuration = tf-host.config.nixos-configuration;
};
inherit (machine.config.boot.uki) name;
environment = {
key_file = key-file;
@ -478,7 +479,7 @@ let
proxmox_password = proxmox-password;
ssh_user = username;
node_name = node-name;
image = "${machine.config.system.build.image}/${machine.config.boot.uki.name}.raw";
# image = "${machine.config.system.build.image}/${name}.raw";
};
tf-env = pkgs.callPackage ./run/tf-proxmox/tf-env.nix { };
proxmox-host = "192.168.51.81"; # root@fediversity-proxmox
@ -511,7 +512,11 @@ let
# cp $tmpdir/${vm_name}_host_key.pub /mnt/etc/ssh/ssh_host_ed25519_key.pub
# chmod 644 /mnt/etc/ssh/ssh_host_ed25519_key.pub
# .qcow2 is around half the size of .raw, on top of supporting backups - be it apparently at the cost of performance
qemu-img convert -f raw -O qcow2 -C "${machine.config.system.build.image}/${name}.raw" /tmp/${name}.qcow2
env ${toString (lib.mapAttrsToList (k: v: "TF_VAR_${k}=\"${toBash v}\"") environment)} \
TF_VAR_image=/tmp/${name}.qcow2 \
tf_env=${tf-env} bash ./deployment/run/tf-proxmox/run.sh
'';
};

View file

@ -8,7 +8,7 @@ terraform {
}
locals {
dump_name = "qemu-nixos-fediversity-${var.category}.raw"
dump_name = "qemu-nixos-fediversity-${var.category}.qcow2"
}
# https://registry.terraform.io/providers/bpg/proxmox/latest/docs
@ -124,7 +124,7 @@ resource "proxmox_virtual_environment_vm" "nix_vm" {
disk {
# datastore_id = "linstor_storage"
datastore_id = "local"
file_format = "raw"
file_format = "qcow2"
interface = "scsi0"
discard = "on"
iothread = true
@ -142,7 +142,7 @@ resource "proxmox_virtual_environment_vm" "nix_vm" {
efi_disk {
# datastore_id = "linstor_storage"
datastore_id = "local"
file_format = "raw"
file_format = "qcow2"
type = "4m"
}