Skip to content

Add most_available_subnet for both v4 & v6

Luis Fernandez Alvarez requested to merge feat/most_available_v4_v6 into master

Add most_available_subnet v4/6 to host restrictions API

Without this patch, clients couldn't get the pair v4/v6 subnets that are the most availabe.

This change adds a new couple of fields most_available_subnet_v{4,6} following the existing naming convention. It contains the pair of subnets belonging to the same IP service that represent the most available subnets.

Note:

This is an alternative solution to what is proposed in !55 (closed) to tackle the same problem:

  • Avoid race conditions when picking subnets for new ports. When subnets are almost full, it can happen that several request are placed in the same subnet where there is no enough space for all of them.
  • While it doesn't solve the scenario, moving from randomly selected subnets to picking the most available one should reduce the probability of the problem happening. In all the situations so far, the underlying VM pool had other subnets with plenty of IPs available.
  • This requires a change in nova to start using this field once the new field is available in neutron server. The change corresponds here: https://gitlab.cern.ch/cloud-infrastructure/nova/-/blob/cern-train/nova/network/neutronv2/api.py#L459-466

It fixes/workarounds: OS-13674

Edited by Luis Fernandez Alvarez

Merge request reports