claudyus / LXC-Web-Panel

LXC Web Panel improved for lxc 1.0+
http://claudyus.github.io/LXC-Web-Panel/
Other
221 stars 68 forks source link

Do not display configured ip address when network is disabled #66

Closed jggc closed 9 years ago

jggc commented 9 years ago

On a container I cloned, I still have the lxc.network.ipv4 line configured but I turned off the network and changed the network type to empty. However, the IP address is still displayed in the summary.

It seems much more intuitive that the overview shows only the up and running ip addresses. As of now I have the same address appearing on the original and the clone container and it can be confusing.

Moreover, lxc-ls --fancy has the behavior I explain here.

Here is the problematic config :

lxc.network.type = empty
lxc.network.flags = down
lxc.network.link = eth1
lxc.network.ipv4.gateway = 192.168.93.1
lxc.network.ipv4 = 192.168.93.40
claudyus commented 9 years ago

This appear to be a bug in lxc package, see https://bugs.launchpad.net/ubuntu/+source/lxc/+bug/1346815

Try to update lxc, but anyway it should not to be workaround in lwp IMO.

jggc commented 9 years ago

@claudyus I don't see why it is caused by this problem. I know that the cloned VM has the same IP but this behavior can be reproduced on any container, not necessarily a clone :

The setting on lxc.network.ipv4 is displayed even if the address is not currently used because the network is turned off.

lxc-ls --fancy works fine as it shows

NAME            STATE    IPV4                          IPV6  AUTOSTART  
----------------------------------------------------------------------
test2           RUNNING  -                             -     NO 

But lwp is wrong as it displays the unused ip. I understand that lwp displays the ip it finds in the configuration file but for that case it has to be smarter and find the really used adresses.