While working on Virtualizor I could come across an error where vps was not starting
I could get below error
[root@hostonline lock]# vzctl start 248
Starting container…
Warning: configuration file for distribution cpanel-Centos64 not found, using defaults from /etc/vz/dists/default
vzquota : (error) Quota on syscall for id 248: Device or resource busy
vzquota : (error) Possible reasons:
vzquota : (error) – Container’s root is already mounted
vzquota : (error) – there are opened files inside Container’s private area
vzquota : (error) – your current working directory is inside Container’s
vzquota : (error) private area
vzquota : (error) Currently used file(s):
/vz/private/248/var/spool/exim/input/T/1ZMogT-0000tf-4T-D
vzquota on failed [3]
The issue was due to some process locking the file in container which was not allowing vps to be started or rebooted
The solution to this issue is to find the process locking up the vm on node
The command is mentioned below which is lsof ( list of open file )
[root@hostonlinevar]# lsof 2> /dev/null | egrep ‘/vz/root/248|/vz/private/248’
bash 95741 root cwd DIR 8,1 4096 42344315 /vz/private/248/var
lsof 125649 root cwd DIR 8,1 4096 42344315 /vz/private/248/var
egrep 125650 root cwd DIR 8,1 4096 42344315 /vz/private/248/var
lsof 125652 root cwd DIR 8,1 4096 42344315 /vz/private/248/var
Kill the respective processes mentioned above
And again check if there is any process still active locking vps
[root@hostonine ~]# lsof 2> /dev/null | egrep ‘/vz/root/248|/vz/private/248’
Now VM is starting fine after killing the process locking the vm
[root@hostonline ~]# vzctl restart 248
Restarting container
Starting container…
Warning: configuration file for distribution cpanel not found, using defaults from /etc/vz/dists/default
Container is mounted
Adding IP address(es): 193.114.189.47 193.114.189.48
Setting CPU limit: 10
Setting CPU units: 1000
Setting CPUs: 2
Setting devices
Container start in progress…
[root@hostonine ~]#