IPAM Driver POC, Not triggering *_address scripts as expected

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

  1. It does not automatically trigger a “register_address_range”. I can force it using onevnet addar.

  2. 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          :

Hello @mikentt,

I don’t know if you have checked our documentation:

Apparently it should work with the first option you mentioned: “using onevnet addar”, so what info gives you the /var/log/one/oned.log?

Cheers,

Poured over them several times but I still am unable to figure out the exact mechanics of them to correctly get it to function as I expect it should.

As an example the “register_address_range” script is not called when I create the onevnet for this IPAM driver. I have to force it by using the onevnet addar.

“allocate_address” also doesnt seem to ever be executed. Only “get_address” is and I never seen an “unregister_address_range” when removing an onevnet.

I’ve tried to look for examples of “working” ipam drivers but what I’ve found doesn’t seem to clear up when those scripts are executed.

This could be because I incorrectly have configured the onevnet (shown above)? But I can’t see it if it is.