[Debian] Re: Bug#495667: VEs started during the boot can't use network sometimes

Ola Lundqvist ola at inguza.com
Fri Aug 29 12:28:24 EDT 2008


Hi Frank

I think the DHCP is the problem here. I assume that the networking script
actually terminate before the IP address has been fetched.

In order to solve this we need to have some extra syncronisation between
the dhcp and the virtual host.

I would not recommend to use DHCP in combinations with virtual servers
as if the IP address change it will most likely not be handled properly.

My suggestion is that you either add a long sleep in the init script
or help me to write a syncronisation thing. I'm not fully sure how this
should be implemented in order to cover all this kind of problems. It needs
to be configurable and rather flexible.

However maybe this should be documented in the README file.

Best regards,

// Ola

On Fri, Aug 29, 2008 at 06:21:31PM +0200, Frank Bauer wrote:
> On Tue, Aug 19, 2008 at 7:20 PM, Ola Lundqvist <opal at debian.org> wrote:
> > On Tue, Aug 19, 2008 at 04:58:43PM +0200, Frank Bauer wrote:
> >>
> >> Sometimes they can't use the network, as if ip_forwarding is not active,
> >> Which is not the case, I have the following in /etc/sysctl.conf:
> >>     net.ipv4.ip_forward=1
> >
> > Can you check if this is active as well after the restart?
> 
> Yes, it is active. But I found out it has nothing to do with my problem.
> 
> >> I can "fix" this by restarting the VEs - after that the networking works ok.
> >> I believe this might be a race condition like starting OpenVZ before
> >> the ip_forwarding
> >> feature is set, because it only happens with VEs stared during the boot:
> >
> > I do not think so, as it should affect others as well, but it could
> > of course be the case.
> > If it is a race condition then it is likely to be a problem in the network
> > script. The reason is that there is a pre-condition for vzctl start.
> >
> > # required-start: $network $remote_fs $local_fs sshd
> > # required-stop:
> 
> I've been gathering tangible data during the past week (hence the delay)
> and the result seems clear:
> 
>     OpenVZ guests have problem with networking if they are started
>     before the host gets IP address via DHCP.
> 
> In most cases, the address is assigned before VEs start, so the networking
> in VEs work:
> 
> kernel: [   19.394677] skge eth0: enabling interface
> dhclient: Listening on LPF/eth0/00:14:85:39:ec:b8
> dhclient: Sending on   LPF/eth0/00:14:85:39:ec:b8
> dhclient: Sending on   Socket/fallback
> kernel: [   21.080002] skge eth0: Link is up at 100 Mbps, full duplex,
> flow control both
> kernel: [   22.153482] NET: Registered protocol family 10
> kernel: [   22.457495] ip_tables: (C) 2000-2006 Netfilter Core Team
> dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 8
> dhclient: DHCPOFFER from 192.168.3.1
> dhclient: DHCPREQUEST on eth0 to 255.255.255.255 port 67
> dhclient: DHCPACK from 192.168.3.1
> dhclient: bound to 192.168.3.75 -- renewal in 42254 seconds.
> kernel: [   23.828058] warning: `vzctl' uses 32-bit capabilities
> (legacy support in use)
> kernel: [   23.851517] CT: 100: started
> avahi-daemon[2570]: Found user 'avahi' (UID 104) and group 'avahi' (GID 111).
> 
> Sometimes the DHCP client / server is a bit slower and VEs start
> before the host is
> assigned the IP address - networking in VEs does not work:
> 
> kernel: [   18.154081] skge eth0: enabling interface
> dhclient: Listening on LPF/eth0/00:14:85:39:ec:b8
> dhclient: Sending on   LPF/eth0/00:14:85:39:ec:b8
> dhclient: Sending on   Socket/fallback
> kernel: [   19.847303] skge eth0: Link is up at 100 Mbps, full duplex,
> flow control both
> kernel: [   21.395844] NET: Registered protocol family 10
> kernel: [   21.708122] ip_tables: (C) 2000-2006 Netfilter Core Team
> kernel: [   23.008013] warning: `vzctl' uses 32-bit capabilities
> (legacy support in use)
> kernel: [   23.069600] CT: 100: started
> dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 4
> dhclient: DHCPOFFER from 192.168.3.1
> dhclient: DHCPREQUEST on eth0 to 255.255.255.255 port 67
> dhclient: DHCPACK from 192.168.3.1
> dhclient: bound to 192.168.3.75 -- renewal in 32585 seconds.
> avahi-daemon[2858]: Found user 'avahi' (UID 104) and group 'avahi' (GID 111).
> 
> Kind Regards,
> Frank
> 

-- 
 --- Inguza Technology AB --- MSc in Information Technology ----
/  ola at inguza.com                    Annebergsslingan 37        \
|  opal at debian.org                   654 65 KARLSTAD            |
|  http://inguza.com/                Mobile: +46 (0)70-332 1551 |
\  gpg/f.p.: 7090 A92B 18FE 7994 0C36 4FE4 18A1 B1CF 0FE5 3DD9  /
 ---------------------------------------------------------------


More information about the Debian mailing list