HOWTO: Allocate IPs from NetBox Before Provisioning¶
Purpose: Exercise the NetBox-backed authority path by reserving VM addresses before provisioning and carrying each allocation through validation and release.
Difficulty: Intermediate
Track: IPAM-Driven Infrastructure
Overview¶
In this NetBox-backed reference path, IP allocation is an explicit authority step before VM provisioning. The resulting address becomes a structured module input and remains traceable through post-provisioning validation and decommissioning. This HOWTO covers prefix selection, allocation, consumption, validation, and release.
1. Finding the Right Prefix¶
- Querying prefixes by VLAN and site in NetBox.
- Identifying available capacity.
- Prefix selection policy (avoid management and reserved ranges).
2. Allocating an IP¶
- Creating an IP address object via the NetBox API.
- Required fields: address, status, assigned object.
- Tagging with environment and role metadata.
3. Passing the IP to the Provisioning Module¶
- Exporting the allocation as a module input.
- Using the IPAM module output directly in the VM module input map.
- Handling allocation failures gracefully.
4. Post-Provisioning Validation¶
- Confirming the IP appears in NetBox as
active. - Verifying the interface binding is correct.
- Updating the DNS record if required.
5. Decommission and Release¶
- Marking the IP as
deprecatedon VM shutdown. - Releasing the allocation after decommission.
- Avoiding ghost allocations in long-running environments.
References¶
- ADR-0002 – Source of Truth: NetBox-Driven Inventory
- ADR-0104 – Static IP Allocation with Terraform IPAM
- HOWTO: Deploy NetBox Authoritative
- HOWTO: Run the Authoritative On-Prem Foundation
License: MIT-0 for code, CC-BY-4.0 for documentation unless otherwise stated.