NSXV: validate metadata config for AZs
When an AZ is configured with a non-default DVS id, it must have a metadata configuration as well. The minimum required is the metadata edge IPs. Change-Id: Iebbbf6e73975c67876a925a4d54a6a263c4da10f
This commit is contained in:
parent
dc308d59d8
commit
8031a85420
@ -175,6 +175,14 @@ class NsxVAvailabilityZone(common_az.ConfiguredAvailabilityZone):
|
||||
self.mgt_net_default_gateway = (
|
||||
cfg.CONF.nsxv.mgt_net_default_gateway)
|
||||
|
||||
elif (az_info.get('dvs_id') and
|
||||
az_info['dvs_id'] != cfg.CONF.nsxv.dvs_id):
|
||||
raise nsx_exc.NsxInvalidConfiguration(
|
||||
opt_name="mgt_net_proxy_ips",
|
||||
opt_value='None',
|
||||
reason=(_("mgt_net_proxy_ips for availability zone "
|
||||
"%s must specified when DVS id is non-default") %
|
||||
az_name))
|
||||
else:
|
||||
self.az_metadata_support = False
|
||||
self.mgt_net_moid = None
|
||||
|
@ -185,7 +185,7 @@ class NsxvAvailabilityZonesTestCase(base.BaseTestCase):
|
||||
self.assertEqual(DEF_GLOBAL_POOL, az.backup_edge_pool)
|
||||
|
||||
def test_availability_zone_missing_metadata(self):
|
||||
self._config_az(mgt_net_proxy_ips=None)
|
||||
self._config_az(mgt_net_proxy_ips=None, dvs_id=None)
|
||||
az = nsx_az.NsxVAvailabilityZone(self.az_name)
|
||||
self.assertIsNone(az.mgt_net_moid)
|
||||
self.assertEqual([], az.mgt_net_proxy_ips)
|
||||
|
Loading…
x
Reference in New Issue
Block a user