Skip to content

Virtual Router leaks floating-IP leases on onevrouter delete #7699

@xorel

Description

@xorel

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

  1. Create two Virtual Networks, each with an IPv4 address range (netA, netB).
  2. Create a Virtual Router and instantiate it from a VROUTER=YES VM template
    (one VR VM, any OS image).
  3. Wait for the Virtual Router VM to reach RUNNING.
  4. onevrouter nic-attach <vr> --network netA --float --ip <ipA>
  5. After the VR VM leaves the HOTPLUG_NIC state, run
    onevrouter nic-attach <vr> --network netB --float --ip <ipB>
  6. Check both networks — onevnet show reports USED LEASES : 1 on each.
  7. 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.

Metadata

Metadata

Assignees

Type

No fields configured for Bug.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions