2.0: IPAM Overhaul Data Migration Plan
Ken Celenza edited this page 2023-05-03 11:42:13 -04:00

⚠️ NOTE: This plan is a work-in-progress. Meant for a collaborative place to enumerate the cases resulting from the #1032, #3244, #2915, #1673, and #2403 changes in Nautobot 2.0.


Priorities

  • No data loss
  • How hard is it to get your data to be migrated (especially in the edge-case scenario) with the existing relationships
  • How hard is it to correct migrations after the fact (moving Prefixes between namespaces for example)

Namespaces

  • A Global namespace is created by default.
  • A “Cleanup Namespace N+1” namespace is created and used any time the Global or Cleanup Namespace N would cause a collission

VRF

Data model differences:

V1 V2
Tenant Tenant
Namespace (M2M)

Need to determine which VRFs become Namespaces

  • Case 1: Multiple VRFs exist without any overlapping Prefixes or IP Addresses
    • These VRFs can continue to exists as VRFs under a single Namespace
  • Case 2: Multiple VRFs exists with overlapping Prefixes or IP Addresses
    • These VRFs can continue to exist but will need to be associated with unique Namespaces
    • Iterate through the VRFs, assign to the global namespace unless it would cause uniqueness collisions

Need to move VRF from IP Address to Interface

  • Case 1: Interface has no IP Address assigned to it or IP address has no VRF
    • Nothing to be done here
  • Case 2: Interface has one or more IP address assigned to it that result in a single assigned VRF (none is excluded) to it
    • Interface should adopt the VRF of the IP Address assigned to it, Device should adopt an assocation to the VRF (VRFDeviceAssignment) as well.
  • Case 3: Interface has many IP addresses assigned to it with different VRFs
    • ???

Prefixes

Data model differences:

V1 V2
Tenant
VRF
Network Address
Tenant
Namespace
Parent
Network Address

Need to set parent on Prefix

  • Case 1: One or more exists whose address, vrf, and tenant all match with a larger length
    • Case 1a: A single smallest of the larger exists
      • Assign parent to that prefix
    • Case 1b: More than one smallest of the larger prefixes exist
      • Case 1b1: Refining search with Location results in a single parent prefix
        • Assign it to that prefix
      • Case 1b2: Refining search with Location return 0 or 2+
        • Assign to the first one from Case 1b and log the change
  • Case 2: Not all fields match
    • Search by address, vrf, and larger length and use Case 1
  • Case 3: A duplicate prefix exists in any result above
    • Move or use parent prefix in Cleanup Namespace (prefix length the same as IP address if none found) with same Tenant and VRF associations

De-duplicate Prefixes

For now, do not attempt merging in migration. Prioritize no data loss and investigate UI or ORM tools for merging.

IP Address

Data model differences:

V1 V2
Tenant
VRF
Network Address
Tenant
Parent
Network Address

Need to set Parent on IP Address

  • Case 1: A single prefix exists whose address, vrf, and tenant all match
    • Use the found prefix to set as parent on IP Address
  • Case 2: Multiple exists whose address, vrf, and tenant all match
    • Case 2a: IPAddress has an assigned object which will lead toward a location, use that location to further refine Prefix search,
    • Case 2b: 2a returns 0 or 2+ Prefixes
      • Assign to the first one from Case 2 and log the change
  • Case 3: A single prefix is found but already has the same IP address in it
    • Create or use prefix in Cleanup Namespace (prefix length the same as IP address if none found) with same Tenant and VRF associations
  • Case 4: No all fields match
    • Search by address and vrf then use case 1 & 2
  • Case 5: Address has no prefix that match VRF
    • Create Prefix in Global namespace if no collision, else use Cleanup Namespace (prefix length the same as IP address if none found) with same Tenant and VRF associations

Need to merge 2+ IP Addresses

  • They were created uniquely because of VRF but VRF was not used for uniqueness constraints but as a configuration item.
  • IP Addresses were duplicated to assign to multiple interfaces

For now, do not attempt merging in migration. Prioritize no data loss and investigate UI or ORM tools for merging

Need to assign IP Address to Interface when Interface has VRF assigned

  • Selectable IP addresses should be all IP addresses within Prefixes with VRFs matching that of the Interface AND any Prefixes that do not have any VRFs assigned (scoped to Prefixes within the same Namespace, since the Interfaces is “namespaced” with VRF assignment).

VLAN & VLAN Group

To be discussed on 2023-05-09

Status Checks (Pre 2.0):

  • Scan Prefixes and IP Addresses for VRF associations with mismatched Tenants
    • Not supported in V2
    • Fails migration