LXC Container start stops with error on autostart

kmundi

Member
Jun 28, 2020
3
1
8
24
Hi everyone,
I have the problem that one container in my pve environment does not start anymore via autostart for some months now.

The container has some external bind mounts from a external zfs pool. This is my container configuration:
Code:
arch: amd64
cores: 4
debug: 1
features: nesting=1
hostname: dockerinfra00201
memory: 2048
mp0: local-raw:111/vm-111-disk-2.raw,mp=/var/lib/docker,size=8G
mp1: local-raw:111/vm-111-disk-1.raw,mp=/srv/,backup=1,size=8G
mp2: /mnt/pool1/nas/HOME/,mp=/pool1/nas/home
mp3: /mnt/pool1/nas/backups/,mp=/pool1/nas/backups
net0: name=eth0,bridge=vmbr0,firewall=1,gw=172.16.0.1,hwaddr=32:A7:01:27:31:C5,ip=172.16.0.17/24,type=veth
onboot: 1
ostype: debian
rootfs: local-zfs:subvol-111-disk-0,size=8G
startup: order=10,up=60
swap: 512

The container autostart fails with:
Code:
run_buffer: 321 Script exited with status 2
lxc_init: 847 Failed to run lxc.hook.pre-start for container "111"
__lxc_start: 2008 Failed to initialize container "111"
-pve-prestart-hook" for container "111", config section "lxc"
DEBUG    conf - conf.c:run_buffer:310 - Script exec /usr/share/lxc/hooks/lxc-pve-prestart-hook 111 lxc pre-start produced output: directory '/mnt/pool1/nas/HOME/' does not exist

ERROR    conf - conf.c:run_buffer:321 - Script exited with status 2
ERROR    start - start.c:lxc_init:847 - Failed to run lxc.hook.pre-start for container "111"
ERROR    start - start.c:__lxc_start:2008 - Failed to initialize container "111"
INFO     conf - conf.c:run_script_argv:337 - Executing script "/usr/share/lxc/hooks/lxc-pve-poststop-hook" for container "111", config section "lxc"
TASK ERROR: startup for container '111' failed

I can start afterwards the container without any errors manually.

Does anyone have an idea for that issue?


BR

kmundi
 
Sounds like /mnt/pool1/nas/HOME/ is mounted after the automatic start of the container. How are you mounting it? Can you arrange systemd service dependencies to make sure it is mounted earlier?
 
Thanks for pointing into the right direction!

I had to put the zvol again to the zpool.cache file.
Code:
 zpool set cachefile=/etc/zfs/zpool.cache pool1

Seems that since one of the last updates the pool wasn't part anymore of the configuration file.
 
  • Like
Reactions: leesteken

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!