Container starten nicht mehr (nach mount / reboot)

Raigeki

New Member
Apr 26, 2021
2
0
1
35
Guten Tag,

ich habe jüngst eine externe Platte an das System angeschlossen. Diese wollte ich direkt an einen LXC-Container durchreichen. Nach dem mount im host war die Platte unter dem Namen sde zu finden (sda-sdd sind die vier Platten meines raidz2). Nach einem reboot starteten alle Container, die einen Teil des ZFS abbekommen sollen nicht mehr. Nach einem erneuten "lsblk -f", habe ich festegestellt, dass die externe Platte nun unter sda zu finden ist. In der Hoffnung, dass sich meine Problem vorerst von alleine Lösen, habe ich die externe unmounted und vorerst abgeschlossen. Nach erneutem reboot ist die Namensgebung wiederhergestellt (sda-sdd für das ZFS), die Container starten allerdings noch immer nicht.

Beispiel, Container 199:

lxc-start -n 199
Code:
lxc-start: 199: lxccontainer.c: wait_on_daemonized_start: 856 No such file or directory - Failed to receive the container state
lxc-start: 199: tools/lxc_start.c: main: 330 The container failed to start
lxc-start: 199: tools/lxc_start.c: main: 333 To get more details, run the container in foreground mode
lxc-start: 199: tools/lxc_start.c: main: 336 Additional information can be obtained by setting the --logfile and --logpriority options

lxc-start -n 199 -F -lDEBUG -o lxc-199.log
Code:
lxc-start: 199: conf.c: run_buffer: 335 Script exited with status 2
lxc-start: 199: start.c: lxc_init: 861 Failed to run lxc.hook.pre-start for container "199"
lxc-start: 199: start.c: __lxc_start: 1944 Failed to initialize container "199"
lxc-start: 199: tools/lxc_start.c: main: 330 The container failed to start
lxc-start: 199: tools/lxc_start.c: main: 336 Additional information can be obtained by setting the --logfile and --logpriority options

more /etc/pve/lxc/199.conf
Code:
arch: amd64
cores: 2
hostname: chia
memory: 4096
net0: name=eth0,bridge=vmbr0,gw=192.168.0.1,hwaddr=7E:F8:12:E0:3C:B1,ip=192.168.0.199/24,type=veth
onboot: 1
ostype: ubuntu
rootfs: zfs:subvol-199-disk-0,size=5T
swap: 4096
unprivileged: 1

pct mount 199
Code:
mounted CT 199 in '/var/lib/lxc/199/rootfs'

more lxc-199.log
Code:
lxc-start 199 20210426155850.539 INFO     confile - confile.c:set_config_idmaps:1673 - Read uid map: type u nsid 0 hostid 100000 range 65536
lxc-start 199 20210426155850.539 INFO     confile - confile.c:set_config_idmaps:1673 - Read uid map: type g nsid 0 hostid 100000 range 65536
lxc-start 199 20210426155850.541 INFO     lsm - lsm/lsm.c:lsm_init:50 - LSM security driver AppArmor
lxc-start 199 20210426155850.542 INFO     seccomp - seccomp.c:parse_config_v2:759 - Processing "reject_force_umount  # comment this to allow umount -f;  not recommended"
lxc-start 199 20210426155850.542 INFO     seccomp - seccomp.c:do_resolve_add_rule:505 - Set seccomp rule to reject force umounts
lxc-start 199 20210426155850.542 INFO     seccomp - seccomp.c:parse_config_v2:937 - Added native rule for arch 0 for reject_force_umount action 0(kill)
lxc-start 199 20210426155850.542 INFO     seccomp - seccomp.c:do_resolve_add_rule:505 - Set seccomp rule to reject force umounts
lxc-start 199 20210426155850.542 INFO     seccomp - seccomp.c:parse_config_v2:946 - Added compat rule for arch 1073741827 for reject_force_umount action 0(kill)
lxc-start 199 20210426155850.542 INFO     seccomp - seccomp.c:do_resolve_add_rule:505 - Set seccomp rule to reject force umounts
lxc-start 199 20210426155850.542 INFO     seccomp - seccomp.c:parse_config_v2:956 - Added compat rule for arch 1073741886 for reject_force_umount action 0(kill)
lxc-start 199 20210426155850.542 INFO     seccomp - seccomp.c:do_resolve_add_rule:505 - Set seccomp rule to reject force umounts
lxc-start 199 20210426155850.542 INFO     seccomp - seccomp.c:parse_config_v2:966 - Added native rule for arch -1073741762 for reject_force_umount action 0(kill)
lxc-start 199 20210426155850.542 INFO     seccomp - seccomp.c:parse_config_v2:759 - Processing "[all]"
lxc-start 199 20210426155850.542 INFO     seccomp - seccomp.c:parse_config_v2:759 - Processing "kexec_load errno 1"
lxc-start 199 20210426155850.542 INFO     seccomp - seccomp.c:parse_config_v2:937 - Added native rule for arch 0 for kexec_load action 327681(errno)
lxc-start 199 20210426155850.542 INFO     seccomp - seccomp.c:parse_config_v2:946 - Added compat rule for arch 1073741827 for kexec_load action 327681(errno)
lxc-start 199 20210426155850.542 INFO     seccomp - seccomp.c:parse_config_v2:956 - Added compat rule for arch 1073741886 for kexec_load action 327681(errno)
lxc-start 199 20210426155850.542 INFO     seccomp - seccomp.c:parse_config_v2:966 - Added native rule for arch -1073741762 for kexec_load action 327681(errno)
lxc-start 199 20210426155850.542 INFO     seccomp - seccomp.c:parse_config_v2:759 - Processing "open_by_handle_at errno 1"
lxc-start 199 20210426155850.542 INFO     seccomp - seccomp.c:parse_config_v2:937 - Added native rule for arch 0 for open_by_handle_at action 327681(errno)
lxc-start 199 20210426155850.542 INFO     seccomp - seccomp.c:parse_config_v2:946 - Added compat rule for arch 1073741827 for open_by_handle_at action 327681(errno)
lxc-start 199 20210426155850.542 INFO     seccomp - seccomp.c:parse_config_v2:956 - Added compat rule for arch 1073741886 for open_by_handle_at action 327681(errno)
lxc-start 199 20210426155850.542 INFO     seccomp - seccomp.c:parse_config_v2:966 - Added native rule for arch -1073741762 for open_by_handle_at action 327681(errno)
lxc-start 199 20210426155850.542 INFO     seccomp - seccomp.c:parse_config_v2:759 - Processing "init_module errno 1"
lxc-start 199 20210426155850.542 INFO     seccomp - seccomp.c:parse_config_v2:937 - Added native rule for arch 0 for init_module action 327681(errno)
lxc-start 199 20210426155850.543 INFO     seccomp - seccomp.c:parse_config_v2:946 - Added compat rule for arch 1073741827 for init_module action 327681(errno)
lxc-start 199 20210426155850.543 INFO     seccomp - seccomp.c:parse_config_v2:956 - Added compat rule for arch 1073741886 for init_module action 327681(errno)
lxc-start 199 20210426155850.543 INFO     seccomp - seccomp.c:parse_config_v2:966 - Added native rule for arch -1073741762 for init_module action 327681(errno)
lxc-start 199 20210426155850.543 INFO     seccomp - seccomp.c:parse_config_v2:759 - Processing "finit_module errno 1"
lxc-start 199 20210426155850.543 INFO     seccomp - seccomp.c:parse_config_v2:937 - Added native rule for arch 0 for finit_module action 327681(errno)
lxc-start 199 20210426155850.543 INFO     seccomp - seccomp.c:parse_config_v2:946 - Added compat rule for arch 1073741827 for finit_module action 327681(errno)
lxc-start 199 20210426155850.543 INFO     seccomp - seccomp.c:parse_config_v2:956 - Added compat rule for arch 1073741886 for finit_module action 327681(errno)
lxc-start 199 20210426155850.543 INFO     seccomp - seccomp.c:parse_config_v2:966 - Added native rule for arch -1073741762 for finit_module action 327681(errno)
lxc-start 199 20210426155850.543 INFO     seccomp - seccomp.c:parse_config_v2:759 - Processing "delete_module errno 1"
lxc-start 199 20210426155850.543 INFO     seccomp - seccomp.c:parse_config_v2:937 - Added native rule for arch 0 for delete_module action 327681(errno)
lxc-start 199 20210426155850.543 INFO     seccomp - seccomp.c:parse_config_v2:946 - Added compat rule for arch 1073741827 for delete_module action 327681(errno)
lxc-start 199 20210426155850.543 INFO     seccomp - seccomp.c:parse_config_v2:956 - Added compat rule for arch 1073741886 for delete_module action 327681(errno)
lxc-start 199 20210426155850.543 INFO     seccomp - seccomp.c:parse_config_v2:966 - Added native rule for arch -1073741762 for delete_module action 327681(errno)
lxc-start 199 20210426155850.543 INFO     seccomp - seccomp.c:parse_config_v2:759 - Processing "keyctl errno 38"
lxc-start 199 20210426155850.543 INFO     seccomp - seccomp.c:parse_config_v2:937 - Added native rule for arch 0 for keyctl action 327718(errno)
lxc-start 199 20210426155850.543 INFO     seccomp - seccomp.c:parse_config_v2:946 - Added compat rule for arch 1073741827 for keyctl action 327718(errno)
lxc-start 199 20210426155850.543 INFO     seccomp - seccomp.c:parse_config_v2:956 - Added compat rule for arch 1073741886 for keyctl action 327718(errno)
lxc-start 199 20210426155850.543 INFO     seccomp - seccomp.c:parse_config_v2:966 - Added native rule for arch -1073741762 for keyctl action 327718(errno)
lxc-start 199 20210426155850.543 INFO     seccomp - seccomp.c:parse_config_v2:970 - Merging compat seccomp contexts into main context
lxc-start 199 20210426155850.544 INFO     conf - conf.c:run_script_argv:356 - Executing script "/usr/share/lxc/hooks/lxc-pve-prestart-hook" for container "199", config section "lxc"
lxc-start 199 20210426155850.451 DEBUG    conf - conf.c:run_buffer:326 - Script exec /usr/share/lxc/hooks/lxc-pve-prestart-hook 199 lxc pre-start with output: unable to detect OS distribution


lxc-start 199 20210426155850.458 ERROR    conf - conf.c:run_buffer:335 - Script exited with status 2
lxc-start 199 20210426155850.458 ERROR    start - start.c:lxc_init:861 - Failed to run lxc.hook.pre-start for container "199"
lxc-start 199 20210426155850.458 ERROR    start - start.c:__lxc_start:1944 - Failed to initialize container "199"
lxc-start 199 20210426155850.458 ERROR    lxc_start - tools/lxc_start.c:main:330 - The container failed to start
lxc-start 199 20210426155850.458 ERROR    lxc_start - tools/lxc_start.c:main:336 - Additional information can be obtained by setting the --logfile and --logpriority options

Da ich nicht allzu viel von der Materie verstehe, bin ich mit meinem Latein leider am Ende. Jemand eine Idee, woran es liegen könnte?

Liebe Grüße,
Marco.
 
Guten Tag,

ich habe jüngst eine externe Platte an das System angeschlossen. Diese wollte ich direkt an einen LXC-Container durchreichen. Nach dem mount im host war die Platte unter dem Namen sde zu finden (sda-sdd sind die vier Platten meines raidz2). Nach einem reboot starteten alle Container, die einen Teil des ZFS abbekommen sollen nicht mehr. Nach einem erneuten "lsblk -f", habe ich festegestellt, dass die externe Platte nun unter sda zu finden ist. In der Hoffnung, dass sich meine Problem vorerst von alleine Lösen, habe ich die externe unmounted und vorerst abgeschlossen. Nach erneutem reboot ist die Namensgebung wiederhergestellt (sda-sdd für das ZFS), die Container starten allerdings noch immer nicht.

Beispiel, Container 199:

lxc-start -n 199
Code:
lxc-start: 199: lxccontainer.c: wait_on_daemonized_start: 856 No such file or directory - Failed to receive the container state
lxc-start: 199: tools/lxc_start.c: main: 330 The container failed to start
lxc-start: 199: tools/lxc_start.c: main: 333 To get more details, run the container in foreground mode
lxc-start: 199: tools/lxc_start.c: main: 336 Additional information can be obtained by setting the --logfile and --logpriority options

lxc-start -n 199 -F -lDEBUG -o lxc-199.log
Code:
lxc-start: 199: conf.c: run_buffer: 335 Script exited with status 2
lxc-start: 199: start.c: lxc_init: 861 Failed to run lxc.hook.pre-start for container "199"
lxc-start: 199: start.c: __lxc_start: 1944 Failed to initialize container "199"
lxc-start: 199: tools/lxc_start.c: main: 330 The container failed to start
lxc-start: 199: tools/lxc_start.c: main: 336 Additional information can be obtained by setting the --logfile and --logpriority options

more /etc/pve/lxc/199.conf
Code:
arch: amd64
cores: 2
hostname: chia
memory: 4096
net0: name=eth0,bridge=vmbr0,gw=192.168.0.1,hwaddr=7E:F8:12:E0:3C:B1,ip=192.168.0.199/24,type=veth
onboot: 1
ostype: ubuntu
rootfs: zfs:subvol-199-disk-0,size=5T
swap: 4096
unprivileged: 1

pct mount 199
Code:
mounted CT 199 in '/var/lib/lxc/199/rootfs'

