Uploaded image for project: 'CORD'
  1. CORD
  2. CORD-1173

Error deleting vSG Tenant

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Medium
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: vOLT, vSG
    • Labels:
      None

      Description

      I have a CIAB built from the master branch (as of 5-1-17). I created a new subscriber and a new vsg tenant for that subscriber and it doesnt appear to delete properly when deleting those.

      Here are the steps to reproduce:

      1. Create new cord subscriber
      2. Create new volt tenant for that subscriber
      3. Wait for new instance (vm) to be provisioned (took about 5 mins)
      4. Issue a DELETE for that new volt tenant
      • I tried the old and new apis for this step. The old one (/api/tenant/cord/volt/12) returned with a 301 MOVED PERMANENTLY, but it did literally nothing to my instance and deleted nothing from my environment. I can hit that api over and over again and will continue to get a 301. The new api (/xosapi/v1/volt/cordsubscriberroots/2) returned a 200, but I saw errors in the xos_core container related to that operation.
      • The GET api on the volt tenants will not return my "delete" tenant, but I still see it in my environment and in the DB.

      Ex.

      curl -X GET -u $USER2:$PASSWD2 -H "Content-Type: application/json" http://$SERVER_IP2:$SERVER_PORT/api/tenant/cord/subscriber/ | jq
      [
        {
          "humanReadableName": "cordSubscriber-1",
          "id": 1,
          "features": {
            "cdn": false,
            "uplink_speed": 1000000000,
            "downlink_speed": 1000000000,
            "uverse": true,
            "status": "enabled"
          },
          "identity": {
            "account_num": "123",
            "name": "My House"
          },
          "related": {
            "instance_name": "mysite_vsg",
            "vsg_id": 8,
            "compute_node_name": "pleasing-brain",
            "c_tag": 111,
            "instance_id": 1,
            "wan_container_ip": "10.6.1.131",
            "volt_id": 7,
            "s_tag": 222
          }
        }
      ]
      

      However, the instance is still there and in the db:

      vagrant@prod:~$ nova list --all-tenants
      +--------------------------------------+-------------------------+--------+------------+-------------+---------------------------------------------------------------------------+
      | ID                                   | Name                    | Status | Task State | Power State | Networks                                                                  |
      +--------------------------------------+-------------------------+--------+------------+-------------+---------------------------------------------------------------------------+
      | 32fca314-7a3d-4b47-a31a-33c02834f84b | mysite_exampleservice-2 | ACTIVE | -          | Running     | exampleservice_network=10.0.4.2; management=172.27.0.3; public=10.6.1.194 |
      | 26d4b96b-72bf-42a0-ac40-fc3b6c0d3946 | mysite_vsg-1            | ACTIVE | -          | Running     | management=172.27.0.2; mysite_vsg-access=10.0.2.2                         |
      | 249c3834-3d5d-4e32-882d-e5acd6a408f9 | mysite_vsg-3            | ACTIVE | -          | Running     | management=172.27.0.4; mysite_vsg-access=10.0.2.3                         |
      +--------------------------------------+-------------------------+--------+------------+-------------+---------------------------------------------------------------------------+
      xos=# select * from volt_cordsubscriberroot;
       tenantroot_ptr_id | firewall_enable |        firewall_rules        | url_filter_enable | url_filter_rules | url_filter_level | cdn_enable | is_demo_user | uplink_speed | downlink_speed | enable_uverse | status  
      -------------------+-----------------+------------------------------+-------------------+------------------+------------------+------------+--------------+--------------+----------------+---------------+---------
                       1 | f               | accept all anywhere anywhere | f                 | allow all        | R                | f          | f            |   1000000000 |     1000000000 | t             | enabled
                       2 | f               | accept all anywhere anywhere | f                 | allow all        | PG               | f          | f            |     33333331 |       33333332 | t             | enabled
      (2 rows)

      I am now seeing this exception continuously in the xos_core container:

      INFO:xos.log:REAPER: cannot purge object <TenantRoot: KK_SUBSCRIBER_1> because its cascade_set is nonempty: KK_SUBSCRIBER_1,vROUTER-tenant-15,vOLT-tenant-12,vCPE-tenant-13,vROUTER-tenant-15,vOLT-tenant-12,vCPE-tenant-13,vCPE-tenant-13
      INFO:xos.log:REAPER: cannot purge object <Tenant: vOLT-tenant-12> because its cascade_set is nonempty: vCPE-tenant-13,vOLT-tenant-12,vROUTER-tenant-15,vCPE-tenant-13
      INFO:xos.log:REAPER: skipping <Tenant: vROUTER-tenant-15> because it has need_delete set
      INFO:xos.log:REAPER: skipping <Tenant: vCPE-tenant-13> because it has need_delete set
      INFO:xos.log:REAPER: skipping <TenantWithContainer: vCPE-tenant-13> because it has need_delete set
      ERROR:root:Exception calling application: VSGTenant matching query does not exist.
      Traceback (most recent call last):
        File "/usr/local/lib/python2.7/dist-packages/grpc/_server.py", line 364, in _call_behavior
          return behavior(argument, context), True
        File "/opt/xos/coreapi/apihelper.py", line 23, in wrapper
          return function(*args, **kwargs)
        File "/opt/xos/coreapi/xos_grpc_api.py", line 90, in UpdateVSGTenant
          return self.update(model, user, request.id, request, context)
        File "/opt/xos/coreapi/apihelper.py", line 201, in update
          obj = djangoClass.objects.get(id=id)
        File "/usr/local/lib/python2.7/dist-packages/django/db/models/manager.py", line 127, in manager_method
          return getattr(self.get_queryset(), name)(*args, **kwargs)
        File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", line 334, in get
          self.model._meta.object_name
      DoesNotExist: VSGTenant matching query does not exist.
      ERROR:root:Exception calling application: Tenant matching query does not exist.
      Traceback (most recent call last):
        File "/usr/local/lib/python2.7/dist-packages/grpc/_server.py", line 364, in _call_behavior
          return behavior(argument, context), True
        File "/opt/xos/coreapi/apihelper.py", line 23, in wrapper
          return function(*args, **kwargs)
        File "/opt/xos/coreapi/xos_grpc_api.py", line 1589, in GetTenant
          return self.get(model, request.id)
        File "/opt/xos/coreapi/apihelper.py", line 188, in get
          obj = djangoClass.objects.get(id=id)
        File "/usr/local/lib/python2.7/dist-packages/django/db/models/manager.py", line 127, in manager_method
          return getattr(self.get_queryset(), name)(*args, **kwargs)
        File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", line 334, in get
          self.model._meta.object_name
      DoesNotExist: Tenant matching query does not exist.

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            scottb Scott Baker
            Reporter:
            kailash Kailash Khalasi
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes