Comment 3 for bug 1831726

Revision history for this message
Brian Haley (brian-haley) wrote :

Thanks for the additional information.

Looking at your API calls and the underlying code, I think things are working as intended, but with the nature of allowing a single port to have multiple IPv6 subnets it maybe is causing some unexpected behavior. Let me first explain what is happening.

Your second call to update the port is:

$ neutron port-update --fixed-ip subnet_id=7266ece7-c515-4bbe-90ff-f7cfd5d52826,ip_address=2011:4444:5555:6::9 444a8244-264b-412f-b0e7-c69472cc799c

This is going to release the existing IP allocation and replace it with this one for the second subnet, it will not merge the two together.

The API reference mentions this:

https://developer.openstack.org/api-ref/network/v2/index.html?expanded=update-port-detail#ports

You can update information for a port, such as its symbolic name and associated IPs. When you update IPs for a port, any previously associated IPs are removed, returned to the respective subnet allocation pools, and replaced by the IPs in the request body. Therefore, this operation replaces the fixed_ip attribute when you specify it in the request body. If the updated IP addresses are not valid or are already in use, the operation fails and the existing IP addresses are not removed from the port.

The openstack client call seems similar:

$ openstack port set --fixed-ip subnet=ipv6_subnet_A,ip-address=2010:1111:2222:3::9 444a8244-264b-412f-b0e7-c69472cc799c

But I think this is actually going to get the current port attributes, then append the new ones, doing the right thing. That seems to be what you are seeing.

So this is maybe more of a documentation issue - what are the commands to run to get two IPv6 subnets attached to a router with custom fixed IP addresses? Let me look in the docs to see if we already have this somewhere, otherwise I think if you stay with just using the openstackclient you might avoid the issue?