NSX|V: ensure backwards compatibility for vdr_transit_network
We need to make sure that we select the correct gateway address after an upgrade. Change-Id: I06283bd1994467202349bd537e9522fd2fa0c690
This commit is contained in:
parent
ca33b1bfcf
commit
a15b232ddf
@ -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 "
|
||||
"<network IP>/<prefix> syntax")),
|
||||
|
@ -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-'
|
||||
|
@ -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,6 +81,11 @@ def get_vdr_transit_network_tlr_address():
|
||||
|
||||
def get_vdr_transit_network_plr_address():
|
||||
ip = _get_vdr_transit_network_ipobj()
|
||||
# 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])
|
||||
|
||||
|
||||
|
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user