lbaas v2 NSX-v driver needs to improve handling Bad edge-bass request which causing ServerFault

Bug #1641676 reported by alex kang
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
vmware-nsx
New
Undecided
Unassigned

Bug Description

NSX-v does not support multiple tenant on same subnet.

So when creating load-balancer for other tenant by admin, there will be no edge-lbaas available for this tenant.

In our current implementation, this causing Bad edge-lbass response from backend and NSX-v driver throws Server Fault.

It is better that it can generate user-level error and not create the load-balancer at all.

## tempest test trace example:
=======================
ft7.4: vmware_nsx_tempest.tests.nsxv.api.lbaas.test_load_balancers_admin.LoadBalancersTest.test_create_load_balancer_missing_tenant_id_for_other_tenant[id-37620941-47c1-40b2-84d8-db17ff823ebc,smoke]_StringException: Empty attachments:
  stderr
  stdout

pythonlogging:'': {{{
2016-08-18 12:18:20,319 18865 INFO [tempest.lib.common.rest_client] Request (LoadBalancersTest:test_create_load_balancer_missing_tenant_id_for_other_tenant): 500 POST http://10.34.57.68:9696/v2.0/lbaas/loadbalancers 0.815s
2016-08-18 12:18:20,320 18865 DEBUG [tempest.lib.common.rest_client] Request - Headers: {'Content-Type': 'application/json', 'Accept': 'application/json', 'X-Auth-Token': '<omitted>'}
        Body: {"loadbalancer": {"vip_subnet_id": "18ba6dc8-d313-473f-a48c-8f8f66894bee"}}
    Response - Headers: {'status': '500', 'content-length': '179', 'content-location': 'http://10.34.57.68:9696/v2.0/lbaas/loadbalancers', 'date': 'Thu, 18 Aug 2016 19:18:20 GMT', 'content-type': 'application/json; charset=UTF-8', 'connection': 'close', 'x-openstack-request-id': 'req-f648433e-d554-4c2f-a869-6153e56a13a7'}
        Body: {"NeutronError": {"message": "Driver error: Bad edge-lbaas request: No suitable Edge found for subnet 18ba6dc8-d313-473f-a48c-8f8f66894bee.", "type": "DriverError", "detail": ""}}
2016-08-18 12:18:20,321 18865 INFO [vmware_nsx_tempest.tests.nsxv.api.lbaas.test_load_balancers_admin:LoadBalancersTest] Finished: test_create_load_balancer_missing_tenant_id_for_other_tenant
}}}

Traceback (most recent call last):
  File "/opt/devtest/vmware-nsx/vmware_nsx_tempest/tests/nsxv/api/lbaas/test_load_balancers_admin.py", line 83, in test_create_load_balancer_missing_tenant_id_for_other_tenant
    vip_subnet_id=self.subnet['id'])
  File "/opt/devtest/vmware-nsx/vmware_nsx_tempest/tests/nsxv/api/lbaas/base.py", line 145, in _create_load_balancer
    lb = cls.load_balancers_client.create_load_balancer(**lb_kwargs)
  File "/opt/devtest/vmware-nsx/vmware_nsx_tempest/services/lbaas/load_balancers_client.py", line 37, in create_load_balancer
    return self.create_resource(uri, post_data)
  File "/opt/devtest/mitaka-tempest/tempest/lib/services/network/base.py", line 60, in create_resource
    resp, body = self.post(req_uri, req_post_data)
  File "/opt/devtest/mitaka-tempest/tempest/lib/common/rest_client.py", line 270, in post
    return self.request('POST', url, extra_headers, headers, body, chunked)
  File "/opt/devtest/mitaka-tempest/tempest/lib/common/rest_client.py", line 664, in request
    resp, resp_body)
  File "/opt/devtest/mitaka-tempest/tempest/lib/common/rest_client.py", line 828, in _error_checker
    message=message)
tempest.lib.exceptions.ServerFault: Got server fault
Details: Driver error: Bad edge-lbaas request: No suitable Edge found for subnet 18ba6dc8-d313-473f-a48c-8f8f66894bee.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.