xenserver / xe-guest-utilities

XenServer guest utilities for unix-like operating systems
BSD 2-Clause "Simplified" License
59 stars 58 forks source link

Removal of IP address causing several problems #144

Open ydirson opened 1 year ago

ydirson commented 1 year ago

Here is what we see when removing the IP recorded as "first one" by the tool:

initially:

6: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 3e:ed:36:5a:63:63 brd ff:ff:ff:ff:ff:ff
    inet 172.16.210.109/23 brd 172.16.211.255 scope global dynamic noprefixroute eth0
       valid_lft 77100sec preferred_lft 77100sec
    inet 1.2.3.5/32 scope global eth0
       valid_lft forever preferred_lft forever
...
root@debian11-test:~# xenstore ls attr/vif
 0 = ""
  ipv4 = ""
   0 = "172.16.210.109"
   1 = "1.2.3.5"

after removal of the IP with ip addr add 172.16.210.109 dev eth0, after a delay due to periodic polling we get:

vif = ""
 0 = ""
  ipv4 = ""
   0 = "1.2.3.5"
   1 = "1.2.3.5"

and after some more time finally:

vif = ""
 0 = ""
  ipv4 = ""
   0 = "1.2.3.5"

Besides the obvious problem of seeing the same IP address twice, the problem is there is no stability in the xenstore path for a given IP address: a client using xs_watch() here on vif/0/ipv4/1 would get a spurious wake when it disappears, and would have to spend CPU cycles with more code just to find out if the iface has been brought down, and to locate the new path if not.