Undeploy and instances IPs addresses


In my OpenNebula there is configured a private network with 24bits mask. During night, an script is executed to undeploy each instance and free all resources taken by all instances. But I have checked that IPs leases not goes to zero, so it seems there are IPs “taken” by the undeployed instances.

I have always thought that during undeploying process, all resources taken by one instance are returned to the baremetal server, but now I have doubts with IP address. If, for example, server would has 250 instances undeployed, each of them with an IP address and, later, I instantiate 10 instances, all of these 10 would have an IP address or 5 or 6 of them would remain in “PENDING” state because of no free resources?


Hi @Daniel_Ruiz_Molina,

Your observation and assumption are correct - you’ll exhaust the ARs. That is because the IPs are hard-linked to the nic MACs. Kind of solution to decouple the nic MAC from the IP is to add Ethernet only nic interface to the VMs. Then you could configure an external DHCP server to provide the IP leases. Note that in this case OpenNebula will be not aware of the IPs at all! Another option is to write VM hooks to add the IPs as ALIAS_IP when a VM is deployed/instantiated/ and remove/release/ them when a VM is undeployed.

Best Regards,
Anton Todorov


Would it be difficult to write that VM hook? Now, my “Internet” network (mask 23… 507 IPs aprox) has all IPs assigned to VMs that are, now, undeployed… and I can’t instantiate a new VM with that network.