I want NixOS to initialize incus, so I do the following:
1/ sudo systemctl stop incus.service incus.socket incus-preseed.service
2/ sudo rm -r /var/lib/incus
3/ sudo fdisk /dev/sdb for creating empy and not formated partition /dev/sdb1
4/ edit /etc/nixos/configuration.nix
5/ sudo nixos-rebuild switch
6/ reboot
It creates the bridgeprofile, the zfs storage pool, etc.
But if uncomment, it does not work…silently. It does 1 to 6 but no profiles and storage pools are created.
Well I did some journalctl -r to see what it is happening, spending to much time on it…
juin 04 10:49:01 ALPHA systemd[1]: Failed to start Incus initialization with preseed file.
juin 04 10:49:01 ALPHA systemd[1]: incus-preseed.service: Failed with result 'exit-code'.
juin 04 10:49:01 ALPHA systemd[1]: incus-preseed.service: Main process exited, code=exited, status=1/FAILURE
juin 04 10:49:01 ALPHA incus-preseed-start[931]: line 4: cannot unmarshal !!map into string
juin 04 10:49:01 ALPHA incus-preseed-start[931]: Error: Failed to parse the preseed: yaml: unmarshal errors:
juin 04 10:49:01 ALPHA systemd[1]: Starting Incus initialization with preseed file...
[alain@ALPHA:~]$ incus config show
config:
core.https_address: :8443
images.auto_update_interval: "18"
After (playing with incus-preseed.service:
[alain@ALPHA:~]$ sudo systemctl restart incus-preseed
Job for incus-preseed.service failed because the control process exited with error code.
See "systemctl status incus-preseed.service" and "journalctl -xeu incus-preseed.service" for details.
[alain@ALPHA:~]$ systemctl status incus-preseed.service
× incus-preseed.service - Incus initialization with preseed file
Loaded: loaded (/etc/systemd/system/incus-preseed.service; enabled; preset: enabled)
Active: failed (Result: exit-code) since Tue 2024-06-04 14:53:49 CEST; 2min 10s ago
Process: 15270 ExecStart=/nix/store/p9ym6i6yaxa0bv27s9qvn4a6d1w2ph4b-unit-script-incus-preseed-start/bin/incus-preseed-start (c>
Main PID: 15270 (code=exited, status=1/FAILURE)
IP: 0B in, 0B out
CPU: 43ms
juin 04 14:53:49 ALPHA systemd[1]: Starting Incus initialization with preseed file...
juin 04 14:53:49 ALPHA incus-preseed-start[15271]: Error: Failed to update storage pool "default": Pool source cannot be changed wh>
juin 04 14:53:49 ALPHA systemd[1]: incus-preseed.service: Main process exited, code=exited, status=1/FAILURE
juin 04 14:53:49 ALPHA systemd[1]: incus-preseed.service: Failed with result 'exit-code'.
juin 04 14:53:49 ALPHA systemd[1]: Failed to start Incus initialization with preseed file.
lines 1-13/13 (END)
[alain@ALPHA:~]$ incus config show
config:
core.https_address: :8443
images.auto_update_interval: "15"
So 15 intead of 18.
And you were right putting the cotes solved it. Key/value: and Key must be string here, a little bit tricky…
Thx a lot