Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose Storage Options in proxmox.nix #387

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

reinthal
Copy link

Feature added

  • Exposes the upstream options to configure underlying storage.

What problem does it solve?

When Proxmox does not have local-lvm as a default storage then qmrestore fails.

restore vma archive: zstd -q -d -c /root/vzdump-qemu-nixos-24.11.20240921.9357f4f.vma.zst | vma extract -v -r /var/tmp/vzdumptmp906885.fifo - /var/tmp/vzdumptmp906885
CFG: size: 401 name: qemu-server.conf
DEV: dev_id=1 size: 21474836480 devname: drive-virtio0
CTIME: Mon Sep 23 15:15:37 2024
new volume ID is 'local-zfs:vm-9604-cloudinit'
temporary volume 'local-zfs:vm-9604-cloudinit' sucessfuly removed
no lock found trying to remove 'create'  lock
error before or during data restore, some or all disks were not completely restored. VM 9604 state is NOT cleaned up.

TASK ERROR: command 'set -o pipefail && zstd -q -d -c /root/vzdump-qemu-nixos-24.11.20240921.9357f4f.vma.zst | vma extract -v -r /var/tmp/vzdumptmp906885.fifo - /var/tmp/vzdumptmp906885' failed: storage 'local-lvm' is not available on node 'pve'

steps to reproduce

Test setting virtio0 to a non-existing storage device. For exampl, use the following flake and set the device using the PRs exposed functionality

 {
  inputs = {
    nixpkgs.url = "nixpkgs/nixos-unstable";
    nixos-generators = {
      url = "github:reinthal/nixos-generators";
      inputs.nixpkgs.follows = "nixpkgs";
    };
  };
  outputs = {
    nixpkgs,
    nixos-generators,
    ...
  }: let
    system = "x86_64-linux";
  in {
    packages.x86_64-linux = {
      proxmox = nixos-generators.nixosGenerate {
        system = "${system}";
        specialArgs = {
          diskSize = "20480";
          virtio0 = "local-zfs:vm-9999-disk-0";
          cloudInitDefaultStorage = "local-zfs";
        };
        modules = [
          ({...}: {nix.registry.nixpkgs.flake = nixpkgs;})
          ./server
        ];
        format = "proxmox";
      };

      proxmox-lxc = nixos-generators.nixosGenerate {
        system = "${system}";
        modules = [
          ({...}: {nix.registry.nixpkgs.flake = nixpkgs;})
          ./server
        ];
        format = "proxmox-lxc";
      };
    };
  };
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant