diff --git a/vmware_nsx/common/config.py b/vmware_nsx/common/config.py index c0ff316ef6..ae0fb2fb1c 100644 --- a/vmware_nsx/common/config.py +++ b/vmware_nsx/common/config.py @@ -25,6 +25,8 @@ from vmware_nsx.dvs import dvs_utils from vmware_nsx.extensions import routersize LOG = logging.getLogger(__name__) +DEFAULT_VDR_TRANSIT_NETWORK = "169.254.2.0/28" +DEFAULT_PLR_ADDRESS = "169.254.2.3" class AgentModes(object): @@ -636,7 +638,7 @@ nsxv_opts = [ help=_("(Optional) If use_nsx_policies is True, this value " "will determine if a tenants can add rules to their " "security groups.")), - cfg.StrOpt('vdr_transit_network', default="169.254.2.0/28", + cfg.StrOpt('vdr_transit_network', default=DEFAULT_VDR_TRANSIT_NETWORK, help=_("(Optional) Sets the network address for distributed " "router TLR-PLR connectivity, with " "/ syntax")), diff --git a/vmware_nsx/plugins/nsx_v/vshield/common/constants.py b/vmware_nsx/plugins/nsx_v/vshield/common/constants.py index faf2927c73..eca7d9a8f9 100644 --- a/vmware_nsx/plugins/nsx_v/vshield/common/constants.py +++ b/vmware_nsx/plugins/nsx_v/vshield/common/constants.py @@ -17,7 +17,6 @@ from oslo_config import cfg from vmware_nsx.common import nsxv_constants - EDGE_ID = 'edge_id' ROUTER_ID = 'router_id' DHCP_EDGE_PREFIX = 'dhcp-' diff --git a/vmware_nsx/plugins/nsx_v/vshield/edge_utils.py b/vmware_nsx/plugins/nsx_v/vshield/edge_utils.py index 399be10bcc..f7a6a438dd 100644 --- a/vmware_nsx/plugins/nsx_v/vshield/edge_utils.py +++ b/vmware_nsx/plugins/nsx_v/vshield/edge_utils.py @@ -38,6 +38,7 @@ from neutron_lib.api import validators from neutron_lib import exceptions as n_exc from vmware_nsx._i18n import _, _LE, _LW +from vmware_nsx.common import config as conf from vmware_nsx.common import exceptions as nsx_exc from vmware_nsx.common import locking from vmware_nsx.common import nsxv_constants @@ -80,7 +81,12 @@ def get_vdr_transit_network_tlr_address(): def get_vdr_transit_network_plr_address(): ip = _get_vdr_transit_network_ipobj() - return str(ip[2]) + # We need to ensure backwards compatibility. The original edge address + # was "169.254.2.3" + if conf.DEFAULT_VDR_TRANSIT_NETWORK == cfg.CONF.nsxv.vdr_transit_network: + return conf.DEFAULT_PLR_ADDRESS + else: + return str(ip[2]) def validate_vdr_transit_network(): diff --git a/vmware_nsx/tests/unit/nsx_v/vshield/test_edge_utils.py b/vmware_nsx/tests/unit/nsx_v/vshield/test_edge_utils.py index 27c9106817..4982d7e9f4 100644 --- a/vmware_nsx/tests/unit/nsx_v/vshield/test_edge_utils.py +++ b/vmware_nsx/tests/unit/nsx_v/vshield/test_edge_utils.py @@ -22,6 +22,7 @@ from neutron import context from neutron.plugins.common import constants as plugin_const from neutron.tests.unit import testlib_api from neutron_lib import exceptions as n_exc +from vmware_nsx.common import config as conf from vmware_nsx.common import exceptions as nsx_exc from vmware_nsx.common import nsxv_constants from vmware_nsx.db import nsxv_db @@ -778,7 +779,7 @@ class EdgeManagerTestCase(EdgeUtilsTestCaseMixin): class VdrTransitNetUtilDefaultTestCase(EdgeUtilsTestCaseMixin): EXPECTED_NETMASK = '255.255.255.240' EXPECTED_TLR_IP = '169.254.2.1' - EXPECTED_PLR_IP = '169.254.2.2' + EXPECTED_PLR_IP = conf.DEFAULT_PLR_ADDRESS def setUp(self): super(VdrTransitNetUtilDefaultTestCase, self).setUp()