Update Provisiond scan to remove old primary IP inteface
Description
During a primary interface IP direct replacement in the requisition, it’s observed that dbonly scan and periodic scan don’t remove the old IP interface from the node. With a manual requisition synchronization or force node scan, it does indeed remove the old IP interface from the node. Adding discovered IP interfaces works regardless of the type of scans.
Steps to reproduce
Replace IP primary interface of a node in the requisition.
Synchronize requisition (dbonly).
Wait for the periodic scan to take place.
After the periodic scan, the new IP primary interface is provisioned. However, the old IP primary interface remains in the node. At this point, the old IP interface has already been removed from the device so it shouldn't be discovered by Provisiond. Only when a manual scan is performed, then it removes the old IP primary interface from the node.
Expected outcome
dbonly scan should remove the old IP interface in addition to adding the new IP interface. It should only persists the IP addresses that exists in the requisition and remove the IP interfaces from the node that’s not in the requisition.
periodic scan should remove and add interfaces based on the current entries in the SNMP ipAddrTable. It should persists the IP addresses that exists in the table and remove the IP interfaces from the node that’s not in the table.
FYI, after looking into this it’s a thing we absolutely should be doing, but is easily a couple of months of work, since it will require some major rearchitecting of how we pass metadata around in Provisiond.
During a primary interface IP direct replacement in the requisition, it’s observed that dbonly scan and periodic scan don’t remove the old IP interface from the node. With a manual requisition synchronization or force node scan, it does indeed remove the old IP interface from the node. Adding discovered IP interfaces works regardless of the type of scans.
Steps to reproduce
Replace IP primary interface of a node in the requisition.
Synchronize requisition (dbonly).
Wait for the periodic scan to take place.
After the periodic scan, the new IP primary interface is provisioned. However, the old IP primary interface remains in the node. At this point, the old IP interface has already been removed from the device so it shouldn't be discovered by Provisiond. Only when a manual scan is performed, then it removes the old IP primary interface from the node.
Expected outcome
dbonly scan should remove the old IP interface in addition to adding the new IP interface. It should only persists the IP addresses that exists in the requisition and remove the IP interfaces from the node that’s not in the requisition.
periodic scan should remove and add interfaces based on the current entries in the SNMP ipAddrTable. It should persists the IP addresses that exists in the table and remove the IP interfaces from the node that’s not in the table.