Vnet mac pool reuse too quickly

Hi,

We have an automated VM environment where VMs are created & deleted frequently each day. Most of these VM are using IPv4 DHCP. The mac-address reuse makes it challenging for our automation to find the mac/IP mapping at the external dhcp server. The previous IP hasn’t timed out yet for the deleted VM. (we have a 15 min lifetime).

The virtual network MAC pool on OpenNebula v6.10 re-uses the just released MAC for the very next VM’s vNIC. While this is all technically correct from a networking perspective, it does present some challenges. (external network switches relearning mac quickly is one concern too.)

Anyhow I was wondering if there was an way to configure an “age” timer or some way to delay reuse of the mac until X minutes after release?

I found this older post from 2016 asking similar question:

At that time the suggestion was to use an external IPAM tying it to the vnet pool with OpenNebula IPAM Driver.
https://docs.opennebula.io/6.10/integration_and_development/infrastructure_drivers_development/devel-ipam.html

Since that was back in 2016, I thought of checking if that is still solution or is there any new configurable on OpenNebula vnet pool side? (I couldn’t find one.)

Thanks for you time and suggestions,

–Ken

Hello @kemcfarl,

The link to the documentation refers to the 6.10 version, so the solution from 2016, is still valid :wink:

Other option would be expand the MAC range address, or manually assign MAC addresses (which at some point could be hard to scale).

I’ve found a similar issue open: Ease setting custom MAC address for VMs · Issue #6804 · OpenNebula/one · GitHub
So you if you think it makes sense to comment on it, and also suggest a timer or something like rules for assigning addresses, you are more than welcome to participate.

Cheers,

HI @FrancJP ,

Thanks for confirming the current solutions.
As for expanding the MAC range, that will not help. The size of the pools isn’t the issue, its related to it reusing the same mac immediately after its released/free.

We’ll explore how best to avoid this, but wanted to be sure there wasn’t a newer option available that I was missing.

Once again thank you for your time and this wonderful Open Nebula product.

–Ken

Hi,

Could you try using the VM hooks?

In general, when a VM is terminated (the DONE state), a hook could be triggered to tag the VM MACs in the VNet AR as reserved. This way, the MAC will not be offered to other VMs… Well, you’d need to have a periodic script to release the reservations so as not to exhaust the entire AR. However, how frequently reservations are to be released depends on the use case.

Hope this helps,

Best Regards,
Anton Todorov

HI,
Thank you for a 2nd Suggestion. We’ll consider this too.

–Ken