more lxc-199.log
Code:
lxc-start 199 20210426155850.539 INFO     confile - confile.c:set_config_idmaps:1673 - Read uid map: type u nsid 0 hostid 100000 range 65536
lxc-start 199 20210426155850.539 INFO     confile - confile.c:set_config_idmaps:1673 - Read uid map: type g nsid 0 hostid 100000 range 65536
lxc-start 199 20210426155850.541 INFO     lsm - lsm/lsm.c:lsm_init:50 - LSM security driver AppArmor
lxc-start 199 20210426155850.542 INFO     seccomp - seccomp.c:parse_config_v2:759 - Processing "reject_force_umount  # comment this to allow umount -f;  not recommended"
lxc-start 199 20210426155850.542 INFO     seccomp - seccomp.c:do_resolve_add_rule:505 - Set seccomp rule to reject force umounts
lxc-start 199 20210426155850.542 INFO     seccomp - seccomp.c:parse_config_v2:937 - Added native rule for arch 0 for reject_force_umount action 0(kill)
lxc-start 199 20210426155850.542 INFO     seccomp - seccomp.c:do_resolve_add_rule:505 - Set seccomp rule to reject force umounts
lxc-start 199 20210426155850.542 INFO     seccomp - seccomp.c:parse_config_v2:946 - Added compat rule for arch 1073741827 for reject_force_umount action 0(kill)
lxc-start 199 20210426155850.542 INFO     seccomp - seccomp.c:do_resolve_add_rule:505 - Set seccomp rule to reject force umounts
lxc-start 199 20210426155850.542 INFO     seccomp - seccomp.c:parse_config_v2:956 - Added compat rule for arch 1073741886 for reject_force_umount action 0(kill)
lxc-start 199 20210426155850.542 INFO     seccomp - seccomp.c:do_resolve_add_rule:505 - Set seccomp rule to reject force umounts
lxc-start 199 20210426155850.542 INFO     seccomp - seccomp.c:parse_config_v2:966 - Added native rule for arch -1073741762 for reject_force_umount action 0(kill)
lxc-start 199 20210426155850.542 INFO     seccomp - seccomp.c:parse_config_v2:759 - Processing "[all]"
lxc-start 199 20210426155850.542 INFO     seccomp - seccomp.c:parse_config_v2:759 - Processing "kexec_load errno 1"
lxc-start 199 20210426155850.542 INFO     seccomp - seccomp.c:parse_config_v2:937 - Added native rule for arch 0 for kexec_load action 327681(errno)
lxc-start 199 20210426155850.542 INFO     seccomp - seccomp.c:parse_config_v2:946 - Added compat rule for arch 1073741827 for kexec_load action 327681(errno)
lxc-start 199 20210426155850.542 INFO     seccomp - seccomp.c:parse_config_v2:956 - Added compat rule for arch 1073741886 for kexec_load action 327681(errno)
lxc-start 199 20210426155850.542 INFO     seccomp - seccomp.c:parse_config_v2:966 - Added native rule for arch -1073741762 for kexec_load action 327681(errno)
lxc-start 199 20210426155850.542 INFO     seccomp - seccomp.c:parse_config_v2:759 - Processing "open_by_handle_at errno 1"
lxc-start 199 20210426155850.542 INFO     seccomp - seccomp.c:parse_config_v2:937 - Added native rule for arch 0 for open_by_handle_at action 327681(errno)
lxc-start 199 20210426155850.542 INFO     seccomp - seccomp.c:parse_config_v2:946 - Added compat rule for arch 1073741827 for open_by_handle_at action 327681(errno)
lxc-start 199 20210426155850.542 INFO     seccomp - seccomp.c:parse_config_v2:956 - Added compat rule for arch 1073741886 for open_by_handle_at action 327681(errno)
lxc-start 199 20210426155850.542 INFO     seccomp - seccomp.c:parse_config_v2:966 - Added native rule for arch -1073741762 for open_by_handle_at action 327681(errno)
lxc-start 199 20210426155850.542 INFO     seccomp - seccomp.c:parse_config_v2:759 - Processing "init_module errno 1"
lxc-start 199 20210426155850.542 INFO     seccomp - seccomp.c:parse_config_v2:937 - Added native rule for arch 0 for init_module action 327681(errno)
lxc-start 199 20210426155850.543 INFO     seccomp - seccomp.c:parse_config_v2:946 - Added compat rule for arch 1073741827 for init_module action 327681(errno)
lxc-start 199 20210426155850.543 INFO     seccomp - seccomp.c:parse_config_v2:956 - Added compat rule for arch 1073741886 for init_module action 327681(errno)
lxc-start 199 20210426155850.543 INFO     seccomp - seccomp.c:parse_config_v2:966 - Added native rule for arch -1073741762 for init_module action 327681(errno)
lxc-start 199 20210426155850.543 INFO     seccomp - seccomp.c:parse_config_v2:759 - Processing "finit_module errno 1"
lxc-start 199 20210426155850.543 INFO     seccomp - seccomp.c:parse_config_v2:937 - Added native rule for arch 0 for finit_module action 327681(errno)
lxc-start 199 20210426155850.543 INFO     seccomp - seccomp.c:parse_config_v2:946 - Added compat rule for arch 1073741827 for finit_module action 327681(errno)
lxc-start 199 20210426155850.543 INFO     seccomp - seccomp.c:parse_config_v2:956 - Added compat rule for arch 1073741886 for finit_module action 327681(errno)
lxc-start 199 20210426155850.543 INFO     seccomp - seccomp.c:parse_config_v2:966 - Added native rule for arch -1073741762 for finit_module action 327681(errno)
lxc-start 199 20210426155850.543 INFO     seccomp - seccomp.c:parse_config_v2:759 - Processing "delete_module errno 1"
lxc-start 199 20210426155850.543 INFO     seccomp - seccomp.c:parse_config_v2:937 - Added native rule for arch 0 for delete_module action 327681(errno)
lxc-start 199 20210426155850.543 INFO     seccomp - seccomp.c:parse_config_v2:946 - Added compat rule for arch 1073741827 for delete_module action 327681(errno)
lxc-start 199 20210426155850.543 INFO     seccomp - seccomp.c:parse_config_v2:956 - Added compat rule for arch 1073741886 for delete_module action 327681(errno)
lxc-start 199 20210426155850.543 INFO     seccomp - seccomp.c:parse_config_v2:966 - Added native rule for arch -1073741762 for delete_module action 327681(errno)
lxc-start 199 20210426155850.543 INFO     seccomp - seccomp.c:parse_config_v2:759 - Processing "keyctl errno 38"
lxc-start 199 20210426155850.543 INFO     seccomp - seccomp.c:parse_config_v2:937 - Added native rule for arch 0 for keyctl action 327718(errno)
lxc-start 199 20210426155850.543 INFO     seccomp - seccomp.c:parse_config_v2:946 - Added compat rule for arch 1073741827 for keyctl action 327718(errno)
lxc-start 199 20210426155850.543 INFO     seccomp - seccomp.c:parse_config_v2:956 - Added compat rule for arch 1073741886 for keyctl action 327718(errno)
lxc-start 199 20210426155850.543 INFO     seccomp - seccomp.c:parse_config_v2:966 - Added native rule for arch -1073741762 for keyctl action 327718(errno)
lxc-start 199 20210426155850.543 INFO     seccomp - seccomp.c:parse_config_v2:970 - Merging compat seccomp contexts into main context
lxc-start 199 20210426155850.544 INFO     conf - conf.c:run_script_argv:356 - Executing script "/usr/share/lxc/hooks/lxc-pve-prestart-hook" for container "199", config section "lxc"
lxc-start 199 20210426155850.451 DEBUG    conf - conf.c:run_buffer:326 - Script exec /usr/share/lxc/hooks/lxc-pve-prestart-hook 199 lxc pre-start with output: unable to detect OS distribution


