PDA

View Full Version : Openvz error "Container already locked"



Fli
07-10-2016, 09:18 AM
When one try to restart, start, stop container vzctl says that "Container already locked".

Assuming issue is with VPS id 3010:

Try to remove checkpoint using vzctl:
vzctl chkpnt 3010 --kill

It said: Locked by: pid 805502, cmdline /usr/sbin/vzctl stop 3010

Process 805502 is vzctl:

# lsof -p 805502
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
vzctl 805502 root cwd DIR 253,0 4096 6554705 /usr/local/lxlabs/hypervm/httpdocs
vzctl 805502 root rtd DIR 253,0 4096 2 /
vzctl 805502 root txt REG 253,0 83512 5768765 /usr/sbin/vzctl
vzctl 805502 root mem REG 253,0 145896 45613158 /lib64/libpthread-2.12.so
vzctl 805502 root mem REG 253,0 99320 45613205 /lib64/libcgroup.so.1.0.40
vzctl 805502 root mem REG 253,0 156936 45613058 /lib64/ld-2.12.so
vzctl 805502 root mem REG 253,0 22536 45613070 /lib64/libdl-2.12.so
vzctl 805502 root mem REG 253,0 1926760 45613062 /lib64/libc-2.12.so
vzctl 805502 root mem REG 253,0 599392 45613124 /lib64/libm-2.12.so
vzctl 805502 root mem REG 253,0 91096 45613102 /lib64/libz.so.1.2.3
vzctl 805502 root mem REG 253,0 17520 45613170 /lib64/libutil-2.12.so
vzctl 805502 root mem REG 253,0 1384424 5768319 /usr/lib64/libxml2.so.2.7.6
vzctl 805502 root mem REG 253,0 304272 5771464 /usr/lib64/libvzctl-4.9.4.so
vzctl 805502 root 0r FIFO 0,8 0t0 3783296756 pipe
vzctl 805502 root 1w FIFO 0,8 0t0 3783296757 pipe
vzctl 805502 root 2w REG 253,2 0 25 /tmp/system_errrvPAfsa
vzctl 805502 root 3u unix 0xffff880614942140 0t0 3780315432 socket
vzctl 805502 root 4w REG 253,0 20413 54526992 /var/log/vzctl.log
vzctl 805502 root 5u CHR 126,0 0t0 13552 /dev/vzctl
vzctl 805502 root 6u IPv4 3783296730 0t0 TCP localhost:8886->localhost:40350 (ESTABLISHED)

Another way to fix is to remove lock (.lck) file of the container:
rm /vz/lock/3010.lck

Then i restart VPS:

# vzctl restart 3010
Restarting container
Stopping container ...
Child 931797 exited with status 1
Killing container ...
Container was stopped
Can't umount /vz/root/3010: Device or resource busy

Maybe restarted again and all seems to be working