IPAM netbox integration

metaller666

New Member
Jan 19, 2024
1
0
1
Hi,

I try to setup IPAM with netbox integration in PVE 8.1.4.
I installed SDN packages and dnsmasq as described here: https://pve.proxmox.com/pve-docs/chapter-pvesdn.html

I also integrated netbox with API and configured a simple zone with netbox as IPAM.
1705656907267.png
1705656836498.png
1705656935707.png
1705658399508.png

IP addresses for VM will be registered automatically in netbox, but VM doesn't get an IP address.
1705656965520.png
1705656989772.png
1705657392188.png

1705657050907.png

Syslog shows following error: dnsmasq-dhcp[16392]: DHCPDISCOVER(NetbTest) bc:24:11:e1:86:93 ignored

Firewall isn't active on PVE. Local IPAM is working
1705657107768.png
1705657542016.png

Any advices?

Best regards
 
Last edited:
I have send patch last month about this bug, but it's not yet applied.


as netbox return ip with the mask , this break dhcp lease

https://lists.proxmox.com/pipermail/pve-devel/2024-January/061227.html

Code:
--- /use/share/perl5/PVE/Network/SDN/Ipams/NetboxPlugin.pm

 sub add_range_next_freeip {
@@ -176,19 +174,16 @@ sub add_range_next_freeip {
 
     my $params = { dns_name => $data->{hostname}, description => $description };
 
-    my $ip = undef;
     eval {
     my $result = PVE::Network::SDN::api_request("POST", "$url/ipam/ip-ranges/$internalid/available-ips/", $headers, $params);
-    $ip = $result->{address};
+    my ($ip, undef) = split(/\//, $result->{address});
     print "found ip free $ip in range $range->{'start-address'}-$range->{'end-address'}\n" if $ip;
+    return $ip;
     };
 
     if ($@) {
     die "can't find free ip in range $range->{'start-address'}-$range->{'end-address'}: $@" if !$noerr;
     }
-
-    return $ip;
-
 }
 
I have send patch last month about this bug, but it's not yet applied.


as netbox return ip with the mask , this break dhcp lease

https://lists.proxmox.com/pipermail/pve-devel/2024-January/061227.html

Code:
--- /use/share/perl5/PVE/Network/SDN/Ipams/NetboxPlugin.pm

 sub add_range_next_freeip {
@@ -176,19 +174,16 @@ sub add_range_next_freeip {
 
     my $params = { dns_name => $data->{hostname}, description => $description };
 
-    my $ip = undef;
     eval {
     my $result = PVE::Network::SDN::api_request("POST", "$url/ipam/ip-ranges/$internalid/available-ips/", $headers, $params);
-    $ip = $result->{address};
+    my ($ip, undef) = split(/\//, $result->{address});
     print "found ip free $ip in range $range->{'start-address'}-$range->{'end-address'}\n" if $ip;
+    return $ip;
     };
 
     if ($@) {
     die "can't find free ip in range $range->{'start-address'}-$range->{'end-address'}: $@" if !$noerr;
     }
-
-    return $ip;
-
 }
Hello, do you know if this has been applied already? Im currently testing and I cant get it set up correctly. Seems like its still not working:

1721310880062.png


Code:
Task viewer: VM 107 - Start

generating cloud-init ISO
can't find any free ip in zone sz01 for IPv4 at /usr/share/perl5/PVE/Network/SDN/Vnets.pm line 143.
found ip free 192.168.100.100 in range 192.168.100.100-192.168.100.150
found ip free 192.168.100.50 in range 192.168.100.50-192.168.100.75
kvm: -netdev type=tap,id=net1,ifname=tap107i1,script=/var/lib/qemu-server/pve-bridge,downscript=/var/lib/qemu-server/pve-bridgedown,vhost=on: network script /var/lib/qemu-server/pve-bridge failed with status 6400
TASK ERROR: start failed: QEMU exited with code 1
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!