lxc-start 199 20210426155850.458 ERROR    conf - conf.c:run_buffer:335 - Script exited with status 2
lxc-start 199 20210426155850.458 ERROR    start - start.c:lxc_init:861 - Failed to run lxc.hook.pre-start for container "199"
lxc-start 199 20210426155850.458 ERROR    start - start.c:__lxc_start:1944 - Failed to initialize container "199"
lxc-start 199 20210426155850.458 ERROR    lxc_start - tools/lxc_start.c:main:330 - The container failed to start
lxc-start 199 20210426155850.458 ERROR    lxc_start - tools/lxc_start.c:main:336 - Additional information can be obtained by setting the --logfile and --logpriority options

Da ich nicht allzu viel von der Materie verstehe, bin ich mit meinem Latein leider am Ende. Jemand eine Idee, woran es liegen könnte?

Liebe Grüße,
Marco.
Erstmal solltest du nicht sda, sdb, sdc usw benutzen sondern /dev/disk/by-uuid/UuidDerDisk wenn du etwas mountest. Dann ist es auch egal, wenn sich die Namen der Disks ändern, wenn du Disks entfernst oder hinzufügst.
Dann musst du gucken, dass da auch wirklich alles gemountet ist. Ich bringe z.B. meine SMB-Shares über Bind-Mounts in den LXC. Ist mein Netzwerk noch nicht bereit wenn der LXC beim reboot versucht automatisch zu starten, dann weigert sich der LXC mit genau dem gleichen Fehler (Failed to run lxc.hook.pre-start for container X) zu starten, da der Bind-Mount nicht gemountet werden kann.

Also ich würde mal tippen, dass da der LXC die externe HDD nicht mounten kann und daher das Starten verweigert.
 
Last edited:
Erstmal solltest du nicht sda, sdb, sdc usw benutzen sondern /dev/disk/by-uuid/UuidDerDisk wenn du etwas mountest. Dann ist es auch egal, wenn sich die Namen der Disks ändern, wenn du Disks entfernst oder hinzufügst.
Dann musst du gucken, dass da auch wirklich alles gemountet ist. Ich bringe z.B. meine SMB-Shares über Bind-Mounts in den LXC. Ist mein Netzwerk noch nicht bereit wenn der LXC beim reboot versucht automatisch zu starten, dann weigert sich der LXC mit genau dem gleichen Fehler (Failed to run lxc.hook.pre-start for container X) zu starten, da der Bind-Mount nicht gemountet werden kann.

Also ich würde mal tippen, dass da der LXC die externe HDD nicht mounten kann und daher das Starten verweigert.
Danke für den Tipp mit den mounts über die uuid, das wird dann wohl meine nächste Baustelle werden. Allerding habe ich die Platte bisher nur im host gemountet, mein LXC dürfte davon doch eigentlich unbeeindruckt sein?
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!