<div dir="ltr"><div style="font-size:12.8000001907349px">Hi,</div><div style="font-size:12.8000001907349px"><br></div><div style="font-size:12.8000001907349px">According to the libnetwork remote driver spec, multiple Address and AddressIPv6 are passed as a part of Interfaces property passed to the handler of /NetworkDriver.CreateEndpoint [1]. We have no clue other than this to get enough information to create Neutron subnets. So we need to create the subnets dynamically here rather than when we create a Docker network.</div><div style="font-size:12.8000001907349px"><br></div><div style="font-size:12.8000001907349px">In my patch I create one or two subnets depending on Address and/or AddressIPv6 are provided. But Docker endpoints can be created more than once specifying the single subnet and it's better to reuse the same one if it's already created. By default <span class="">Kuryr</span> doesn't specify allocation_pools for creating a Neutron subnet and thus it tries to allocate all IP addresses in the subnet [2].</div><div style="font-size:12.8000001907349px"><br></div><div style="font-size:12.8000001907349px">Therefore I'd make the following assumption.</div><div style="font-size:12.8000001907349px"><br></div><div style="font-size:12.8000001907349px">1. On the endpoint creation it examine if there's a subnet which CIDR corresponds to Address or AddressIPv6 requested</div><div style="font-size:12.8000001907349px">2. If there's the subnet, <span class="">Kuryr</span> tires to reuse it without creating a new subnet, otherwise it create a new one with the given CIDR</div><div style="font-size:12.8000001907349px">3. <span class="">Kuryr</span> creates a port assigning the IP address to it and associating the port with the subnet based on it's already allocated in 2.<br></div><div style="font-size:12.8000001907349px"><br></div><div style="font-size:12.8000001907349px">I think this would work but let me know if I'm missing anything and I'd like to hear from experts.</div><div style="font-size:12.8000001907349px"><br></div><div style="font-size:12.8000001907349px">[1]: <a href="https://github.com/docker/libnetwork/blob/master/docs/remote.md#create-endpoint" target="_blank">https://github.com/docker/libnetwork/blob/master/docs/remote.md#create-endpoint</a></div><div style="font-size:12.8000001907349px">[2]: <a href="http://developer.openstack.org/api-ref-networking-v2.html#createSubnet" target="_blank">http://developer.openstack.org/api-ref-networking-v2.html#createSubnet</a></div><div style="font-size:12.8000001907349px"><br></div><span style="font-size:12.8000001907349px">Best regards,</span><div style="font-size:12.8000001907349px">Taku Fukushima</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Aug 21, 2015 at 5:51 PM, Antoni Segura Puimedon <span dir="ltr"><<a href="mailto:toni+openstackml@midokura.com" target="_blank">toni+openstackml@midokura.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div dir="ltr"><div><div><div>Hi list,<br><br></div>I was reviewing the CreateEndpoint patch[1] from Taku that had received positive reviews. I put some comment about an alternative way to map endpoints to nets and subnets and I would appreciate some discussion here on the mailing list about the original proposal and the alternative I mentioned.<br><br></div>Regards,<br><br></div>Toni<br><div><div><br><br>=====================<br>[1] <a href="https://review.openstack.org/#/c/210052/9//COMMIT_MSG" target="_blank">https://review.openstack.org/#/c/210052/9//COMMIT_MSG</a><br></div></div></div>
</div><br></div>
</blockquote></div><br></div>