Resource Pool Types
Infrahub provides three types of resource pools:| Pool Type | Use Case | Example |
|---|---|---|
| Number Pool | Sequential numbers (VLANs, ASNs, IDs) | VLAN 100-200, ASN 65000-65535 |
| IP Prefix Pool | Subnet allocation from parent prefixes | /24 subnets from 10.0.0.0/16 |
| IP Address Pool | Individual IP allocation from prefixes | IPs from 10.0.1.0/24 |
Number Pools
Number pools allocate sequential numbers from a defined range.Creating a Number Pool
- UI
- GraphQL
- Python SDK
- Navigate to Resource Manager → Number Pools
- Click Add Number Pool
- Set the pool properties:
- Name: Descriptive name (e.g., “VLAN Pool”)
- Node: Object kind using this pool (e.g.,
InfraVLAN) - Node Attribute: Attribute to populate (e.g.,
vlan_id) - Start Range: Beginning of range (e.g., 100)
- End Range: End of range (e.g., 200)
- Click Save
Allocating from Number Pools
Once a pool is defined and associated with a schema attribute (viaNumberPool parameters), Infrahub automatically allocates values when creating objects.
Schema Configuration
In your schema, define the attribute withNumberPool parameters:
vlan_id, Infrahub allocates the next available number:
Excluded Values
Exclude specific numbers or ranges from allocation:Min/Max Constraints
Restrict allocation to a subset of the pool:IP Prefix Pools
IP Prefix Pools allocate subnets from parent prefixes.Creating an IP Prefix Pool
- UI
- GraphQL
- Python SDK
- Navigate to Resource Manager → IP Prefix Pools
- Click Add IP Prefix Pool
- Set the pool properties:
- Name: Pool name (e.g., “Site Subnets”)
- IP Namespace: Namespace for the pool
- Default Prefix Length: Default size for allocations (e.g., 24)
- Default Prefix Type: Object kind (e.g.,
IpamIPPrefix) - Default Member Type: Prefix usage (e.g.,
prefix) - Resources: Parent prefixes to allocate from
- Click Save
Allocating Prefixes from Pools
Use the pool’sget_resource method to allocate the next available prefix:
- Queries all existing child prefixes
- Calculates gaps in the address space
- Returns the first available prefix of the requested length
- Creates the prefix object and reconciles the IPAM hierarchy
Allocation Weighting
When a pool has multiple parent prefixes, useallocation_weight to prioritize them:
IP Address Pools
IP Address Pools allocate individual IP addresses from prefixes.Creating an IP Address Pool
- UI
- GraphQL
- Python SDK
- Navigate to Resource Manager → IP Address Pools
- Click Add IP Address Pool
- Configure:
- Name: Pool name (e.g., “Server IPs”)
- IP Namespace: Namespace
- Default Address Type: Object kind (e.g.,
IpamIPAddress) - Resources: Parent prefixes to allocate from
- Click Save
Allocating IP Addresses
- Network address (first IP)
- Broadcast address (last IP)
- Already allocated IPs
is_pool=True:
Pool Utilization
Track pool usage to monitor capacity:Reservations and Identifiers
Resource Manager uses identifiers to track allocations:- Identifier: Unique key for the allocation (e.g., node ID, HFID)
- Reservation: Database record linking identifier to allocated resource
Best Practices
- Use descriptive identifiers: Help track what the resource is for
- Set allocation weights: Guide allocation order for multiple parent resources
- Monitor utilization: Set alerts when pools reach 80% capacity
- Exclude reserved values: Use
excluded_valuesfor reserved numbers - Use namespaces: Isolate IP allocations by environment or tenant
- Plan pool sizes: Ensure pools are large enough for growth
Next Steps
- Learn about IPAM for IP address management
- Use Profiles to set default pool configurations
- Explore Object Management for creating pool resources