Merge "Revert "[OVN] Remove backwards compatibility with OVN < v20.09""
This commit is contained in:
commit
3fc97633a0
@ -227,8 +227,10 @@ class SbGlobalUpdateEvent(row_event.RowEvent):
|
|||||||
def run(self, event, row, old):
|
def run(self, event, row, old):
|
||||||
|
|
||||||
def _update_chassis(self, row):
|
def _update_chassis(self, row):
|
||||||
|
table = ('Chassis_Private' if self.agent.has_chassis_private
|
||||||
|
else 'Chassis')
|
||||||
self.agent.sb_idl.db_set(
|
self.agent.sb_idl.db_set(
|
||||||
'Chassis_Private', self.agent.chassis, ('external_ids', {
|
table, self.agent.chassis, ('external_ids', {
|
||||||
ovn_const.OVN_AGENT_METADATA_SB_CFG_KEY:
|
ovn_const.OVN_AGENT_METADATA_SB_CFG_KEY:
|
||||||
str(row.nb_cfg)})).execute()
|
str(row.nb_cfg)})).execute()
|
||||||
|
|
||||||
@ -291,17 +293,27 @@ class MetadataAgent(object):
|
|||||||
self._load_config()
|
self._load_config()
|
||||||
|
|
||||||
tables = ('Encap', 'Port_Binding', 'Datapath_Binding', 'SB_Global',
|
tables = ('Encap', 'Port_Binding', 'Datapath_Binding', 'SB_Global',
|
||||||
'Chassis', 'Chassis_Private')
|
'Chassis')
|
||||||
events = (PortBindingChassisCreatedEvent(self),
|
events = (PortBindingChassisCreatedEvent(self),
|
||||||
PortBindingChassisDeletedEvent(self),
|
PortBindingChassisDeletedEvent(self),
|
||||||
SbGlobalUpdateEvent(self),
|
SbGlobalUpdateEvent(self),
|
||||||
PortBindingMetaPortUpdatedEvent(self),
|
PortBindingMetaPortUpdatedEvent(self))
|
||||||
ChassisPrivateCreateEvent(self),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
# TODO(lucasagomes): Remove this in the future. Try to register
|
||||||
|
# the Chassis_Private table, if not present, fallback to the normal
|
||||||
|
# Chassis table.
|
||||||
|
# Open the connection to OVN SB database.
|
||||||
|
self.has_chassis_private = False
|
||||||
self._post_fork_event.clear()
|
self._post_fork_event.clear()
|
||||||
|
try:
|
||||||
self.sb_idl = ovsdb.MetadataAgentOvnSbIdl(
|
self.sb_idl = ovsdb.MetadataAgentOvnSbIdl(
|
||||||
chassis=self.chassis, tables=tables, events=events).start()
|
chassis=self.chassis, tables=tables + ('Chassis_Private', ),
|
||||||
|
events=events + (ChassisPrivateCreateEvent(self), )).start()
|
||||||
|
self.has_chassis_private = True
|
||||||
|
except AssertionError:
|
||||||
|
self.sb_idl = ovsdb.MetadataAgentOvnSbIdl(
|
||||||
|
chassis=self.chassis, tables=tables,
|
||||||
|
events=events + (ChassisCreateEvent(self), )).start()
|
||||||
|
|
||||||
# Now IDL connections can be safely used.
|
# Now IDL connections can be safely used.
|
||||||
self._post_fork_event.set()
|
self._post_fork_event.set()
|
||||||
@ -323,10 +335,11 @@ class MetadataAgent(object):
|
|||||||
def register_metadata_agent(self):
|
def register_metadata_agent(self):
|
||||||
# NOTE(lucasagomes): db_add() will not overwrite the UUID if
|
# NOTE(lucasagomes): db_add() will not overwrite the UUID if
|
||||||
# it's already set.
|
# it's already set.
|
||||||
|
table = ('Chassis_Private' if self.has_chassis_private else 'Chassis')
|
||||||
# Generate unique, but consistent metadata id for chassis name
|
# Generate unique, but consistent metadata id for chassis name
|
||||||
agent_id = uuid.uuid5(self.chassis_id, 'metadata_agent')
|
agent_id = uuid.uuid5(self.chassis_id, 'metadata_agent')
|
||||||
ext_ids = {ovn_const.OVN_AGENT_METADATA_ID_KEY: str(agent_id)}
|
ext_ids = {ovn_const.OVN_AGENT_METADATA_ID_KEY: str(agent_id)}
|
||||||
self.sb_idl.db_add('Chassis_Private', self.chassis, 'external_ids',
|
self.sb_idl.db_add(table, self.chassis, 'external_ids',
|
||||||
ext_ids).execute(check_error=True)
|
ext_ids).execute(check_error=True)
|
||||||
|
|
||||||
def _get_own_chassis_name(self):
|
def _get_own_chassis_name(self):
|
||||||
|
@ -54,7 +54,6 @@ OVN_NB_DB_SCHEMA_PORT_GROUP = '5.11.0'
|
|||||||
OVN_NB_DB_SCHEMA_STATELESS_NAT = '5.17.0'
|
OVN_NB_DB_SCHEMA_STATELESS_NAT = '5.17.0'
|
||||||
OVN_SB_DB_SCHEMA_VIRTUAL_PORT = '2.5.0'
|
OVN_SB_DB_SCHEMA_VIRTUAL_PORT = '2.5.0'
|
||||||
OVN_LOCALNET_LEARN_FDB = '22.09.0'
|
OVN_LOCALNET_LEARN_FDB = '22.09.0'
|
||||||
OVN_SB_DB_SCHEMA_CHASSIS_PRIVATE = '2.9.0'
|
|
||||||
|
|
||||||
|
|
||||||
class OVNCheckType(enum.Enum):
|
class OVNCheckType(enum.Enum):
|
||||||
@ -680,17 +679,3 @@ def ovn_localnet_learn_fdb_support():
|
|||||||
'Exception: %s', e)
|
'Exception: %s', e)
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
def ovn_sb_db_schema_chassis_private_supported():
|
|
||||||
try:
|
|
||||||
ver = _get_ovn_version(OVNCheckType.sb_db_schema)
|
|
||||||
minver = versionutils.convert_version_to_tuple(
|
|
||||||
OVN_SB_DB_SCHEMA_CHASSIS_PRIVATE)
|
|
||||||
if ver < minver:
|
|
||||||
return False
|
|
||||||
except (OSError, RuntimeError, ValueError) as e:
|
|
||||||
LOG.debug('Exception while checking OVN DB schema version. '
|
|
||||||
'Exception: %s', e)
|
|
||||||
return False
|
|
||||||
return True
|
|
||||||
|
@ -352,13 +352,6 @@ def check_ovn_localnet_learn_fdb_support():
|
|||||||
if not result:
|
if not result:
|
||||||
LOG.warning('OVN does not support localnet_learn_fdb option. '
|
LOG.warning('OVN does not support localnet_learn_fdb option. '
|
||||||
'This support was added in OVN 22.09.')
|
'This support was added in OVN 22.09.')
|
||||||
|
|
||||||
|
|
||||||
def check_ovn_sb_db_schema_chassis_private():
|
|
||||||
result = checks.ovn_sb_db_schema_chassis_private_supported()
|
|
||||||
if not result:
|
|
||||||
LOG.warning('OVN SB DB schema does not support chassis private. This '
|
|
||||||
'support was added in DB schema version 2.9.0.')
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
@ -450,10 +443,6 @@ OPTS = [
|
|||||||
check_ovn_localnet_learn_fdb_support,
|
check_ovn_localnet_learn_fdb_support,
|
||||||
help=_('Check OVN supports localnet_learn_fdb option'),
|
help=_('Check OVN supports localnet_learn_fdb option'),
|
||||||
default=False),
|
default=False),
|
||||||
BoolOptCallback('ovn_sb_db_schema_chassis_private_support',
|
|
||||||
check_ovn_sb_db_schema_virtual_port,
|
|
||||||
help=_('Check OVN SB DB schema support chassis private'),
|
|
||||||
default=False),
|
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
@ -63,22 +63,19 @@ class NeutronAgent(abc.ABC):
|
|||||||
self.set_down = False
|
self.set_down = False
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _get_chassis(chassis_or_chassis_private):
|
def chassis_from_private(chassis_private):
|
||||||
"""Return the chassis register
|
|
||||||
|
|
||||||
The input could be the chassis register itself or the chassis private.
|
|
||||||
"""
|
|
||||||
try:
|
try:
|
||||||
return chassis_or_chassis_private.chassis[0]
|
return chassis_private.chassis[0]
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
return chassis_or_chassis_private
|
# No Chassis_Private support, just use Chassis
|
||||||
|
return chassis_private
|
||||||
except IndexError:
|
except IndexError:
|
||||||
# Chassis register has been deleted but not Chassis_Private.
|
# Chassis register has been deleted but not Chassis_Private.
|
||||||
return DeletedChassis
|
return DeletedChassis
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def chassis(self):
|
def chassis(self):
|
||||||
return self._get_chassis(self.chassis_private)
|
return self.chassis_from_private(self.chassis_private)
|
||||||
|
|
||||||
def as_dict(self):
|
def as_dict(self):
|
||||||
return {
|
return {
|
||||||
@ -146,7 +143,7 @@ class ControllerAgent(NeutronAgent):
|
|||||||
|
|
||||||
@staticmethod # it is by default, but this makes pep8 happy
|
@staticmethod # it is by default, but this makes pep8 happy
|
||||||
def __new__(cls, chassis_private, driver):
|
def __new__(cls, chassis_private, driver):
|
||||||
_chassis = cls._get_chassis(chassis_private)
|
_chassis = cls.chassis_from_private(chassis_private)
|
||||||
other_config = ovn_utils.get_ovn_chassis_other_config(_chassis)
|
other_config = ovn_utils.get_ovn_chassis_other_config(_chassis)
|
||||||
if 'enable-chassis-as-gw' in other_config.get('ovn-cms-options', []):
|
if 'enable-chassis-as-gw' in other_config.get('ovn-cms-options', []):
|
||||||
cls = ControllerGatewayAgent
|
cls = ControllerGatewayAgent
|
||||||
@ -171,7 +168,7 @@ class ControllerAgent(NeutronAgent):
|
|||||||
|
|
||||||
def update(self, chassis_private, clear_down=False):
|
def update(self, chassis_private, clear_down=False):
|
||||||
super().update(chassis_private, clear_down)
|
super().update(chassis_private, clear_down)
|
||||||
_chassis = self._get_chassis(chassis_private)
|
_chassis = self.chassis_from_private(chassis_private)
|
||||||
other_config = ovn_utils.get_ovn_chassis_other_config(_chassis)
|
other_config = ovn_utils.get_ovn_chassis_other_config(_chassis)
|
||||||
if 'enable-chassis-as-gw' in other_config.get('ovn-cms-options', []):
|
if 'enable-chassis-as-gw' in other_config.get('ovn-cms-options', []):
|
||||||
self.__class__ = ControllerGatewayAgent
|
self.__class__ = ControllerGatewayAgent
|
||||||
@ -182,7 +179,7 @@ class ControllerGatewayAgent(ControllerAgent):
|
|||||||
|
|
||||||
def update(self, chassis_private, clear_down=False):
|
def update(self, chassis_private, clear_down=False):
|
||||||
super().update(chassis_private, clear_down)
|
super().update(chassis_private, clear_down)
|
||||||
_chassis = self._get_chassis(chassis_private)
|
_chassis = self.chassis_from_private(chassis_private)
|
||||||
other_config = ovn_utils.get_ovn_chassis_other_config(_chassis)
|
other_config = ovn_utils.get_ovn_chassis_other_config(_chassis)
|
||||||
if ('enable-chassis-as-gw' not in
|
if ('enable-chassis-as-gw' not in
|
||||||
other_config.get('ovn-cms-options', [])):
|
other_config.get('ovn-cms-options', [])):
|
||||||
|
@ -137,7 +137,10 @@ class OVNMechanismDriver(api.MechanismDriver):
|
|||||||
OVN_MIN_GENEVE_MAX_HEADER_SIZE)
|
OVN_MIN_GENEVE_MAX_HEADER_SIZE)
|
||||||
raise SystemExit(1)
|
raise SystemExit(1)
|
||||||
self._setup_vif_port_bindings()
|
self._setup_vif_port_bindings()
|
||||||
|
if impl_idl_ovn.OvsdbSbOvnIdl.schema_has_table('Chassis_Private'):
|
||||||
self.agent_chassis_table = 'Chassis_Private'
|
self.agent_chassis_table = 'Chassis_Private'
|
||||||
|
else:
|
||||||
|
self.agent_chassis_table = 'Chassis'
|
||||||
self.subscribe()
|
self.subscribe()
|
||||||
self.qos_driver = qos_driver.OVNQosDriver.create(self)
|
self.qos_driver = qos_driver.OVNQosDriver.create(self)
|
||||||
self.trunk_driver = trunk_driver.OVNTrunkDriver.create(self)
|
self.trunk_driver = trunk_driver.OVNTrunkDriver.create(self)
|
||||||
|
@ -358,7 +358,8 @@ class ChassisAgentTypeChangeEvent(ChassisEvent):
|
|||||||
'external_ids')
|
'external_ids')
|
||||||
if not getattr(old, other_config, False):
|
if not getattr(old, other_config, False):
|
||||||
return False
|
return False
|
||||||
new_other_config = utils.get_ovn_chassis_other_config(row)
|
chassis = n_agent.NeutronAgent.chassis_from_private(row)
|
||||||
|
new_other_config = utils.get_ovn_chassis_other_config(chassis)
|
||||||
old_other_config = utils.get_ovn_chassis_other_config(old)
|
old_other_config = utils.get_ovn_chassis_other_config(old)
|
||||||
agent_type_change = new_other_config.get('ovn-cms-options', []) != (
|
agent_type_change = new_other_config.get('ovn-cms-options', []) != (
|
||||||
old_other_config.get('ovn-cms-options', []))
|
old_other_config.get('ovn-cms-options', []))
|
||||||
@ -656,7 +657,6 @@ class BaseOvnIdl(Ml2OvnIdlBase):
|
|||||||
class BaseOvnSbIdl(Ml2OvnIdlBase):
|
class BaseOvnSbIdl(Ml2OvnIdlBase):
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_server(cls, connection_string, helper):
|
def from_server(cls, connection_string, helper):
|
||||||
helper.register_table('Chassis_Private')
|
|
||||||
helper.register_table('Chassis')
|
helper.register_table('Chassis')
|
||||||
helper.register_table('Encap')
|
helper.register_table('Encap')
|
||||||
helper.register_table('Port_Binding')
|
helper.register_table('Port_Binding')
|
||||||
@ -713,6 +713,13 @@ class OvnIdlDistributedLock(BaseOvnIdl):
|
|||||||
|
|
||||||
self.update_tables(tables, row.schema[0])
|
self.update_tables(tables, row.schema[0])
|
||||||
|
|
||||||
|
if self.driver.agent_chassis_table == 'Chassis_Private':
|
||||||
|
if 'Chassis_Private' not in self.tables:
|
||||||
|
self.driver.agent_chassis_table = 'Chassis'
|
||||||
|
else:
|
||||||
|
if 'Chassis_Private' in self.tables:
|
||||||
|
self.driver.agent_chassis_table = 'Chassis_Private'
|
||||||
|
|
||||||
def notify(self, event, row, updates=None):
|
def notify(self, event, row, updates=None):
|
||||||
try:
|
try:
|
||||||
self.handle_db_schema_changes(event, row)
|
self.handle_db_schema_changes(event, row)
|
||||||
@ -813,9 +820,10 @@ class OvnSbIdl(OvnIdlDistributedLock):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_server(cls, connection_string, helper, driver):
|
def from_server(cls, connection_string, helper, driver):
|
||||||
|
if 'Chassis_Private' in helper.schema_json['tables']:
|
||||||
|
helper.register_table('Chassis_Private')
|
||||||
if 'FDB' in helper.schema_json['tables']:
|
if 'FDB' in helper.schema_json['tables']:
|
||||||
helper.register_table('FDB')
|
helper.register_table('FDB')
|
||||||
helper.register_table('Chassis_Private')
|
|
||||||
helper.register_table('Chassis')
|
helper.register_table('Chassis')
|
||||||
helper.register_table('Encap')
|
helper.register_table('Encap')
|
||||||
helper.register_table('Port_Binding')
|
helper.register_table('Port_Binding')
|
||||||
|
@ -85,7 +85,9 @@ class TestMetadataAgent(base.TestOVNFunctionalBase):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def agent_chassis_table(self):
|
def agent_chassis_table(self):
|
||||||
|
if self.agent.has_chassis_private:
|
||||||
return 'Chassis_Private'
|
return 'Chassis_Private'
|
||||||
|
return 'Chassis'
|
||||||
|
|
||||||
def _start_metadata_agent(self):
|
def _start_metadata_agent(self):
|
||||||
conf = self.useFixture(fixture_config.Config()).conf
|
conf = self.useFixture(fixture_config.Config()).conf
|
||||||
|
@ -423,6 +423,7 @@ class TestOVNFunctionalBase(test_plugin.Ml2PluginV2TestCase,
|
|||||||
name, ['geneve'], '172.24.4.%d' % self._counter,
|
name, ['geneve'], '172.24.4.%d' % self._counter,
|
||||||
external_ids=external_ids, hostname=host,
|
external_ids=external_ids, hostname=host,
|
||||||
other_config=other_config).execute(check_error=True)
|
other_config=other_config).execute(check_error=True)
|
||||||
|
if self.sb_api.is_table_present('Chassis_Private'):
|
||||||
nb_cfg_timestamp = timeutils.utcnow_ts() * 1000
|
nb_cfg_timestamp = timeutils.utcnow_ts() * 1000
|
||||||
self.sb_api.db_create(
|
self.sb_api.db_create(
|
||||||
'Chassis_Private', name=name, external_ids=external_ids,
|
'Chassis_Private', name=name, external_ids=external_ids,
|
||||||
@ -433,5 +434,6 @@ class TestOVNFunctionalBase(test_plugin.Ml2PluginV2TestCase,
|
|||||||
def del_fake_chassis(self, chassis, if_exists=True):
|
def del_fake_chassis(self, chassis, if_exists=True):
|
||||||
self.sb_api.chassis_del(
|
self.sb_api.chassis_del(
|
||||||
chassis, if_exists=if_exists).execute(check_error=True)
|
chassis, if_exists=if_exists).execute(check_error=True)
|
||||||
|
if self.sb_api.is_table_present('Chassis_Private'):
|
||||||
self.sb_api.db_destroy(
|
self.sb_api.db_destroy(
|
||||||
'Chassis_Private', chassis).execute(check_error=True)
|
'Chassis_Private', chassis).execute(check_error=True)
|
||||||
|
@ -470,6 +470,8 @@ class TestAgentMonitor(base.TestOVNFunctionalBase):
|
|||||||
int(chassis_ts / 1000), datetime.timezone.utc)
|
int(chassis_ts / 1000), datetime.timezone.utc)
|
||||||
return agent.updated_at == updated_at
|
return agent.updated_at == updated_at
|
||||||
|
|
||||||
|
if not self.sb_api.is_table_present('Chassis_Private'):
|
||||||
|
self.skipTest('Ovn sb not support Chassis_Private')
|
||||||
timestamp = timeutils.utcnow_ts()
|
timestamp = timeutils.utcnow_ts()
|
||||||
nb_cfg_timestamp = timestamp * 1000
|
nb_cfg_timestamp = timestamp * 1000
|
||||||
self.sb_api.db_set('Chassis_Private', self.chassis_name, (
|
self.sb_api.db_set('Chassis_Private', self.chassis_name, (
|
||||||
@ -502,6 +504,9 @@ class TestAgentMonitor(base.TestOVNFunctionalBase):
|
|||||||
agent = neutron_agent.AgentCache()[self.chassis_name]
|
agent = neutron_agent.AgentCache()[self.chassis_name]
|
||||||
return agent.updated_at != 0
|
return agent.updated_at != 0
|
||||||
|
|
||||||
|
if not self.sb_api.is_table_present('Chassis_Private'):
|
||||||
|
self.skipTest('Ovn sb not support Chassis_Private')
|
||||||
|
|
||||||
# Set nb_cfg to some realistic value, so that the alive check can
|
# Set nb_cfg to some realistic value, so that the alive check can
|
||||||
# actually work
|
# actually work
|
||||||
self.nb_api.db_set(
|
self.nb_api.db_set(
|
||||||
|
@ -1179,10 +1179,14 @@ class TestAgentApi(base.TestOVNFunctionalBase):
|
|||||||
agent_id = self.agent_types[ovn_const.OVN_CONTROLLER_AGENT]
|
agent_id = self.agent_types[ovn_const.OVN_CONTROLLER_AGENT]
|
||||||
agent = self.plugin.get_agent(self.context, agent_id)
|
agent = self.plugin.get_agent(self.context, agent_id)
|
||||||
heartbeat_timestamp = agent['heartbeat_timestamp']
|
heartbeat_timestamp = agent['heartbeat_timestamp']
|
||||||
|
if self.sb_api.is_table_present('Chassis_Private'):
|
||||||
chassis_ts = self.sb_api.db_get(
|
chassis_ts = self.sb_api.db_get(
|
||||||
'Chassis_Private', self.chassis, 'nb_cfg_timestamp'
|
'Chassis_Private', self.chassis, 'nb_cfg_timestamp'
|
||||||
).execute(check_error=True)
|
).execute(check_error=True)
|
||||||
updated_at = datetime.datetime.fromtimestamp(int(chassis_ts / 1000))
|
updated_at = datetime.datetime.fromtimestamp(
|
||||||
|
int(chassis_ts / 1000))
|
||||||
|
# if table Chassis_Private present, agent.updated_at is
|
||||||
|
# Chassis_Private.nb_cfg_timestamp
|
||||||
self.assertEqual(updated_at, heartbeat_timestamp)
|
self.assertEqual(updated_at, heartbeat_timestamp)
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
# if chassis is not updated, agent's heartbeat_timestamp shouldn't
|
# if chassis is not updated, agent's heartbeat_timestamp shouldn't
|
||||||
|
@ -16,7 +16,6 @@ import datetime
|
|||||||
from unittest import mock
|
from unittest import mock
|
||||||
|
|
||||||
import eventlet
|
import eventlet
|
||||||
from oslo_utils import timeutils
|
|
||||||
|
|
||||||
from neutron.common.ovn import constants as ovn_const
|
from neutron.common.ovn import constants as ovn_const
|
||||||
from neutron.plugins.ml2.drivers.ovn.agent import neutron_agent
|
from neutron.plugins.ml2.drivers.ovn.agent import neutron_agent
|
||||||
@ -32,13 +31,8 @@ class AgentCacheTestCase(base.BaseTestCase):
|
|||||||
self.addCleanup(self._clean_agent_cache)
|
self.addCleanup(self._clean_agent_cache)
|
||||||
self.names_ref = []
|
self.names_ref = []
|
||||||
for i in range(10): # Add 10 agents.
|
for i in range(10): # Add 10 agents.
|
||||||
chassis = fakes.FakeOvsdbRow.create_one_ovsdb_row(
|
|
||||||
attrs={'other_config': {}})
|
|
||||||
chassis_private = fakes.FakeOvsdbRow.create_one_ovsdb_row(
|
chassis_private = fakes.FakeOvsdbRow.create_one_ovsdb_row(
|
||||||
attrs={'name': 'chassis' + str(i),
|
attrs={'name': 'chassis' + str(i), 'other_config': {}})
|
||||||
'other_config': {},
|
|
||||||
'chassis': [chassis],
|
|
||||||
'nb_cfg_timestamp': timeutils.utcnow_ts() * 1000})
|
|
||||||
self.agent_cache.update(ovn_const.OVN_CONTROLLER_AGENT,
|
self.agent_cache.update(ovn_const.OVN_CONTROLLER_AGENT,
|
||||||
chassis_private)
|
chassis_private)
|
||||||
self.names_ref.append('chassis' + str(i))
|
self.names_ref.append('chassis' + str(i))
|
||||||
@ -55,12 +49,8 @@ class AgentCacheTestCase(base.BaseTestCase):
|
|||||||
|
|
||||||
def _add_and_delete_agents(self):
|
def _add_and_delete_agents(self):
|
||||||
del self.agent_cache['chassis8']
|
del self.agent_cache['chassis8']
|
||||||
chassis = fakes.FakeOvsdbRow.create_one_ovsdb_row(
|
|
||||||
attrs={'other_config': {}})
|
|
||||||
chassis_private = fakes.FakeOvsdbRow.create_one_ovsdb_row(
|
chassis_private = fakes.FakeOvsdbRow.create_one_ovsdb_row(
|
||||||
attrs={'name': 'chassis10',
|
attrs={'name': 'chassis10'})
|
||||||
'chassis': [chassis],
|
|
||||||
'nb_cfg_timestamp': timeutils.utcnow_ts() * 1000})
|
|
||||||
self.agent_cache.update(ovn_const.OVN_CONTROLLER_AGENT,
|
self.agent_cache.update(ovn_const.OVN_CONTROLLER_AGENT,
|
||||||
chassis_private)
|
chassis_private)
|
||||||
|
|
||||||
|
@ -1,17 +1,14 @@
|
|||||||
{
|
{
|
||||||
"name": "OVN_Northbound",
|
"name": "OVN_Northbound",
|
||||||
"version": "6.3.0",
|
"version": "5.23.0",
|
||||||
"cksum": "4042813038 31869",
|
"cksum": "111023208 25806",
|
||||||
"tables": {
|
"tables": {
|
||||||
"NB_Global": {
|
"NB_Global": {
|
||||||
"columns": {
|
"columns": {
|
||||||
"name": {"type": "string"},
|
"name": {"type": "string"},
|
||||||
"nb_cfg": {"type": {"key": "integer"}},
|
"nb_cfg": {"type": {"key": "integer"}},
|
||||||
"nb_cfg_timestamp": {"type": {"key": "integer"}},
|
|
||||||
"sb_cfg": {"type": {"key": "integer"}},
|
"sb_cfg": {"type": {"key": "integer"}},
|
||||||
"sb_cfg_timestamp": {"type": {"key": "integer"}},
|
|
||||||
"hv_cfg": {"type": {"key": "integer"}},
|
"hv_cfg": {"type": {"key": "integer"}},
|
||||||
"hv_cfg_timestamp": {"type": {"key": "integer"}},
|
|
||||||
"external_ids": {
|
"external_ids": {
|
||||||
"type": {"key": "string", "value": "string",
|
"type": {"key": "string", "value": "string",
|
||||||
"min": 0, "max": "unlimited"}},
|
"min": 0, "max": "unlimited"}},
|
||||||
@ -30,19 +27,6 @@
|
|||||||
"ipsec": {"type": "boolean"}},
|
"ipsec": {"type": "boolean"}},
|
||||||
"maxRows": 1,
|
"maxRows": 1,
|
||||||
"isRoot": true},
|
"isRoot": true},
|
||||||
"Copp": {
|
|
||||||
"columns": {
|
|
||||||
"name": {"type": "string"},
|
|
||||||
"meters": {
|
|
||||||
"type": {"key": "string",
|
|
||||||
"value": "string",
|
|
||||||
"min": 0,
|
|
||||||
"max": "unlimited"}},
|
|
||||||
"external_ids": {
|
|
||||||
"type": {"key": "string", "value": "string",
|
|
||||||
"min": 0, "max": "unlimited"}}},
|
|
||||||
"indexes": [["name"]],
|
|
||||||
"isRoot": true},
|
|
||||||
"Logical_Switch": {
|
"Logical_Switch": {
|
||||||
"columns": {
|
"columns": {
|
||||||
"name": {"type": "string"},
|
"name": {"type": "string"},
|
||||||
@ -66,19 +50,11 @@
|
|||||||
"refType": "weak"},
|
"refType": "weak"},
|
||||||
"min": 0,
|
"min": 0,
|
||||||
"max": "unlimited"}},
|
"max": "unlimited"}},
|
||||||
"load_balancer_group": {
|
|
||||||
"type": {"key": {"type": "uuid",
|
|
||||||
"refTable": "Load_Balancer_Group"},
|
|
||||||
"min": 0,
|
|
||||||
"max": "unlimited"}},
|
|
||||||
"dns_records": {"type": {"key": {"type": "uuid",
|
"dns_records": {"type": {"key": {"type": "uuid",
|
||||||
"refTable": "DNS",
|
"refTable": "DNS",
|
||||||
"refType": "weak"},
|
"refType": "weak"},
|
||||||
"min": 0,
|
"min": 0,
|
||||||
"max": "unlimited"}},
|
"max": "unlimited"}},
|
||||||
"copp": {"type": {"key": {"type": "uuid", "refTable": "Copp",
|
|
||||||
"refType": "weak"},
|
|
||||||
"min": 0, "max": 1}},
|
|
||||||
"other_config": {
|
"other_config": {
|
||||||
"type": {"key": "string", "value": "string",
|
"type": {"key": "string", "value": "string",
|
||||||
"min": 0, "max": "unlimited"}},
|
"min": 0, "max": "unlimited"}},
|
||||||
@ -209,25 +185,10 @@
|
|||||||
["eth_src", "eth_dst", "ip_src", "ip_dst",
|
["eth_src", "eth_dst", "ip_src", "ip_dst",
|
||||||
"tp_src", "tp_dst"]]},
|
"tp_src", "tp_dst"]]},
|
||||||
"min": 0, "max": "unlimited"}},
|
"min": 0, "max": "unlimited"}},
|
||||||
"options": {
|
|
||||||
"type": {"key": "string",
|
|
||||||
"value": "string",
|
|
||||||
"min": 0,
|
|
||||||
"max": "unlimited"}},
|
|
||||||
"external_ids": {
|
"external_ids": {
|
||||||
"type": {"key": "string", "value": "string",
|
"type": {"key": "string", "value": "string",
|
||||||
"min": 0, "max": "unlimited"}}},
|
"min": 0, "max": "unlimited"}}},
|
||||||
"isRoot": true},
|
"isRoot": true},
|
||||||
"Load_Balancer_Group": {
|
|
||||||
"columns": {
|
|
||||||
"name": {"type": "string"},
|
|
||||||
"load_balancer": {"type": {"key": {"type": "uuid",
|
|
||||||
"refTable": "Load_Balancer",
|
|
||||||
"refType": "weak"},
|
|
||||||
"min": 0,
|
|
||||||
"max": "unlimited"}}},
|
|
||||||
"indexes": [["name"]],
|
|
||||||
"isRoot": true},
|
|
||||||
"Load_Balancer_Health_Check": {
|
"Load_Balancer_Health_Check": {
|
||||||
"columns": {
|
"columns": {
|
||||||
"vip": {"type": "string"},
|
"vip": {"type": "string"},
|
||||||
@ -252,10 +213,7 @@
|
|||||||
"enum": ["set", ["from-lport", "to-lport"]]}}},
|
"enum": ["set", ["from-lport", "to-lport"]]}}},
|
||||||
"match": {"type": "string"},
|
"match": {"type": "string"},
|
||||||
"action": {"type": {"key": {"type": "string",
|
"action": {"type": {"key": {"type": "string",
|
||||||
"enum": ["set",
|
"enum": ["set", ["allow", "allow-related", "drop", "reject"]]}}},
|
||||||
["allow", "allow-related",
|
|
||||||
"allow-stateless", "drop",
|
|
||||||
"reject"]]}}},
|
|
||||||
"log": {"type": "boolean"},
|
"log": {"type": "boolean"},
|
||||||
"severity": {"type": {"key": {"type": "string",
|
"severity": {"type": {"key": {"type": "string",
|
||||||
"enum": ["set",
|
"enum": ["set",
|
||||||
@ -264,14 +222,6 @@
|
|||||||
"debug"]]},
|
"debug"]]},
|
||||||
"min": 0, "max": 1}},
|
"min": 0, "max": 1}},
|
||||||
"meter": {"type": {"key": "string", "min": 0, "max": 1}},
|
"meter": {"type": {"key": "string", "min": 0, "max": 1}},
|
||||||
"label": {"type": {"key": {"type": "integer",
|
|
||||||
"minInteger": 0,
|
|
||||||
"maxInteger": 4294967295}}},
|
|
||||||
"options": {
|
|
||||||
"type": {"key": "string",
|
|
||||||
"value": "string",
|
|
||||||
"min": 0,
|
|
||||||
"max": "unlimited"}},
|
|
||||||
"external_ids": {
|
"external_ids": {
|
||||||
"type": {"key": "string", "value": "string",
|
"type": {"key": "string", "value": "string",
|
||||||
"min": 0, "max": "unlimited"}}},
|
"min": 0, "max": "unlimited"}}},
|
||||||
@ -311,7 +261,6 @@
|
|||||||
"refType": "strong"},
|
"refType": "strong"},
|
||||||
"min": 1,
|
"min": 1,
|
||||||
"max": "unlimited"}},
|
"max": "unlimited"}},
|
||||||
"fair": {"type": {"key": "boolean", "min": 0, "max": 1}},
|
|
||||||
"external_ids": {
|
"external_ids": {
|
||||||
"type": {"key": "string", "value": "string",
|
"type": {"key": "string", "value": "string",
|
||||||
"min": 0, "max": "unlimited"}}},
|
"min": 0, "max": "unlimited"}}},
|
||||||
@ -361,14 +310,6 @@
|
|||||||
"refType": "weak"},
|
"refType": "weak"},
|
||||||
"min": 0,
|
"min": 0,
|
||||||
"max": "unlimited"}},
|
"max": "unlimited"}},
|
||||||
"load_balancer_group": {
|
|
||||||
"type": {"key": {"type": "uuid",
|
|
||||||
"refTable": "Load_Balancer_Group"},
|
|
||||||
"min": 0,
|
|
||||||
"max": "unlimited"}},
|
|
||||||
"copp": {"type": {"key": {"type": "uuid", "refTable": "Copp",
|
|
||||||
"refType": "weak"},
|
|
||||||
"min": 0, "max": 1}},
|
|
||||||
"options": {
|
"options": {
|
||||||
"type": {"key": "string",
|
"type": {"key": "string",
|
||||||
"value": "string",
|
"value": "string",
|
||||||
@ -417,7 +358,6 @@
|
|||||||
"isRoot": false},
|
"isRoot": false},
|
||||||
"Logical_Router_Static_Route": {
|
"Logical_Router_Static_Route": {
|
||||||
"columns": {
|
"columns": {
|
||||||
"route_table": {"type": "string"},
|
|
||||||
"ip_prefix": {"type": "string"},
|
"ip_prefix": {"type": "string"},
|
||||||
"policy": {"type": {"key": {"type": "string",
|
"policy": {"type": {"key": {"type": "string",
|
||||||
"enum": ["set", ["src-ip",
|
"enum": ["set", ["src-ip",
|
||||||
@ -425,13 +365,6 @@
|
|||||||
"min": 0, "max": 1}},
|
"min": 0, "max": 1}},
|
||||||
"nexthop": {"type": "string"},
|
"nexthop": {"type": "string"},
|
||||||
"output_port": {"type": {"key": "string", "min": 0, "max": 1}},
|
"output_port": {"type": {"key": "string", "min": 0, "max": 1}},
|
||||||
"bfd": {"type": {"key": {"type": "uuid", "refTable": "BFD",
|
|
||||||
"refType": "weak"},
|
|
||||||
"min": 0,
|
|
||||||
"max": 1}},
|
|
||||||
"options": {
|
|
||||||
"type": {"key": "string", "value": "string",
|
|
||||||
"min": 0, "max": "unlimited"}},
|
|
||||||
"external_ids": {
|
"external_ids": {
|
||||||
"type": {"key": "string", "value": "string",
|
"type": {"key": "string", "value": "string",
|
||||||
"min": 0, "max": "unlimited"}}},
|
"min": 0, "max": "unlimited"}}},
|
||||||
@ -446,11 +379,6 @@
|
|||||||
"key": {"type": "string",
|
"key": {"type": "string",
|
||||||
"enum": ["set", ["allow", "drop", "reroute"]]}}},
|
"enum": ["set", ["allow", "drop", "reroute"]]}}},
|
||||||
"nexthop": {"type": {"key": "string", "min": 0, "max": 1}},
|
"nexthop": {"type": {"key": "string", "min": 0, "max": 1}},
|
||||||
"nexthops": {"type": {
|
|
||||||
"key": "string", "min": 0, "max": "unlimited"}},
|
|
||||||
"options": {
|
|
||||||
"type": {"key": "string", "value": "string",
|
|
||||||
"min": 0, "max": "unlimited"}},
|
|
||||||
"external_ids": {
|
"external_ids": {
|
||||||
"type": {"key": "string", "value": "string",
|
"type": {"key": "string", "value": "string",
|
||||||
"min": 0, "max": "unlimited"}}},
|
"min": 0, "max": "unlimited"}}},
|
||||||
@ -469,22 +397,6 @@
|
|||||||
"snat",
|
"snat",
|
||||||
"dnat_and_snat"
|
"dnat_and_snat"
|
||||||
]]}}},
|
]]}}},
|
||||||
"allowed_ext_ips": {"type": {
|
|
||||||
"key": {"type": "uuid", "refTable": "Address_Set",
|
|
||||||
"refType": "strong"},
|
|
||||||
"min": 0,
|
|
||||||
"max": 1}},
|
|
||||||
"exempted_ext_ips": {"type": {
|
|
||||||
"key": {"type": "uuid", "refTable": "Address_Set",
|
|
||||||
"refType": "strong"},
|
|
||||||
"min": 0,
|
|
||||||
"max": 1}},
|
|
||||||
"gateway_port": {
|
|
||||||
"type": {"key": {"type": "uuid",
|
|
||||||
"refTable": "Logical_Router_Port",
|
|
||||||
"refType": "weak"},
|
|
||||||
"min": 0,
|
|
||||||
"max": 1}},
|
|
||||||
"options": {"type": {"key": "string", "value": "string",
|
"options": {"type": {"key": "string", "value": "string",
|
||||||
"min": 0, "max": "unlimited"}},
|
"min": 0, "max": "unlimited"}},
|
||||||
"external_ids": {
|
"external_ids": {
|
||||||
@ -587,39 +499,5 @@
|
|||||||
"type": {"key": "string", "value": "string",
|
"type": {"key": "string", "value": "string",
|
||||||
"min": 0, "max": "unlimited"}}},
|
"min": 0, "max": "unlimited"}}},
|
||||||
"indexes": [["name"]],
|
"indexes": [["name"]],
|
||||||
"isRoot": true},
|
"isRoot": true}}
|
||||||
"BFD": {
|
|
||||||
"columns": {
|
|
||||||
"logical_port": {"type": "string"},
|
|
||||||
"dst_ip": {"type": "string"},
|
|
||||||
"min_tx": {"type": {"key": {"type": "integer",
|
|
||||||
"minInteger": 1},
|
|
||||||
"min": 0, "max": 1}},
|
|
||||||
"min_rx": {"type": {"key": {"type": "integer"},
|
|
||||||
"min": 0, "max": 1}},
|
|
||||||
"detect_mult": {"type": {"key": {"type": "integer",
|
|
||||||
"minInteger": 1},
|
|
||||||
"min": 0, "max": 1}},
|
|
||||||
"status": {
|
|
||||||
"type": {"key": {"type": "string",
|
|
||||||
"enum": ["set", ["down", "init", "up",
|
|
||||||
"admin_down"]]},
|
|
||||||
"min": 0, "max": 1}},
|
|
||||||
"external_ids": {
|
|
||||||
"type": {"key": "string", "value": "string",
|
|
||||||
"min": 0, "max": "unlimited"}},
|
|
||||||
"options": {
|
|
||||||
"type": {"key": "string", "value": "string",
|
|
||||||
"min": 0, "max": "unlimited"}}},
|
|
||||||
"indexes": [["logical_port", "dst_ip"]],
|
|
||||||
"isRoot": true},
|
|
||||||
"Static_MAC_Binding": {
|
|
||||||
"columns": {
|
|
||||||
"logical_port": {"type": "string"},
|
|
||||||
"ip": {"type": "string"},
|
|
||||||
"mac": {"type": "string"},
|
|
||||||
"override_dynamic_mac": {"type": "boolean"}},
|
|
||||||
"indexes": [["logical_port", "ip"]],
|
|
||||||
"isRoot": true}
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "OVN_Southbound",
|
"name": "OVN_Southbound",
|
||||||
"version": "20.25.0",
|
"version": "2.7.0",
|
||||||
"cksum": "53184112 28845",
|
"cksum": "4286723485 21693",
|
||||||
"tables": {
|
"tables": {
|
||||||
"SB_Global": {
|
"SB_Global": {
|
||||||
"columns": {
|
"columns": {
|
||||||
@ -38,28 +38,11 @@
|
|||||||
"external_ids": {
|
"external_ids": {
|
||||||
"type": {"key": "string", "value": "string",
|
"type": {"key": "string", "value": "string",
|
||||||
"min": 0, "max": "unlimited"}},
|
"min": 0, "max": "unlimited"}},
|
||||||
"other_config": {
|
|
||||||
"type": {"key": "string", "value": "string",
|
|
||||||
"min": 0, "max": "unlimited"}},
|
|
||||||
"transport_zones" : {"type": {"key": "string",
|
"transport_zones" : {"type": {"key": "string",
|
||||||
"min": 0,
|
"min": 0,
|
||||||
"max": "unlimited"}}},
|
"max": "unlimited"}}},
|
||||||
"isRoot": true,
|
"isRoot": true,
|
||||||
"indexes": [["name"]]},
|
"indexes": [["name"]]},
|
||||||
"Chassis_Private": {
|
|
||||||
"columns": {
|
|
||||||
"name": {"type": "string"},
|
|
||||||
"chassis": {"type": {"key": {"type": "uuid",
|
|
||||||
"refTable": "Chassis",
|
|
||||||
"refType": "weak"},
|
|
||||||
"min": 0, "max": 1}},
|
|
||||||
"nb_cfg": {"type": {"key": "integer"}},
|
|
||||||
"nb_cfg_timestamp": {"type": {"key": "integer"}},
|
|
||||||
"external_ids": {
|
|
||||||
"type": {"key": "string", "value": "string",
|
|
||||||
"min": 0, "max": "unlimited"}}},
|
|
||||||
"isRoot": true,
|
|
||||||
"indexes": [["name"]]},
|
|
||||||
"Encap": {
|
"Encap": {
|
||||||
"columns": {
|
"columns": {
|
||||||
"type": {"type": {"key": {
|
"type": {"type": {"key": {
|
||||||
@ -90,42 +73,23 @@
|
|||||||
"isRoot": true},
|
"isRoot": true},
|
||||||
"Logical_Flow": {
|
"Logical_Flow": {
|
||||||
"columns": {
|
"columns": {
|
||||||
"logical_datapath":
|
"logical_datapath": {"type": {"key": {"type": "uuid",
|
||||||
{"type": {"key": {"type": "uuid",
|
"refTable": "Datapath_Binding"}}},
|
||||||
"refTable": "Datapath_Binding"},
|
|
||||||
"min": 0, "max": 1}},
|
|
||||||
"logical_dp_group":
|
|
||||||
{"type": {"key": {"type": "uuid",
|
|
||||||
"refTable": "Logical_DP_Group"},
|
|
||||||
"min": 0, "max": 1}},
|
|
||||||
"pipeline": {"type": {"key": {"type": "string",
|
"pipeline": {"type": {"key": {"type": "string",
|
||||||
"enum": ["set", ["ingress",
|
"enum": ["set", ["ingress",
|
||||||
"egress"]]}}},
|
"egress"]]}}},
|
||||||
"table_id": {"type": {"key": {"type": "integer",
|
"table_id": {"type": {"key": {"type": "integer",
|
||||||
"minInteger": 0,
|
"minInteger": 0,
|
||||||
"maxInteger": 32}}},
|
"maxInteger": 23}}},
|
||||||
"priority": {"type": {"key": {"type": "integer",
|
"priority": {"type": {"key": {"type": "integer",
|
||||||
"minInteger": 0,
|
"minInteger": 0,
|
||||||
"maxInteger": 65535}}},
|
"maxInteger": 65535}}},
|
||||||
"match": {"type": "string"},
|
"match": {"type": "string"},
|
||||||
"actions": {"type": "string"},
|
"actions": {"type": "string"},
|
||||||
"tags": {
|
|
||||||
"type": {"key": "string", "value": "string",
|
|
||||||
"min": 0, "max": "unlimited"}},
|
|
||||||
"controller_meter": {"type": {"key": {"type": "string"},
|
|
||||||
"min": 0, "max": 1}},
|
|
||||||
"external_ids": {
|
"external_ids": {
|
||||||
"type": {"key": "string", "value": "string",
|
"type": {"key": "string", "value": "string",
|
||||||
"min": 0, "max": "unlimited"}}},
|
"min": 0, "max": "unlimited"}}},
|
||||||
"isRoot": true},
|
"isRoot": true},
|
||||||
"Logical_DP_Group": {
|
|
||||||
"columns": {
|
|
||||||
"datapaths":
|
|
||||||
{"type": {"key": {"type": "uuid",
|
|
||||||
"refTable": "Datapath_Binding",
|
|
||||||
"refType": "weak"},
|
|
||||||
"min": 0, "max": "unlimited"}}},
|
|
||||||
"isRoot": false},
|
|
||||||
"Multicast_Group": {
|
"Multicast_Group": {
|
||||||
"columns": {
|
"columns": {
|
||||||
"datapath": {"type": {"key": {"type": "uuid",
|
"datapath": {"type": {"key": {"type": "uuid",
|
||||||
@ -138,7 +102,7 @@
|
|||||||
"ports": {"type": {"key": {"type": "uuid",
|
"ports": {"type": {"key": {"type": "uuid",
|
||||||
"refTable": "Port_Binding",
|
"refTable": "Port_Binding",
|
||||||
"refType": "weak"},
|
"refType": "weak"},
|
||||||
"min": 0, "max": "unlimited"}}},
|
"min": 1, "max": "unlimited"}}},
|
||||||
"indexes": [["datapath", "tunnel_key"],
|
"indexes": [["datapath", "tunnel_key"],
|
||||||
["datapath", "name"]],
|
["datapath", "name"]],
|
||||||
"isRoot": true},
|
"isRoot": true},
|
||||||
@ -171,9 +135,6 @@
|
|||||||
"type": {"key": {"type": "integer",
|
"type": {"key": {"type": "integer",
|
||||||
"minInteger": 1,
|
"minInteger": 1,
|
||||||
"maxInteger": 16777215}}},
|
"maxInteger": 16777215}}},
|
||||||
"load_balancers": {"type": {"key": {"type": "uuid"},
|
|
||||||
"min": 0,
|
|
||||||
"max": "unlimited"}},
|
|
||||||
"external_ids": {
|
"external_ids": {
|
||||||
"type": {"key": "string", "value": "string",
|
"type": {"key": "string", "value": "string",
|
||||||
"min": 0, "max": "unlimited"}}},
|
"min": 0, "max": "unlimited"}}},
|
||||||
@ -218,41 +179,20 @@
|
|||||||
"refTable": "Chassis",
|
"refTable": "Chassis",
|
||||||
"refType": "weak"},
|
"refType": "weak"},
|
||||||
"min": 0, "max": 1}},
|
"min": 0, "max": 1}},
|
||||||
"additional_chassis": {"type": {"key": {"type": "uuid",
|
|
||||||
"refTable": "Chassis",
|
|
||||||
"refType": "weak"},
|
|
||||||
"min": 0, "max": "unlimited"}},
|
|
||||||
"encap": {"type": {"key": {"type": "uuid",
|
"encap": {"type": {"key": {"type": "uuid",
|
||||||
"refTable": "Encap",
|
"refTable": "Encap",
|
||||||
"refType": "weak"},
|
"refType": "weak"},
|
||||||
"min": 0, "max": 1}},
|
"min": 0, "max": 1}},
|
||||||
"additional_encap": {"type": {"key": {"type": "uuid",
|
|
||||||
"refTable": "Encap",
|
|
||||||
"refType": "weak"},
|
|
||||||
"min": 0, "max": "unlimited"}},
|
|
||||||
"mac": {"type": {"key": "string",
|
"mac": {"type": {"key": "string",
|
||||||
"min": 0,
|
"min": 0,
|
||||||
"max": "unlimited"}},
|
"max": "unlimited"}},
|
||||||
"port_security": {"type": {"key": "string",
|
|
||||||
"min": 0,
|
|
||||||
"max": "unlimited"}},
|
|
||||||
"nat_addresses": {"type": {"key": "string",
|
"nat_addresses": {"type": {"key": "string",
|
||||||
"min": 0,
|
"min": 0,
|
||||||
"max": "unlimited"}},
|
"max": "unlimited"}},
|
||||||
"up": {"type": {"key": "boolean", "min": 0, "max": 1}},
|
|
||||||
"external_ids": {"type": {"key": "string",
|
"external_ids": {"type": {"key": "string",
|
||||||
"value": "string",
|
"value": "string",
|
||||||
"min": 0,
|
"min": 0,
|
||||||
"max": "unlimited"}},
|
"max": "unlimited"}}},
|
||||||
"requested_chassis": {"type": {"key": {"type": "uuid",
|
|
||||||
"refTable": "Chassis",
|
|
||||||
"refType": "weak"},
|
|
||||||
"min": 0, "max": 1}},
|
|
||||||
"requested_additional_chassis": {
|
|
||||||
"type": {"key": {"type": "uuid",
|
|
||||||
"refTable": "Chassis",
|
|
||||||
"refType": "weak"},
|
|
||||||
"min": 0, "max": "unlimited"}}},
|
|
||||||
"indexes": [["datapath", "tunnel_key"], ["logical_port"]],
|
"indexes": [["datapath", "tunnel_key"], ["logical_port"]],
|
||||||
"isRoot": true},
|
"isRoot": true},
|
||||||
"MAC_Binding": {
|
"MAC_Binding": {
|
||||||
@ -260,7 +200,6 @@
|
|||||||
"logical_port": {"type": "string"},
|
"logical_port": {"type": "string"},
|
||||||
"ip": {"type": "string"},
|
"ip": {"type": "string"},
|
||||||
"mac": {"type": "string"},
|
"mac": {"type": "string"},
|
||||||
"timestamp": {"type": {"key": "integer"}},
|
|
||||||
"datapath": {"type": {"key": {"type": "uuid",
|
"datapath": {"type": {"key": {"type": "uuid",
|
||||||
"refTable": "Datapath_Binding"}}}},
|
"refTable": "Datapath_Binding"}}}},
|
||||||
"indexes": [["logical_port", "ip"]],
|
"indexes": [["logical_port", "ip"]],
|
||||||
@ -275,8 +214,7 @@
|
|||||||
"type": {"key": {
|
"type": {"key": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"enum": ["set", ["bool", "uint8", "uint16", "uint32",
|
"enum": ["set", ["bool", "uint8", "uint16", "uint32",
|
||||||
"ipv4", "static_routes", "str",
|
"ipv4", "static_routes", "str"]]}}}},
|
||||||
"host_id", "domains"]]}}}},
|
|
||||||
"isRoot": true},
|
"isRoot": true},
|
||||||
"DHCPv6_Options": {
|
"DHCPv6_Options": {
|
||||||
"columns": {
|
"columns": {
|
||||||
@ -476,7 +414,7 @@
|
|||||||
"min": 0, "max": 1}},
|
"min": 0, "max": 1}},
|
||||||
"port": {"type": {"key": {"type": "integer",
|
"port": {"type": {"key": {"type": "integer",
|
||||||
"minInteger": 0,
|
"minInteger": 0,
|
||||||
"maxInteger": 65535}}},
|
"maxInteger": 32767}}},
|
||||||
"logical_port": {"type": "string"},
|
"logical_port": {"type": "string"},
|
||||||
"src_mac": {"type": "string"},
|
"src_mac": {"type": "string"},
|
||||||
"src_ip": {"type": "string"},
|
"src_ip": {"type": "string"},
|
||||||
@ -491,80 +429,6 @@
|
|||||||
"type": {"key": "string", "value": "string",
|
"type": {"key": "string", "value": "string",
|
||||||
"min": 0, "max": "unlimited"}}},
|
"min": 0, "max": "unlimited"}}},
|
||||||
"indexes": [["logical_port", "ip", "port", "protocol"]],
|
"indexes": [["logical_port", "ip", "port", "protocol"]],
|
||||||
"isRoot": true},
|
|
||||||
"Load_Balancer": {
|
|
||||||
"columns": {
|
|
||||||
"name": {"type": "string"},
|
|
||||||
"vips": {
|
|
||||||
"type": {"key": "string", "value": "string",
|
|
||||||
"min": 0, "max": "unlimited"}},
|
|
||||||
"protocol": {
|
|
||||||
"type": {"key": {"type": "string",
|
|
||||||
"enum": ["set", ["tcp", "udp", "sctp"]]},
|
|
||||||
"min": 0, "max": 1}},
|
|
||||||
"datapaths": {
|
|
||||||
"type": {"key": {"type": "uuid",
|
|
||||||
"refTable": "Datapath_Binding"},
|
|
||||||
"min": 0, "max": "unlimited"}},
|
|
||||||
"datapath_group":
|
|
||||||
{"type": {"key": {"type": "uuid",
|
|
||||||
"refTable": "Logical_DP_Group"},
|
|
||||||
"min": 0, "max": 1}},
|
|
||||||
"options": {
|
|
||||||
"type": {"key": "string",
|
|
||||||
"value": "string",
|
|
||||||
"min": 0,
|
|
||||||
"max": "unlimited"}},
|
|
||||||
"external_ids": {
|
|
||||||
"type": {"key": "string", "value": "string",
|
|
||||||
"min": 0, "max": "unlimited"}}},
|
|
||||||
"isRoot": true},
|
|
||||||
"BFD": {
|
|
||||||
"columns": {
|
|
||||||
"src_port": {"type": {"key": {"type": "integer",
|
|
||||||
"minInteger": 49152,
|
|
||||||
"maxInteger": 65535}}},
|
|
||||||
"disc": {"type": {"key": {"type": "integer"}}},
|
|
||||||
"logical_port": {"type": "string"},
|
|
||||||
"dst_ip": {"type": "string"},
|
|
||||||
"min_tx": {"type": {"key": {"type": "integer"}}},
|
|
||||||
"min_rx": {"type": {"key": {"type": "integer"}}},
|
|
||||||
"detect_mult": {"type": {"key": {"type": "integer"}}},
|
|
||||||
"status": {
|
|
||||||
"type": {"key": {"type": "string",
|
|
||||||
"enum": ["set", ["down", "init", "up",
|
|
||||||
"admin_down"]]}}},
|
|
||||||
"external_ids": {
|
|
||||||
"type": {"key": "string", "value": "string",
|
|
||||||
"min": 0, "max": "unlimited"}},
|
|
||||||
"options": {
|
|
||||||
"type": {"key": "string", "value": "string",
|
|
||||||
"min": 0, "max": "unlimited"}}},
|
|
||||||
"indexes": [["logical_port", "dst_ip", "src_port", "disc"]],
|
|
||||||
"isRoot": true},
|
|
||||||
"FDB": {
|
|
||||||
"columns": {
|
|
||||||
"mac": {"type": "string"},
|
|
||||||
"dp_key": {
|
|
||||||
"type": {"key": {"type": "integer",
|
|
||||||
"minInteger": 1,
|
|
||||||
"maxInteger": 16777215}}},
|
|
||||||
"port_key": {
|
|
||||||
"type": {"key": {"type": "integer",
|
|
||||||
"minInteger": 1,
|
|
||||||
"maxInteger": 16777215}}}},
|
|
||||||
"indexes": [["mac", "dp_key"]],
|
|
||||||
"isRoot": true},
|
|
||||||
"Static_MAC_Binding": {
|
|
||||||
"columns": {
|
|
||||||
"logical_port": {"type": "string"},
|
|
||||||
"ip": {"type": "string"},
|
|
||||||
"mac": {"type": "string"},
|
|
||||||
"override_dynamic_mac": {"type": "boolean"},
|
|
||||||
"datapath": {"type": {
|
|
||||||
"key": {"type": "uuid",
|
|
||||||
"refTable": "Datapath_Binding"}}}},
|
|
||||||
"indexes": [["logical_port", "ip"]],
|
|
||||||
"isRoot": true}
|
"isRoot": true}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -302,20 +302,45 @@ class TestOvnIdlDistributedLock(base.BaseTestCase):
|
|||||||
|
|
||||||
self.assertFalse(self.mock_update_tables.called)
|
self.assertFalse(self.mock_update_tables.called)
|
||||||
|
|
||||||
def _test_handle_db_schema(self, agent_table):
|
def _test_handle_db_schema(self, agent_table, chassis_private_present):
|
||||||
database_table_row = self._create_fake_row('Database')
|
database_table_row = self._create_fake_row('Database')
|
||||||
self.idl._tables_to_register[database_table_row.name] = 'foo'
|
self.idl._tables_to_register[database_table_row.name] = 'foo'
|
||||||
|
|
||||||
self.fake_driver.agent_chassis_table = agent_table
|
self.fake_driver.agent_chassis_table = agent_table
|
||||||
|
if chassis_private_present:
|
||||||
self.idl.tables['Chassis_Private'] = 'foo'
|
self.idl.tables['Chassis_Private'] = 'foo'
|
||||||
|
else:
|
||||||
|
try:
|
||||||
|
del self.idl.tables['Chassis_Private']
|
||||||
|
except KeyError:
|
||||||
|
pass
|
||||||
|
|
||||||
self.idl.handle_db_schema_changes(
|
self.idl.handle_db_schema_changes(
|
||||||
ovsdb_monitor.BaseEvent.ROW_CREATE, database_table_row)
|
ovsdb_monitor.BaseEvent.ROW_CREATE, database_table_row)
|
||||||
|
|
||||||
|
def test_handle_db_schema_changes_old_schema_to_old_schema(self):
|
||||||
|
"""Agents use Chassis and should keep using Chassis table"""
|
||||||
|
self._test_handle_db_schema('Chassis', chassis_private_present=False)
|
||||||
|
self.assertEqual('Chassis', self.fake_driver.agent_chassis_table)
|
||||||
|
|
||||||
|
def test_handle_db_schema_changes_old_schema_to_new_schema(self):
|
||||||
|
"""Agents use Chassis and should start using Chassis_Private table"""
|
||||||
|
self._test_handle_db_schema('Chassis', chassis_private_present=True)
|
||||||
|
self.assertEqual('Chassis_Private',
|
||||||
|
self.fake_driver.agent_chassis_table)
|
||||||
|
|
||||||
|
def test_handle_db_schema_changes_new_schema_to_old_schema(self):
|
||||||
|
"""Agents use Chassis_Private and should start using Chassis table"""
|
||||||
|
self._test_handle_db_schema('Chassis_Private',
|
||||||
|
chassis_private_present=False)
|
||||||
|
self.assertEqual('Chassis', self.fake_driver.agent_chassis_table)
|
||||||
|
|
||||||
def test_handle_db_schema_changes_new_schema_to_new_schema(self):
|
def test_handle_db_schema_changes_new_schema_to_new_schema(self):
|
||||||
"""Agents use Chassis_Private and should keep using Chassis_Private
|
"""Agents use Chassis_Private and should keep using Chassis_Private
|
||||||
table.
|
table.
|
||||||
"""
|
"""
|
||||||
self._test_handle_db_schema('Chassis_Private')
|
self._test_handle_db_schema('Chassis_Private',
|
||||||
|
chassis_private_present=True)
|
||||||
self.assertEqual('Chassis_Private',
|
self.assertEqual('Chassis_Private',
|
||||||
self.fake_driver.agent_chassis_table)
|
self.fake_driver.agent_chassis_table)
|
||||||
|
|
||||||
|
@ -105,7 +105,6 @@ class MechDriverSetupBase(abc.ABC):
|
|||||||
chassis_private.nb_cfg = nb_cfg
|
chassis_private.nb_cfg = nb_cfg
|
||||||
chassis_private.uuid = uuid.uuid4()
|
chassis_private.uuid = uuid.uuid4()
|
||||||
chassis_private.name = name if name else str(uuid.uuid4())
|
chassis_private.name = name if name else str(uuid.uuid4())
|
||||||
chassis_private.nb_cfg_timestamp = timeutils.utcnow_ts() * 1000
|
|
||||||
return chassis_private
|
return chassis_private
|
||||||
|
|
||||||
def _add_chassis_agent(self, nb_cfg, agent_type, chassis_private=None):
|
def _add_chassis_agent(self, nb_cfg, agent_type, chassis_private=None):
|
||||||
|
@ -1,5 +0,0 @@
|
|||||||
---
|
|
||||||
features:
|
|
||||||
- |
|
|
||||||
Removed support for OVN versions under 20.09. The "Chassis_Private" OVN
|
|
||||||
Southbound table is expected in the database definition.
|
|
Loading…
Reference in New Issue
Block a user