Description
Deleting a Virtual Router that has two or more --float NICs leaks floating-IP
leases. onevrouter delete frees one floating lease but leaves the others
orphaned on the Virtual Network as R:<vrouter_id> — the lease persists even
though the Virtual Router no longer exists.
The orphaned lease cannot be freed with onevnet release or onevnet rmar
(the address is reported as in use); only onedb fsck clears it. Repeated
VRouter create/delete cycles therefore fill the address range with dead leases
until new VRouters fail with Cannot get IP/MAC lease from virtual network.
Version
OpenNebula 7.3.80. Git-bisected to the range 2c8fdf2..b490213; the only
address-management change in that range is deb127c59b "F one#6534: Support
for assigning IPs to several VMs" (the single-owner → multi-owner
AddressRange rewrite), which is the likely cause.
Steps to reproduce
- Create two Virtual Networks, each with an IPv4 address range (
netA, netB).
- Create a Virtual Router and instantiate it from a
VROUTER=YES VM template
(one VR VM, any OS image).
- Wait for the Virtual Router VM to reach
RUNNING.
onevrouter nic-attach <vr> --network netA --float --ip <ipA>
- After the VR VM leaves the
HOTPLUG_NIC state, run
onevrouter nic-attach <vr> --network netB --float --ip <ipB>
- Check both networks —
onevnet show reports USED LEASES : 1 on each.
onevrouter delete <vr>
Expected
Both floating-IP leases released — USED LEASES : 0 on netA and netB.
Actual
Only one lease is released. onevnet show netB still lists a lease R:<vr>
for <ipB>, although Virtual Router <vr> no longer exists. The lease is
unremovable via onevnet release / onevnet rmar.
A Virtual Router with a single --float NIC does not leak; the problem needs
two or more floating NICs.
Description
Deleting a Virtual Router that has two or more
--floatNICs leaks floating-IPleases.
onevrouter deletefrees one floating lease but leaves the othersorphaned on the Virtual Network as
R:<vrouter_id>— the lease persists eventhough the Virtual Router no longer exists.
The orphaned lease cannot be freed with
onevnet releaseoronevnet rmar(the address is reported as in use); only
onedb fsckclears it. RepeatedVRouter create/delete cycles therefore fill the address range with dead leases
until new VRouters fail with
Cannot get IP/MAC lease from virtual network.Version
OpenNebula 7.3.80. Git-bisected to the range
2c8fdf2..b490213; the onlyaddress-management change in that range is
deb127c59b"F one#6534: Supportfor assigning IPs to several VMs" (the single-owner → multi-owner
AddressRangerewrite), which is the likely cause.Steps to reproduce
netA,netB).VROUTER=YESVM template(one VR VM, any OS image).
RUNNING.onevrouter nic-attach <vr> --network netA --float --ip <ipA>HOTPLUG_NICstate, runonevrouter nic-attach <vr> --network netB --float --ip <ipB>onevnet showreportsUSED LEASES : 1on each.onevrouter delete <vr>Expected
Both floating-IP leases released —
USED LEASES : 0onnetAandnetB.Actual
Only one lease is released.
onevnet show netBstill lists a leaseR:<vr>for
<ipB>, although Virtual Router<vr>no longer exists. The lease isunremovable via
onevnet release/onevnet rmar.A Virtual Router with a single
--floatNIC does not leak; the problem needstwo or more floating NICs.