NetBox IPAM
The IP address source of truth - the first stop in provisioning, where an address is allocated before a VM exists, so the inventory and the network never disagree.
What it is & why I use it
NetBox is the IP address management (IPAM) and inventory system for AutomationLab. It is the authoritative record of which addresses are in use, which are free, and what each one is for. When the pipeline provisions a machine, its first action is to ask NetBox for an address - allocation happens in the record before the VM is built.
I use it because "which IPs are free?" should have one trustworthy answer, queryable by automation, not a spreadsheet or a guess. An IPAM that the provisioning flow actually consults is what keeps a growing lab from quietly handing out the same address twice.
How I use it in the lab
- Allocate first. The provisioning pipeline requests an address from NetBox as its opening step, so the record reserves it before anything downstream uses it.
- Feeds the rest of the flow. The allocated address flows into the infrastructure-as-code and configuration stages, so every later step builds on the same authoritative value.
- Released on decommission. Tearing a machine down returns its address to the pool in NetBox, so freed space is actually reusable and the record keeps matching reality.
- Queried, not remembered. Automation reads NetBox through its API rather than relying on anyone's memory of what is assigned where.
Architecture
In action
Lessons learned & gotchas
- Allocate before you build, not after. Reserving the address first means two concurrent provisions can never race for the same one. Recording it after the fact leaves a window where a conflict can slip in.
- Release on teardown or the pool silently shrinks. If decommission does not return the address, the free pool leaks over time and you eventually "run out" of space that is actually idle. The reverse path matters as much as the forward one.
- Reconcile occasionally. Because out-of-band changes are always possible, it is worth periodically checking the record against what is really answering on the network, and fixing drift before it causes a conflict.
Impact
NetBox is what makes address management a solved problem instead of a recurring source of conflicts. The lesson generalizes to every source of truth: it is only worth the name if it is the single door everything passes through - the instant work routes around it, it stops being truth and becomes a confident-looking liability.
Code & further reading
Published tooling is scrubbed of prefixes, addresses, hostnames, and any secret references before it goes public.