I am attempting to create a IPAM Driver as a proof of concept to later integrate with Infoblox. In my POC I am using Netbox in my home lab.
I’ve created the scripts in /var/lib/one/remotes/ipam/netbox{allocate_address,free_address,get_address,register_address_range,unregister_address_range}.
I created the vnet with a simple:
cat <<EOF | onevnet create
NAME = “netbox-ipam”
BRIDGE = “br0”
BRIDGE_TYPE = “linux”
VN_MAD = “dummy”
IPAM_MAD = “netbox”
NETBOX_PREFIX_ID = “2”
EOF
-
It does not automatically trigger a “register_address_range”. I can force it using onevnet addar.
-
The system never calls allocate_address ever when provisioning a VM. It will trigger get_address of the first ip from the previously discovered “register_address_range” force run… HOWEVER it will only keep requesting the first IP and never go to the next. The lease still shows taken.
The netbox api/script side of things works as expected, on the get_address I have it reserve it so it will not be used by anything else. I didn’t think get_address was the script to reserve but right now thats all I’m seeing getting called during provisioning.
Here is the show of the vnet after triggering the one system (ends up with 10.10.20.129).
VIRTUAL NETWORK 34 INFORMATION
ID : 34
NAME : netbox-ipam
USER : oneadmin
GROUP : oneadmin
LOCK : None
CLUSTERS : 0
BRIDGE : br0
STATE : READY
VN_MAD : dummy
AUTOMATIC VLAN ID : NO
AUTOMATIC OUTER VLAN ID : NO
USED LEASES : 1
PERMISSIONS
OWNER : um-
GROUP : ---
OTHER : ---
VIRTUAL NETWORK TEMPLATE
BRIDGE="br0"
BRIDGE_TYPE="linux"
IPAM_MAD="netbox"
METHOD="static"
NETBOX_PREFIX_ID="2"
OUTER_VLAN_ID=""
PHYDEV=""
SECURITY_GROUPS="0"
VLAN_ID=""
VN_MAD="dummy"
ADDRESS RANGE POOL
AR 0
SIZE : 126
LEASES : 1
IPAM_MAD : netbox
RANGE FIRST LAST
MAC 02:00:0a:0a:14:81 02:00:0a:0a:14:fe
IP 10.10.20.129 10.10.20.254
LEASES
AR OWNER MAC IP PORT_FORWARD IP6
0 V:49 02:00:0a:0a:14:81 10.10.20.129 - -
VIRTUAL ROUTERS
VIRTUAL MACHINES
UPDATED : 49
OUTDATED :
ERROR :