Skip to content

Commit de9e632

Browse files
committed
ovn: Don't fail db sync if new IP allocation fails for metadata
There is a scenario where IP allocation pool is depleted but OVN metadata port got removed its IP manually. The DB sync script will attempt to allocate a new IP address if DHCP is enabled in the subnet. Since the pool has no available IP addresses an exception is raised and the whole db sync stops. This patch simply catches the exception, logs and error and continues syncing other resources. Closes-bug: #1987135 Signed-off-by: Jakub Libosvar <[email protected]> Change-Id: Iaa7b0d7ceb244a38fddd7676066683bf2ca72341 (cherry picked from commit d237a2a)
1 parent 7032865 commit de9e632

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/ovn_db_sync.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -948,8 +948,13 @@ def _sync_metadata_ports(self, ctx, db_ports):
948948
db_ports.pop(port['id'])
949949

950950
if self.mode == SYNC_MODE_REPAIR:
951-
# Make sure that this port has an IP address in all the subnets
952-
self._ovn_client.update_metadata_port(ctx, net['id'])
951+
try:
952+
# Make sure that this port has an IP address in all the
953+
# subnets
954+
self._ovn_client.update_metadata_port(ctx, net['id'])
955+
except n_exc.IpAddressGenerationFailure:
956+
LOG.error('Could not allocate IP addresses for '
957+
'metadata port in network %s', net['id'])
953958
LOG.debug('OVN sync metadata ports finished')
954959

955960
def sync_networks_ports_and_dhcp_opts(self, ctx):

0 commit comments

Comments
 (0)