Can't get external DHCP working

So I’m trying to get dhcp working in opennebula. I have set everything up, and when I run terrafform apply, it can never get a DHCP address. My vlan has

DHCP=yes

EXTERNAL_DHCP=yes

and no networking configs in there. This is the error I’m getting:

OpenNebula error [INTERNAL]: [one.vm.allocate] Cannot get IP/MAC lease from virtual network 1141.

I’ve been working almost a day with Amazon Q to figure this out, and I’m at a loss. I mean, this has to work, right?

Hello,

Just a question, what kind of VNET are you using?

  • If it is 802.1q (VLAN) may you check that DHCP relay is working?
  • Have you checked a tcpdump for the VNET bridge to see if there is bootp traffic returning? (note that for tcpdump bootp protocol is bootps, i.e. sudo tcpdump -n -i eth0 port bootps )
  • Have you tried setting up a DHCP server inside the own vnet to see if it runs correctly?

Thanks!

I have tried 802.1q and bridge. I’m not sure what you mean by dhcp relay. Generally speaking, the network people provision my ports with all vlans available and I set up qemu-based kvm servers managed by libvirt-terraform and it all works. I am having them recheck. However, couple of questions.

  1. If I use 802.1q directly, I should be able to just set up using onevnet on the frontend, and then do not have to do anything on the compute nodes?
  2. If I have to use bridges, then I have to set those up on all nodes?

When searching docs, I get conflicting answers here.

thx

So, right now I’ve tried everything and nothing works. I’m setting up Kea dhcp, so I can import my dhcp settings into opennebula everytime we update dns/dhcp internally, and I hope that will work. I am unable to get it working. On the plus side, I developed a shell script that I can run that can be fed a bridge and mac and it returns the info the DHCP server hands out. This works on my 3 nodes.

Ok, I fixed the issue. I put in a pre-terraform script that grabs the DHCP settings from the server, and then uses onevnet to update the internal dhcp server and that’s working. I have another issue with my template.

1 Like

Hi, I’m glad to hear that everything worked. By DHCP relay I meant that dhcrelay probably would solve your problem of not getting any IPv4 address. With DHCPv6 this is a bit different.

Oh, yeah, we have dhcprelay set up in our cisco devices on every net. It seems the twist here is that we have a standard convention for mac addresses, so we assign our own to VM’s which seems to be the issue.