Plan changes on a branch
Use a branch to draft IP prefix and address changes, review exactly what will change, and merge once you're confident — the same version-control workflow Infrahub applies to the rest of your infrastructure data.
The workflow
Create a branch, then create, update, or delete IP namespaces, prefixes, and addresses on it through the web interface, GraphQL, or the Python SDK — the same way you would on the default branch. See Create a branch if you haven't created one before.
Once your changes are ready, open a Proposed Change to review them. The Data tab shows exactly which prefixes, addresses, and namespaces were added, modified, or deleted, and which attributes changed on each. Merge once the review is complete — see Merge a branch for what happens at merge time.
What reconciles on merge
IPAM hierarchy reconciliation runs immediately after each mutation on a branch, so the branch's own prefix and address tree stays consistent while you work. When the branch merges or is rebased, Infrahub reads the diff between the two branches, identifies which prefixes and addresses changed, and reconciles only those — reassigning parent prefixes, child prefixes, and address-to-prefix associations as needed on the target branch.
Concurrency
Allocating from a resource pool is guarded by lock-based concurrency control (InfrahubMultiLock) on any branch — two clients requesting the next address or prefix from the same pool at the same time cannot receive the same value.
Creating or updating a prefix with an explicit value is locked on any branch as well, so two clients cannot create the same prefix concurrently. Creating or updating an address with an explicit value is only locked on the default branch — on other branches, concurrent clients can create the same address value without contention.
Worked example: redesign a subnet on a branch
Continuing the ISP example from Use namespaces: Customer A's network team needs to split their 10.0.0.0/16 supernet into two /17 subnets ahead of a datacenter migration.
- Create a branch:
customer-a-subnet-redesign. - On the branch, create the two
10.0.0.0/17and10.0.128.0/17prefixes in thecustomer-anamespace, both with10.0.0.0/16as their parent. - Move the existing
/24and/26prefixes under whichever new/17contains them — Infrahub re-parents each one automatically based on its network containment. - Open a Proposed Change and review the Data tab: the new
/17prefixes appear as additions, and each moved prefix shows itsparentrelationship changing from10.0.0.0/16to the matching/17. - Merge. Infrahub reconciles the hierarchy of the
customer-anamespace on the default branch to match.
Related
- Branches — branch lifecycle and isolation modes
- Proposed Changes — the review and merge workflow
- Allocate IPs and prefixes — allocating on a branch during provisioning