proxmox-nixos
proxmox-nixos copied to clipboard
Unable to create Directory-based Storage
Before Attemtping this I had to add the following to enable ZFS support (even if I don't intend on using it).
let
zfsCompatibleKernelPackages = lib.filterAttrs (
name: kernelPackages:
(builtins.match "linux_[0-9]+_[0-9]+" name) != null
&& (builtins.tryEval kernelPackages).success
&& (!kernelPackages.${config.boot.zfs.package.kernelModuleAttribute}.meta.broken)
) pkgs.linuxKernel.packages;
latestKernelPackage = lib.last (
lib.sort (a: b: (lib.versionOlder a.kernel.version b.kernel.version)) (
builtins.attrValues zfsCompatibleKernelPackages
)
);
in
{
...
boot.kernelPackages = latestKernelPackage;
boot.zfs.package = pkgs.zfs_unstable;
boot.supportedFilesystems = [ "zfs" ];
networking.hostId = "30c52ebd";
...
}
As a result the following gets reported when I try and create a Directory:
Feb 02 16:11:42 nixos pvedaemon[5532]: unable to open file '/etc/systemd/system/mnt-pve-storage\x2d1.mount.tmp.5532' - Read-only file system
Feb 02 16:11:42 nixos pvedaemon[3248]: <root@pam> end task UPID:nixos:0000159C:0000686F:679FDF6C:dircreate:storage-1:root@pam: unable to open file '/etc/systemd/system/mnt-pve-storage\x2d1.mount.tmp.5532' - Read-only file system
I was able to bypass this by creating ZFS Pools for my two disks and including an existing directory from my filesystem. You could probably bypass this all together if you let nixos manage your disks and then just add the directories manually instead of letting Proxmox format them for you (I only learned this after I posted the issue).
Note that it appears the only supported Storage medium is ZFS (which requires the following above to be configured). I was not able to create LVMs or Directory Disks this way.