NSX|P: Create/delete tier1 locale-service upon router create/delete
The NSX backend needs each logical router to have a locale-service entry, which should also be deleted before the router is deleted. Change-Id: If64c1b67c19906105b07c6facedf5d07ac36176d
This commit is contained in:
parent
db82bd3c14
commit
5b591457c0
@ -174,7 +174,7 @@ class NSXClient(object):
|
|||||||
# remove all nat rules from this router before deletion
|
# remove all nat rules from this router before deletion
|
||||||
self.cleanup_tier1_nat_rules(rtr['id'])
|
self.cleanup_tier1_nat_rules(rtr['id'])
|
||||||
try:
|
try:
|
||||||
self.nsxpolicy.tier1.remove_edge_cluster(rtr['id'])
|
self.nsxpolicy.tier1.delete_locale_service(rtr['id'])
|
||||||
except exceptions.ManagerError as e:
|
except exceptions.ManagerError as e:
|
||||||
# Not always exists
|
# Not always exists
|
||||||
pass
|
pass
|
||||||
|
@ -1643,6 +1643,9 @@ class NsxPolicyPlugin(nsx_plugin_common.NsxPluginV3Base):
|
|||||||
router_name, router['id'],
|
router_name, router['id'],
|
||||||
tier0=None,
|
tier0=None,
|
||||||
tags=tags)
|
tags=tags)
|
||||||
|
# Also create the empty locale-service as it must always exist
|
||||||
|
self.nsxpolicy.tier1.create_locale_service(router['id'])
|
||||||
|
|
||||||
#TODO(annak): narrow down the exception
|
#TODO(annak): narrow down the exception
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
with excutils.save_and_reraise_exception():
|
with excutils.save_and_reraise_exception():
|
||||||
@ -1675,6 +1678,7 @@ class NsxPolicyPlugin(nsx_plugin_common.NsxPluginV3Base):
|
|||||||
context, router_id)
|
context, router_id)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
self.nsxpolicy.tier1.delete_locale_service(router_id)
|
||||||
self.nsxpolicy.tier1.delete(router_id)
|
self.nsxpolicy.tier1.delete(router_id)
|
||||||
except nsx_lib_exc.ResourceNotFound:
|
except nsx_lib_exc.ResourceNotFound:
|
||||||
# If the resource was not found on the backend do not worry about
|
# If the resource was not found on the backend do not worry about
|
||||||
|
Loading…
x
Reference in New Issue
Block a user