diff --git a/vmware_nsxlib/tests/unit/v3/test_resources.py b/vmware_nsxlib/tests/unit/v3/test_resources.py index f6311e0d..d1c8fbe3 100644 --- a/vmware_nsxlib/tests/unit/v3/test_resources.py +++ b/vmware_nsxlib/tests/unit/v3/test_resources.py @@ -845,6 +845,7 @@ class LogicalRouterTestCase(BaseTestResource): tier0_router = True description = 'dummy' tz_id = 'tz_id' + failover_mode = 'PREEMPTIVE' allocation_pool = { 'allocation_pool_type': 'LoadBalancerAllocationPool', 'allocation_size': 'SMALL' @@ -854,7 +855,8 @@ class LogicalRouterTestCase(BaseTestResource): router.create(fake_router['display_name'], None, None, tier0_router, description=description, transport_zone_id=tz_id, - allocation_pool=allocation_pool) + allocation_pool=allocation_pool, + failover_mode=failover_mode) data = { 'display_name': fake_router['display_name'], @@ -862,6 +864,7 @@ class LogicalRouterTestCase(BaseTestResource): 'tags': None, 'description': description, 'advanced_config': {'transport_zone_id': tz_id}, + 'failover_mode': failover_mode, 'allocation_profile': { 'allocation_pool': allocation_pool } diff --git a/vmware_nsxlib/v3/core_resources.py b/vmware_nsxlib/v3/core_resources.py index d03f9e3f..4a53915a 100644 --- a/vmware_nsxlib/v3/core_resources.py +++ b/vmware_nsxlib/v3/core_resources.py @@ -766,7 +766,8 @@ class NsxLibLogicalRouter(utils.NsxLibApiBase): def create(self, display_name, tags, edge_cluster_uuid=None, tier_0=False, description=None, transport_zone_id=None, - allocation_pool=None, enable_standby_relocation=False): + allocation_pool=None, enable_standby_relocation=False, + failover_mode=None): # TODO(salv-orlando): If possible do not manage edge clusters # in the main plugin logic. router_type = (nsx_constants.ROUTER_TYPE_TIER0 if tier_0 else @@ -781,6 +782,8 @@ class NsxLibLogicalRouter(utils.NsxLibApiBase): if transport_zone_id: body['advanced_config'] = { 'transport_zone_id': transport_zone_id} + if failover_mode: + body['failover_mode'] = failover_mode allocation_profile = {} if allocation_pool: allocation_profile['allocation_pool'] = allocation_pool