mutiple ip address displayed for a node

Bug #1238284 reported by Narinder Gupta
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
High
Raphaël Badin

Bug Description

during MAAS enlistment and commisioning process I deleted the declared node. Then I start the enlistment again. and saw there are two ip address of a node with single ethernet interface and MAC address. AS i am using the maas on VM and trying to add anode in VM itself.

maas:
  Installed: 1.4+bzr1656+dfsg-0ubuntu2~ctools0

juju:
  Installed: 1.14.1-0ubuntu1~ctools0

u@maas-precise:~$ uname -a
Linux maas-precise 3.2.0-54-generic #82-Ubuntu SMP Tue Sep 10 20:08:42 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
u@maas-precise:~$

just try to delete and enlist a node with existing commisiong node. Attahcing the screen shot. Due to this bug sometime I can not run juju bootstrap as well as juju status.

Tags: trivial

Related branches

Revision history for this message
Narinder Gupta (narindergupta) wrote :
Revision history for this message
Narinder Gupta (narindergupta) wrote :

adding the syslog in case needed

Changed in maas:
status: New → Triaged
importance: Undecided → High
Revision history for this message
Julian Edwards (julian-edwards) wrote :

Narinder - if you leave it a while, does the old IP address disappear from the UI when reloading the page?

Raphaël - I reckon we have some weirdness in Node.ip_addresses().
I have a few scenarios:
 - it's still presenting a cached value after the value was already deleted
 - the lease parser has not run yet so has not deleted the entry in DHCPLease.
 - the parser has run but the lease is not expired yet.
 - the parser has run and didn't see any relevant node matching the MAC (duh!)

It can be fixed by deleting the lease when the node is deleted. The parser ignores leases for unknown MACs so it would never get deleted by the parser.

tags: added: trivial
Revision history for this message
Raphaël Badin (rvb) wrote :

> - it's still presenting a cached value after the value was already deleted
The cache stuff in only there to fetch all the details in bulk when the info is queried for many nodes at once over the API. The cache shouldn't live longer that the lifetime of the API request. Plus this does not affect the UI. So no :).

> - the lease parser has not run yet so has not deleted the entry in DHCPLease.
> - the parser has run but the lease is not expired yet.
> - the parser has run and didn't see any relevant node matching the MAC (duh!)
That would be my guess too.

> It can be fixed by deleting the lease when the node is deleted. The parser ignores leases for unknown MACs so it would never get > deleted by the parser.

Another way is to change ip_addresses so that it will only return the most recent ip when multiple leases are attached to the same mac. This avoids having to rely on the clean-up to happen to return accurate information.

Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :

As far as development is concerned, I think the problem here is that we have no way to delete a lease. Deleting a machine from the database is probably a good time to do that.

Revision history for this message
Julian Edwards (julian-edwards) wrote :

Yes, jtv nails it. Returning only the most recent IP is bad because we are knowingly leaving cruft behind in the database. I want a zero-tolerance approach to cruft.

Revision history for this message
Raphaël Badin (rvb) wrote :

Okay, deleting the lease when the mac address is deleted seems like the right approach to me too…

Raphaël Badin (rvb)
Changed in maas:
assignee: nobody → Raphaël Badin (rvb)
status: Triaged → Fix Committed
Changed in maas:
milestone: none → 14.04
Changed in maas:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.