OpenVZ Forum


Home » General » Support » openvz in ubuntu hardy -- network options ignored
openvz in ubuntu hardy -- network options ignored [message #29286] Thu, 10 April 2008 07:44 Go to next message
tanimoto is currently offline  tanimoto
Messages: 6
Registered: April 2008
Junior Member
Hello,

I compiled an openvz kernel from this git repository:
http://git.openvz.org/?p=ubuntu-hardy-openvz;a=summary

Then I tried using multiple templates (different versions of ubuntu and debian), but I always have the same problem. I suspect it's related to config files not being overwritten.

Here's an example:
$ sudo vzctl create 101 --ostemplate ubuntu-8.04-amd64-minimal
Creating VE private area (ubuntu-8.04-amd64-minimal)
Performing postcreate actions
VE private area was created

$ sudo vzctl set 101 --hostname hardy --save
Saved parameters for VE 101

$ sudo vzctl set 101 --ipadd 192.168.2.1 --save
Saved parameters for VE 101

$ sudo vzctl set 101 --nameserver 192.168.1.1 --save
Saved parameters for VE 101

$ sudo vzctl start 101
Starting VE ...
VE is mounted
Adding IP address(es): 192.168.2.1
cp: skipping file `/etc/network/interfaces', as it was replaced while being copied
Setting CPU units: 1000
Configure meminfo: 65536
Set hostname: hardy
 ERROR: Can't copy file /etc/hosts
/bin/cp: skipping file `/etc/hosts', as it was replaced while being copied
VE start in progress...

Notice the warnings of files being skipped with 'cp'.

Here's some info output:
$ sudo vzctl enter 101
entered into VE 101

root@localhost:/# ifconfig

root@localhost:/# ifconfig -a
lo        Link encap:Local Loopback
          LOOPBACK  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

venet0    Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-  00-00
          BROADCAST POINTOPOINT NOARP  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

root@localhost:/# ip r l

root@localhost:/# ip rule list
0:  from all lookup local
32766:  from all lookup main
32767:  from all lookup default

root@localhost:/# cat /etc/network/interfaces
auto venet0:0
iface venet0:0 inet static
  address 192.168.2.1
  netmask 255.255.255.255
  broadcast 0.0.0.0

root@localhost:/# invoke-rc.d networking restart
 * Reconfiguring network interfaces...
SIOCSIFFLAGS: Cannot assign requested address
Failed to bring up venet0:0.


Now the weird thing for me is that if I append this to /etc/network/interfaces and restart the network script, everything works fine. Until the VE is restarted, that is.
iface lo inet loopback
auto venet0 lo
iface venet0 inet static
  address 127.0.0.1
  netmask 255.255.255.255
  broadcast 0.0.0.0
  up route add -net 191.255.255.1 netmask 255.255.255.255 dev venet0
  up route add default gw 191.255.255.1


Any idea of what I could be missing? I saw a past thread suggesting changing the 'cp' flags from '-fp' to just '-f' in the vz scripts, but that unfortunately didn't do the trick.

Thank you.

PS: I also tried assigning different IP addresses to the VE, to no avail.

[Updated on: Thu, 10 April 2008 07:45]

Report message to a moderator

Re: openvz in ubuntu hardy -- network options ignored [message #29300 is a reply to message #29286] Thu, 10 April 2008 10:20 Go to previous messageGo to next message
curx
Messages: 739
Registered: February 2006
Location: Nürnberg, Germany
Senior Member

which version of vzctl is used ?

Re: openvz in ubuntu hardy -- network options ignored [message #29331 is a reply to message #29300] Thu, 10 April 2008 17:20 Go to previous messageGo to next message
tanimoto is currently offline  tanimoto
Messages: 6
Registered: April 2008
Junior Member
Thorsten, I have version 3.0.22.

$ vzctl --version
vzctl version 3.0.22


Thanks.
Re: openvz in ubuntu hardy -- network options ignored [message #29347 is a reply to message #29331] Fri, 11 April 2008 05:40 Go to previous messageGo to next message
gumicsoves is currently offline  gumicsoves
Messages: 4
Registered: April 2008
Location: Ottawa, Ontario, Canada
Junior Member
Hi,

This seems to be a strange "/bin/cp" problem. This is what I did to fix it:

$ cp /etc/vz/dists/scripts/debian-add_ip.sh /etc/vz/dists/scripts/ubuntu-add_ip.sh
$ vim /etc/vz/dists/scripts/ubuntu-add_ip.sh

And replace the cp line:
# cp -f ${CFGFILE} ${CFGFILE}.bak

with this:
[ -e ${CFGFILE}.bak ] && rm ${CFGFILE}.bak
cat ${CFGFILE} >${CFGFILE}.bak

I modified the /etc/vz/dists/ubuntu.conf file too:
$ vim /etc/vz/dists/ubuntu.conf
ADD_IP=ubuntu-add_ip.sh

The problem still exists with the set hostname which is being set by a function in the function.sh, but I can live without that for now. Anyway this is just a temporary workaround and I'm going to report this bug in launchpad.

Anybody has an idea what is this bug with the cp command?
Searching the "as it was replaced while being copied" there are thousands of hits pointing to some sort of bug in cp with inodes.

Cheers,
Karoly
Re: openvz in ubuntu hardy -- network options ignored [message #29368 is a reply to message #29347] Fri, 11 April 2008 12:32 Go to previous messageGo to next message
gumicsoves is currently offline  gumicsoves
Messages: 4
Registered: April 2008
Location: Ottawa, Ontario, Canada
Junior Member
Hello again,

Could the patched kernel be the source of this bug? Or something with the hardy-kernel?

I'd be willing to take this further if someone was willing to point out where to start.

Thanks,
Karoly
Re: openvz in ubuntu hardy -- network options ignored [message #29371 is a reply to message #29368] Fri, 11 April 2008 13:12 Go to previous messageGo to next message
maratrus is currently offline  maratrus
Messages: 1495
Registered: August 2007
Location: Moscow
Senior Member
Hi,

1. Could you please try another kernel?
2. Does "cp" utility work in the common situation? Are you able to use it?
Re: openvz in ubuntu hardy -- network options ignored [message #29388 is a reply to message #29371] Fri, 11 April 2008 16:46 Go to previous messageGo to next message
tanimoto is currently offline  tanimoto
Messages: 6
Registered: April 2008
Junior Member
In the VE, cp fails with the same error message whenever I try to overwrite any file. Same thing with mv.

But in the host, cp works normally. At first we suspected a bug in the coreutils package provided by Ubuntu, but I tested a different version of cp and the problem persists.

Perhaps we could try a Debian kernel with openvz.

[Updated on: Fri, 11 April 2008 16:50]

Report message to a moderator

Re: openvz in ubuntu hardy -- network options ignored [message #29390 is a reply to message #29388] Fri, 11 April 2008 17:24 Go to previous messageGo to next message
tanimoto is currently offline  tanimoto
Messages: 6
Registered: April 2008
Junior Member
Hi,

It appears to be the kernel, after all. I just installed a Debian kernel here and that problem disappears. I followed this wiki entry:
http://wiki.openvz.org/Installation_on_Debian

The version I have is:
Linux eclipse 2.6.18-fza-028stab053.5-amd64 #1 SMP Sat Mar 1 19:50:43 UTC 2008 x86_64 GNU/Linux


Now, how do we narrow down the problem in the Ubuntu kernel? Karoly suggested that it could be the way Openvz handles inodes. Is there a specific place I should look for?

Thanks.
Re: openvz in ubuntu hardy -- network options ignored [message #29488 is a reply to message #29286] Tue, 15 April 2008 09:39 Go to previous messageGo to next message
koct9i is currently offline  koct9i
Messages: 51
Registered: February 2008
Member
this should fix it.
put attach into debian/binary-custom.d/openvz/patchset/ and rebuild kernel
Re: openvz in ubuntu hardy -- network options ignored [message #29525 is a reply to message #29488] Tue, 15 April 2008 18:01 Go to previous messageGo to next message
tanimoto is currently offline  tanimoto
Messages: 6
Registered: April 2008
Junior Member
koct9i,

Yes, that fixes the problem. I recompiled the kernel with that patch and now the network works (as well as cp and mv).

Is this patch uploaded to the git repositories?

Thank you so much.
Re: openvz in ubuntu hardy -- network options ignored [message #29526 is a reply to message #29488] Tue, 15 April 2008 18:02 Go to previous messageGo to next message
gumicsoves is currently offline  gumicsoves
Messages: 4
Registered: April 2008
Location: Ottawa, Ontario, Canada
Junior Member
Thank you for the patch.

I compiled a new kernel with the patch and the problem does not show up. cp and mv works as expected.

Thanks again,
Karoly
Re: openvz in ubuntu hardy -- network options ignored [message #31437 is a reply to message #29526] Mon, 30 June 2008 14:20 Go to previous messageGo to next message
JimL is currently offline  JimL
Messages: 116
Registered: February 2007
Senior Member
I'm having a similar problem with OpenVZ on Hardy. Recompiling the kernel is not a viable option. Is it possible for someone to release a kernel that will work? Perhaps put it in backports? Another fellow suggested that this is a large black eye for OpenVZ and I concur. Ubuntu is a large distro and when people try to use OpenVZ and fail, they're not going to come back to it and they'll badmouth it.

That's not a good thing, in my opinion. I believe someone needs to either pull openvz from Ubuntu or fix it to avoid some awful publicity.

Jim.
Re: openvz in ubuntu hardy -- network options ignored [message #31438 is a reply to message #31437] Mon, 30 June 2008 14:37 Go to previous messageGo to next message
tanimoto is currently offline  tanimoto
Messages: 6
Registered: April 2008
Junior Member
Hi Jim,

Have you tried the kernel that's in 'proposed'? That's what I have been using and have had no problems.

I'd suggest you follow this bug report:
https://bugs.launchpad.net/bugs/210672

Paulo
Re: openvz in ubuntu hardy -- network options ignored [message #31439 is a reply to message #31437] Mon, 30 June 2008 14:37 Go to previous message
gumicsoves is currently offline  gumicsoves
Messages: 4
Registered: April 2008
Location: Ottawa, Ontario, Canada
Junior Member
Hi Jim,

Upgrade to the latest version of Ubuntu Kernel. At this moment it is: linux-image-2.6.24-19-openvz and that is going to fix this problem as well as many others. This is a very solid kernel, I and others have been using it on several production machines without any problem.

Cheers,
Karoly
Previous Topic: OpenVZ & XEN 3.2 in Debian etch
Next Topic: OpenVZ with ArchLinux - help with packaging it =]
Goto Forum:
  


Current Time: Wed Nov 13 18:29:21 GMT 2024

Total time taken to generate the page: 0.02939 seconds