PDA

View Full Version : OpenVZ: VPS networking do not works - FIX (update vzctl)



Fli
09-29-2015, 10:56 PM
Hello this topic is a guide on how i managed to fix networking in some OpenVZ templates (like new Ubuntu 14.04, CentOS 7)

Temporary workaround to turn on networking for curent VPS session might be command:
# ifup ifcfg-venet0:0

But i wanted permanent solution surviving VPS reboots

There (http://forum.openvz.org/index.php?t=msg&th=12955&goto=52140&S=735e76e3047da3fb98d57f1568d76e47#msg_52140) i read that CentOS 7 OpenVZ template networking do not works on vzctl version 4.8 (# vzctl --version). So i updated vzctl and ploop (# yum update vzctl) and networking started working after VPS boot. New vzctl version was v. 4.9 in my case. Networking for newly created new OSes like Debian 7 was working, but instead networking for old new VPSs with old OSes stopped working. So one or another. Im not yet sure how to fix. The key might be following lines in /etc/vz/vz.conf
#NEIGHBOUR_DEVS=all
#SKIP_SYSCTL_SETUP=yes
(little explanation what are these about (https://openvz.org/Man/vz.conf.5))

Notwithstanding, following is the vzctl update process and what issues i faced i faced some issues after update, read on:

Updating vzctl

during yum update vzctl:

warning: /etc/vz/vz.conf created as /etc/vz/vz.conf.rpmnew

so i assume yum moved my old vz.conf and named it vz.conf.rpmnew and used new one instead.

New versus old vz.conf:

# diff vz.conf /etc/vz/vz.conf.rpmnew
27,28c27,29
< # Leave commented out to use all interfaces.
< #NEIGHBOUR_DEVS=detect
---
> # If you want to explicitly specify interfaces, use "list:eth0 eth1" form.
> # Leave commented out or set to "all" to use all interfaces.
> #NEIGHBOUR_DEVS="detect"
60c61
< IPTABLES_MODULES="ipt_REJECT ipt_tos ipt_limit ipt_multiport iptable_filter iptable_mangle ipt_TCPMSS ipt_tcpmss ipt_ttl ipt_length ip6_tables ip6table_filter ip6table_mangle ip6t_REJECT iptable_nat ip_nat_ftp"
---
> IPTABLES_MODULES="ipt_REJECT ipt_tos ipt_limit ipt_multiport iptable_filter iptable_mangle ipt_TCPMSS ipt_tcpmss ipt_ttl ipt_length ip6_tables ip6table_filter ip6table_mangle ip6t_REJECT"
64,65d64
< NEIGHBOUR_DEVS=allSKIP_SYSCTL_SETUP=yes
< SKIP_SYSCTL_SETUP=yes

so from diff it appears that:
there are new netfilter modules: iptable_nat ip_nat_ftp

I tried to stop one container:

# vzctl --verbose stop 2290
Stopping container ...
Container was stopped
WARNING: unknown value for NEIGHBOUR_DEVS: allSKIP_SYSCTL_SETUP=yes.
Please fix it in /etc/vz/vz.conf; see man vz.conf for allowed values.

It shows warning..

yum wrongly merged two variables, so i editted vz.conf, line "NEIGHBOUR_DEVS=allSKIP_SYSCTL_SETUP=yes" to become splitted.
that is first fix i had to do after vzctl update

Second issue after update: i realised hat when i apply different OStemplate to the container/VPS, VPS fails to start.


Starting container...
Error in ploop_open_dd (di.c:288): Can't resolve /vz/private/2290/root.hdd/DiskDescriptor.xml: No such file or directory
Failed to read /vz/private/2290/root.hdd/DiskDescriptor.xml
Error in ploop_open_dd (di.c:288): Can't resolve /vz/private/2290/root.hdd/DiskDescriptor.xml: No such file or directory
Failed to read /vz/private/2290/root.hdd/DiskDescriptor.xml
Error in ploop_open_dd (di.c:288): Can't resolve /vz/private/2290/root.hdd/DiskDescriptor.xml: No such file or directory
Failed to read /vz/private/2290/root.hdd/DiskDescriptor.xml

# tail /var/log/vzctl.log

2015-09-30T01:20:43+0000 : Error in ploop_open_dd (di.c:288): Can't resolve /vz/private/2290/root.hdd/DiskDescriptor.xml: No such file or directory
2015-09-30T01:20:43+0000 vzctl : CT 2290 : Failed to read /vz/private/2290/root.hdd/DiskDescriptor.xml
2015-09-30T01:20:43+0000 vzctl : CT 2290 : Starting container...
2015-09-30T01:20:43+0000 : Error in ploop_open_dd (di.c:288): Can't resolve /vz/private/2290/root.hdd/DiskDescriptor.xml: No such file or directory


2015-09-30T01:06:52+0000 vzctl : CT 2290 : Starting container...
2015-09-30T01:06:52+0000 vzctl : CT 2290 : Error: required UB parameter kmemsize not set
2015-09-30T01:06:52+0000 vzctl : CT 2290 : Error: required UB parameter lockedpages not set
2015-09-30T01:06:52+0000 vzctl : CT 2290 : Error: required UB parameter numproc not set
2015-09-30T01:06:52+0000 vzctl : CT 2290 : Error: required UB parameter numtcpsock not set
2015-09-30T01:06:52+0000 vzctl : CT 2290 : Error: required UB parameter numflock not set
2015-09-30T01:06:52+0000 vzctl : CT 2290 : Error: required UB parameter numpty not set
2015-09-30T01:06:52+0000 vzctl : CT 2290 : Error: required UB parameter numsiginfo not set
2015-09-30T01:06:52+0000 vzctl : CT 2290 : Error: required UB parameter numothersock not set
2015-09-30T01:06:52+0000 vzctl : CT 2290 : Error: required UB parameter numfile not set
2015-09-30T01:06:52+0000 vzctl : CT 2290 : Error: required UB parameter dcachesize not set
2015-09-30T01:06:52+0000 vzctl : CT 2290 : Error: required UB parameter numiptent not set
2015-09-30T01:06:52+0000 vzctl : CT 2290 : Error: failed to apply some parameters, not saving configuration file!

What helped to fix above DiskDescriptor.xml issue is to change default VPS layout from ploop to simfs

Edit vz.conf
change line:
VE_LAYOUT=ploop
to become:
VE_LAYOUT=simfs

AND same in VPS config (/etc/vz/conf/*.conf) !!

ISSUE #3 - new VPSs (not already existing VPSs) with old OSes networking do not works!
The New OS like Debian 7, CentOS 7 networking appears to work after vzctl update, but instead old OS networking stopped working, here im talking about newly created VPSs, already created are not affected

by non working networking i mean i cant ping to the internet out of vps and ssh not reachable from internet.

When i commented out these following lines in /etc/vz/vz.conf
#NEIGHBOUR_DEVS=all
#SKIP_SYSCTL_SETUP=yes
and re-created VPS, networking started working again for old OSes like CentOS 6.x BUT newly created new OS VPSs like Debian 7 networking stopped working. (same as it was before vzctl update)

So one or another. Always one do not work. Im yet not sure how to make working both at same time without admin intervention. Aim is automated VPS setup from billing system.