Subject: Re: [vserver] All my vserver guests lost its IP
From: Herbert Poetzl <herbert@13thfloor.at>
Date: Wed, 13 Apr 2011 18:06:16 +0200

On Wed, Apr 13, 2011 at 02:19:27PM +0200, Marcus Mülbüsch wrote:
> Hello all,

>    "suddenly" all my vserver guests lost its IPs and were no
> longer able to connect or to be connected. When restarting
> a vserver it went down with the error message: "RTNETLINK
> answers: Cannot assign requested address"; when they came up
> again all was well.

>    An "ip address" within the host showed that the vservers
> that were restartet had an ip-address; those who weren't had
> not.

>   I rebooted the server and all is fine now. However, the log
>   showed:

> "
> Apr 13 12:52:53 dl360_1 kernel: tg3 0000:01:02.0: PME# enabled
> Apr 13 12:52:54 dl360_1 kernel: tg3 0000:01:02.0: PME# disabled
> Apr 13 12:52:54 dl360_1 kernel: tg3 0000:01:02.0: BAR 0: set to [mem 
> 0xf7ef0000-0xf7efffff 64bit] (PCI address [0xf7ef0000-0xf7efffff]
> Apr 13 12:52:57 dl360_1 kernel: tg3 0000:01:02.0: eth0: Link is up at 
> 1000 Mbps, full duplex
> Apr 13 12:52:57 dl360_1 kernel: tg3 0000:01:02.0: eth0: Flow control is 
> off for TX and off for RX
> "

>   After the reboot there is no new "PME# disabled" entry, so I
> suspect there is something wrong here?

>    Using "util-vserver-0.30.216_pre2935" on 
> "vserver-sources-2.3.0.36.32" on a gentoo system.

> What can I do to provide better info next time that happens?

check with 'ip a l' on the host, most likely you'll
see primary addresses (those without any special addon)
and so called secondaries (they are specifically marked
as such)

within a given network, there can only be a single primary
IP, all other IPs will become secondaries, and that is
where this problem usually arises from, because without
the promote_secondaries set, the nework stack will simply
remove all secondaries when the primary is removed

> What can I do to monitor such an event? 

well, you can trigger it at any time by removing the
primary IP of such a setup ...

> Any more pointers? 

we have a FAQ section devoted to this :)

possible solutions besides the simple promote_secondaries
is to keep the primary around forever and of course, to
recreate all the secondaries once the primary is gone
(probably not so simple :)

> And what is the meaning of life anyway?

http://www.sembeo.com/wp-content/uploads/2009/02/29_the_meaning_of_life_big.jpg

best,
Herbert

> Marcus

> ---
> Results if "ip address" (before restarting the host, but after 
> restarting the guests 122 and 124)
> --
> 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
>     link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
>     inet 127.0.0.1/8 brd 127.255.255.255 scope host lo
> 2: eth0: <BROADCAST,MULTICAST,PROMISC,UP,LOWER_UP> mtu 1500 qdisc mq 
> state UP qlen 1000
>     link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
>     inet 192.168.1.120/24 brd 192.168.1.255 scope global eth0
>     inet 192.168.1.122/24 brd 192.168.1.255 scope global secondary eth0
>     inet 192.168.1.124/24 brd 192.168.1.255 scope global secondary eth0
> --

> results of uptime before restart:
> --
> 13:58:42 up 23 days,  1:25,  3 users,  load average: 0.13, 0.07, 0.05
> --

> results of vserver-info
> --
> Versions:
>                    Kernel: 2.6.35-vs2.3.0.36.32-gentoo
>                    VS-API: 0x00020306
>                       VCI: 0x0000000013001ff1
>              util-vserver: 0.30.216-pre2935; Mar  8 2011, 12:47:37

> Features:
>                        CC: i686-pc-linux-gnu-gcc, i686-pc-linux-gnu-gcc 
> (Gentoo 4.3.4 p1.1, pie-10.1.5) 4.3.4
>                       CXX: i686-pc-linux-gnu-g++, i686-pc-linux-gnu-g++ 
> (Gentoo 4.3.4 p1.1, pie-10.1.5) 4.3.4
>                  CPPFLAGS: ''
>                    CFLAGS: '-march=i686 -O2 -pipe -fomit-frame-pointer 
> -std=c99 -Wall -pedantic -W -funit-at-a-time'
>                  CXXFLAGS: '-march=i686 -O2 -pipe -fomit-frame-pointer 
> -ansi -Wall -pedantic -W -fmessage-length=0 -funi 
>                t-at-a-time'
>                build/host: i686-pc-linux-gnu/i686-pc-linux-gnu
>              Use dietlibc: yes
>        Build C++ programs: yes
>        Build C99 programs: yes
>            Available APIs: v13,net,v21,v22,v23,netv2
>             ext2fs Source: e2fsprogs
>     syscall(2) invocation: alternative
>       vserver(2) syscall#: 273/glibc
>                crypto api: beecrypt
>           python bindings: yes
>    use library versioning: yes

> Paths:
>                    prefix: /usr
>         sysconf-Directory: /etc
>             cfg-Directory: /etc/vservers
>          initrd-Directory: $(sysconfdir)/init.d
>        pkgstate-Directory: /var/run/vservers
>           vserver-Rootdir: /vservers