Conversion OpenVZ => LXC with bind mount fails to boot

deveth0

New Member
Sep 3, 2014
8
1
1
Hi all,

first of all, thanks for this awesome product and the real real straight forward way of upgrading from version 3 to 4. I took the whole weekend off to do the upgrade but was done on saturday afternoon :)

My setup:
I installed Debian Jessie ~1 year ago and added proxmox afterwards (using this wiki page: https://pve.proxmox.com/wiki/Install_Proxmox_VE_on_Debian_Jessie) Most of my vms were running with Openvz, one with bind mounts:
Host /mnt/foo/bar => Guest /mnt/bar

After the upgrade (https://pve.proxmox.com/wiki/Upgrade_from_3.x_to_4.0) I performed an import of my backups (https://pve.proxmox.com/wiki/Convert_OpenVZ_to_LXC) and started all vms. This works fine.
But as soon as I added the bind mount (https://pve.proxmox.com/wiki/LXC_Bind_Mounts) I got error from app armor:
Code:
apparmor="DENIED" operation="mount"
Some search brought up this page, which helped to remove this error:
Code:
https://gist.github.com/gionn/7585324
But nevertheless my vm does not start:
Code:
root@proxmox:/home/deveth0# pct start 113
lxc-start: lxc_start.c: main: 344 The container failed to start.
lxc-start: lxc_start.c: main: 346 To get more details, run the container in foreground mode.
lxc-start: lxc_start.c: main: 348 Additional information can be obtained by setting the --logfile and --logpriority options.
command 'lxc-start -n 113' failed: exit code 1

root@proxmox:/home/deveth0# lxc-start -n 113 -F --logfile=/tmp/113.log
Use of uninitialized value $real in string ne at /usr/share/perl5/PVE/LXC.pm line 953.
Use of uninitialized value $real in concatenation (.) or string at /usr/share/perl5/PVE/LXC.pm line 954.
mount path modified by symlink: /var/lib/lxc/113/rootfs/mnt/foo/bar !=  at /usr/share/perl5/PVE/LXC.pm line 954.
lxc-start: conf.c: run_buffer: 342 Script exited with status 2
lxc-start: start.c: lxc_init: 436 failed to run pre-start hooks for container '113'.
lxc-start: start.c: __lxc_start: 1170 failed to initialize the container
lxc-start: lxc_start.c: main: 344 The container failed to start.
lxc-start: lxc_start.c: main: 348 Additional information can be obtained by setting the --logfile and --logpriority options.

Code:
root@proxmox:/home/deveth0# cat /tmp/113.log
      lxc-start 1459589398.104 ERROR    lxc_conf - conf.c:run_buffer:342 - Script exited with status 2
      lxc-start 1459589398.104 ERROR    lxc_start - start.c:lxc_init:436 - failed to run pre-start hooks for container '113'.
      lxc-start 1459589398.104 ERROR    lxc_start - start.c:__lxc_start:1170 - failed to initialize the container
      lxc-start 1459589398.104 ERROR    lxc_start_ui - lxc_start.c:main:344 - The container failed to start.


Code:
root@proxmox:/home/deveth0# cat /etc/pve/lxc/113.conf
...
mp0: /mnt/bar,mp=/mnt/foo/bar
I double checked if /mnt/foo or /mnt/foo/bar is a symlink, but no, it's not.

Is there anything I'm missing or any required configuration I didn't do?
Thanks for your help!
 
Please post the output of "pveversion -v" and the complete container configuration! If the issue persists after upgrading to the current versions, you can try creating the mountpoint path inside the container:
  1. remove the mountpoint from the config
  2. start or mount the container
  3. create the missing directories
  4. stop/unmount the container
  5. add the bind mount to the config again
It should work without manually creating the directories though.
 
Hi Fabian, thanks for your feedback!

I already tried to create the path manually, but this didn't help :(

Code:
root@proxmox:/home/deveth0# pveversion -v
proxmox-ve: 4.1-41 (running kernel: 4.2.8-1-pve)
pve-manager: 4.1-22 (running version: 4.1-22/aca130cf)
pve-kernel-4.2.8-1-pve: 4.2.8-41
lvm2: 2.02.116-pve2
corosync-pve: 2.3.5-2
libqb0: 1.0-1
pve-cluster: 4.0-36
qemu-server: 4.0-64
pve-firmware: 1.1-7
libpve-common-perl: 4.0-54
libpve-access-control: 4.0-13
libpve-storage-perl: 4.0-45
pve-libspice-server1: 0.12.5-2
vncterm: 1.2-1
pve-qemu-kvm: 2.5-9
pve-container: 1.0-52
pve-firewall: 2.0-22
pve-ha-manager: 1.0-25
ksm-control-daemon: 1.2-1
glusterfs-client: 3.5.2-2+deb8u1
lxc-pve: 1.1.5-7
lxcfs: 2.0.0-pve2
cgmanager: 0.39-pve1
criu: 1.6.0-1

Code:
root@proxmox:/home/deveth0# cat /etc/pve/lxc/113.conf
arch: i386
cpulimit: 2
cpuunits: 1024
hostname: 113.mydomain
memory: 4096
nameserver: 192.168.3.254
net0: bridge=vmbr107,hwaddr=32:39:35:32:36:32,name=eth0,type=veth
net1: bridge=vmbr106,hwaddr=62:62:65:34:66:37,name=eth1,type=veth
ostype: debian
rootfs: local:113/vm-113-disk-1.raw,size=100G
searchdomain: mydomain
swap: 5120
mp0: /mnt/bar,mp=/mnt/foo/bar
 
Ok, this seems to be my fault. I used the setting for mp in the wrong way:
mp0: /mnt/foo/bar,mp=/mnt/bar
would be correct
Sorry about this :(