In some Neutron use cases it is desirable for the IP address(es) that Neutron allocates to a VM to depend on the compute host that Nova chooses for that VM. For example, in the networking-calico approach where data is routed between compute hosts, it's desirable for the IP addresses that are used on a given host (or rack) to be clustered within a small IP prefix, so that the routes to those IP addresses can be aggregated on routers within the data center fabric. Neutron's new pluggable IPAM facility allows us in principle to start doing this, but we will need to design and implement three other pieces of the solution:
- Firstly, we need a way for the pluggable IPAM framework to pass the chosen host into a pluggable IPAM module, such that a module can take the host into account if it so wishes. (If this does not already exist - we are not yet sure!)
- Secondly, to demonstrate that, we need a sample pluggable IPAM module that allocates IP addresses in some host-aware way.
- Thirdly, we eventually need to enhance the port setup exchange between Nova and Neutron, such that Neutron can choose an IP address _after_ Nova has chosen the compute host.
This work is being done as part of an Outreachy internship, and the last point cannot reasonably fit in that scope. Hence this RFE proposes just the first two points, as a useful and concrete step towards the eventual complete picture.
There may be some synergy between this request and the routed networks work. I wonder if Calico could benefit from the current proposed solution for routed networks. Would it be crazy for Calico to implement enough of the segments API so that the interaction with Nova is the same as with an ML2 or other based plugin? (I suspect it might be)
One difference that I see between this and routed networks is that with the latter, subnets are hard-bound to segments. There really is no flexibility to break the boundary because of the underlying L2 semantics which must be respected. With Calico, I suspect the boundaries are soft. What I mean is that if one cluster of IPs is exhausted, you have the ability to assign an IP from another cluster and route it correctly. It sounds like you want to minimize the fragmentation of IP clusters to keep routing tables concise but you may or may not require absolute adherence to the boundaries. Is that right? Or, do you want the availability of IPs in a cluster to drive placement in Nova?