Resource manager
In Infrahub a resource manager is responsible for allocating resources out of a resource pool.
Examples:
- allocating the next available IP Prefix out of a IP Prefix pool
- allocating the next available IP addresses out of a IP Address pool
- allocating the next available VLAN ID out of a pool of valid VLAN ID's
- allocating the next available ASN (Autonomous System Number) out of a number pool
A resource manager in Infrahub allocates resources in a branch agnostic way. When you allocate a resource out of a pool in a branch, then that allocation happens in all the branches.
Depending on how you use the resource manager, it can allocate resources in an idempotent way. This is helpful when you want to use generators that have to behave in an idempotent way.
Resources can be allocated in 2 different ways:
- Direct allocation: A direct allocation is typically used when you don't need the resource to be related to another node in Infrahub, or if you want establish such a relation at a later time. For example, you want to allocated an IP address out of a pool that is not going to be linked to another node in Infrahub.
- Relationship resource allocation: A resource can be allocated to a relationship of a node, when you create a new node. For example, when you want to create a device and assign an IP address out of a pool to an interface at device creation time.
See the guide for instructions on creating and using resource manager in Infrahub.