Fixed IPv6 address for VM


In OpenNebula 5.4.13, I have defined a virtual network with IPv4 and IPv6 addresses. I want the VMs that use that virtual network to get fixed IP addresses, IPv4 as well as IPv6. In the virtual machine template, I can do this successfully for IPv4 by opening the advanced network options and entering a fixed IPv4 address. But when I do the same with the IPv6 address, when trying to start the VM, I get an error

Cannot get IP/MAC lease from virtual network 54

though I entered an IPv6 address that is included in the range I defined in the virtual network and though that address is not already in use.

Does fixed IPv6 address not work in OpenNebula 5.4.13?


Now, I discovered that when I remove the fixed IPv4 address and only leave the IPv6 address, the mentioned error does not occur. It occurs only if I set both the fixed IPv4 and the fixed IPv6 address. So, I have a new question: Is the IPv6 address strictly tied to the IPv4 address and if I enter for example the second IPv4 from the virtual network’s address range as a fixed IPv4 for a VM, does OpenNebula automatically choose the second IPv6 address from the range as the IPv6 address for the VM?

btw, in 5.6 is breaking change in ipv6

Yes that’s right, each lease is composed by a IPv4 + IPv6. Internally there is one index that offset the first IP in the range. Behavior is similar for the SLAAC and non-SLAAC versions.

So you can fix one of the IPs, the other is automatically derived from the first one based on its index in the range.

If you need to freely choose both, you can define two AR’s and add one of the IPs as a NIC_ALIAS…