PDA

View Full Version : How to debug/discover why OpenVZ VPS not starting



Fli
03-19-2017, 11:00 AM
How to discover why an OpenVZ VPS did not started.

vzlist -a

3570 - stopped - -

Most common cause is not enough RAM i think.

But here is how i think one can discover details. (replace 3570 by your openvz vps ID)

start in verbose mode:
vzctl --verbose start 3570


Container start failed (try to check kernel messages, e.g. "dmesg | tail")
Killing container ...
Container was stopped
Container is unmounted

check vzctl log:
tail /var/log/vzctl.log


2017-03-19T10:28:18+0000 vzctl : CT 3570 : Creating container private area (centos-6-x86-*)
2017-03-19T10:28:18+0000 vzctl : CT 3570 : Container is not running

check kernel logs:
dmesg|grep 3570


[38241501.087150] CT: 3570: started
[38241502.124425] 691616 (bash) invoked oom-killer in ub 3570 generation 15 gfp 0x200d2
[38241502.124428] UB-3570-Mem-Info:
[38241502.124773] Out of memory in UB 3570: OOM killed process 691616 (bash) score 0 vm:964kB, rss:4kB, swap:0kB
[38241502.124943] oom-killer in ub 3570 generation 15 ends: task died
[38241502.127739] 691620 (vzctl) invoked oom-killer in ub 3570 generation 16 gfp 0x200d2
[38241502.127744] UB-3570-Mem-Info:
[38241502.128163] Out of memory in UB 3570: OOM killed process 691620 (vzctl) score 0 vm:25468kB, rss:240kB, swap:0kB
[38241502.128487] oom-killer in ub 3570 generation 16 ends: task died
[38241502.366428] CT: 3570: stopped

(apparently not enough RAM: 25468kB + ?)

check bean counters:
vzubc 3570


----------------------------------------------------------------
CT 3570 | HELD Bar% Lim%| MAXH Bar% Lim%| BAR | LIM | FAIL
-------------+---------------+---------------+-----+-----+------
kmemsize|3.08K - - |27.4M 1% 1%| 2G| 2G| -
lockedpages| - - - |1.99M 10% 10%|19.5M|19.5M| -
privvmpages| - - - | 865M 0.1% 0.1%| 976G| 976G| -
shmpages| - - - |8.28M 2% 2%| 500M| 500M| -
numproc| - - - | 258 5% 5%|4.88K|4.88K| -
physpages| 112K - - | 234M - - | - | - | 17
vmguarpages| - - - | - - - | 500M| - | -
oomguarpages| - - - | 132M 26% - | 500M| - | 2
numtcpsock| - - - | 32 0.1% 0.1%|39.1K|39.1K| -
numflock| - - - | 27 0.5% 0.5%|4.88K|4.88K| -
numpty| - - - | 1 - - |2.44K|2.44K| -
numsiginfo| - - - | 66 1% 1%|4.88K|4.88K| -
tcpsndbuf| - - - | 943K 0.9% 0.4%| 100M| 256M| -
tcprcvbuf| - - - | 512K 0.5% 0.2%| 100M| 256M| -
othersockbuf| - - - |73.4K 0.1% - | 100M| 256M| -
dgramrcvbuf| - - - |22.6K - - | 100M| 256M| -
numothersock| - - - | 68 0.2% 0.2%|39.1K|39.1K| -
dcachesize| - - - |9.48M 21% 21%|43.9M|43.9M| -
numfile| - - - |1.85K 2% 2%| 117K| 117K| -
numiptent| - - - | 27 0.5% 0.5%|4.88K|4.88K| -
swappages| - - - | - - - | - | 256M| -
----------------------------------------------------------------

apparently there are fails regarding physpages and oomguarpages, when i do "man vzctl" and find these openvz attributes, i see it is a memory problem, VPS OS probably can not allocate enough memory. We need to increase physpages allocated to the VPS.

How to allocate more RAM?
Editting /etc/vz/conf/3570.conf and making sure PHYSPAGES have appropriate value. Example my PHYSPAGES line is like this:
PHYSPAGES="0:196608"
and this value seems to be causing my VPS have 512MB RAM and start without problem now. (vzctl --verbose start 3570)