Back references to dis-associated policy exist while deleting VN.

Bug #1408617 reported by Ritam Gangopadhyay
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Status tracked in Trunk
R2.1
Won't Fix
Medium
Hampapur Ajay
R3.0
Invalid
Medium
Hampapur Ajay
Trunk
Invalid
Medium
Hampapur Ajay

Bug Description

After dis-associating a policy from a VN, when we try to delete the policy we see an error which points that the VN still has references to this policy, thus the policy can't be deleted. On inspecting the logs it seems like the policy associate and policy dis-associate requests done through vnc apis
add_network_policy()
virtual_network_update()
delete_network_policy()
virtual_network_update()
might not be in correct sequence resulting in this error.

Steps:
1. Create a VM
2. Create a policy
3. Associate the policy to VN
4. Try deleting the policy - it should fail with RefsExistError
5. Dis-associate the policy
6. Delete the Policy

While deleting the policy we see error which says that the VN still has back references to the policy and thus a failure occurs.

Script Log:
***********************

2014-12-26 18:19:01,779 - INFO - VN vn44 is created using API Server
2014-12-26 18:19:01,795 - DEBUG - Policy np_rules : [<vnc_api.gen.resource_xsd.PolicyRuleType object at 0x7f9291a4e610>, <vnc_api.gen.resource_xsd.PolicyRuleType object at 0x7f9291a4e410>]
2014-12-26 18:19:01,846 - DEBUG - Policy Creation Response 518a3905-1ef6-4053-87eb-22b264e67975
2014-12-26 18:19:01,846 - INFO - policy policy11 is created with rules using API Server
2014-12-26 18:19:01,856 - INFO - trying to associate policy policy11 to vn vn44
2014-12-26 18:19:01,890 - INFO - policy policy11 assocation with vn vn44 is successful
2014-12-26 18:19:01,903 - INFO - RefsExistError:Check passed that the policy cannot be deleted when the VN is associated to it.
2014-12-26 18:19:01,903 - INFO - trying to dis-associate policy policy11 from vn vn44
2014-12-26 18:19:01,931 - INFO - policy policy11 dis-assocation with vn vn44 is successful
2014-12-26 18:19:05,664 - ERROR -
  File "tcutils/wrappers.py", line 60, in wrapper
    result = function(self, *args, **kwargs)
  File "scripts/policy/test_policy_api.py", line 269, in test_associate_disassociate_api_policy
    np_delete = self.vnc_lib.network_policy_delete(id=str(policy_rsp))
  File "/usr/lib/python2.7/dist-packages/vnc_api/gen/vnc_api_client_gen.py", line 674, in network_policy_delete
    content = self._request_server(rest.OP_DELETE, uri)
  File "/usr/lib/python2.7/dist-packages/vnc_api/vnc_api.py", line 342, in _request_server
    retry_count=retry_count)
  File "/usr/lib/python2.7/dist-packages/vnc_api/vnc_api.py", line 387, in _request
    raise RefsExistError(content)

RefsExistError:
Back-References from http://10.204.216.30:8082/virtual-network/4d88c3d1-31e5-4f84-a5c5-c5cc93a991d2 still exist
2014-12-26 18:19:05,664 - ERROR -
  File "tcutils/wrappers.py", line 83, in wrapper
    cleanup(*args, **kwargs)
  File "/root/contrail-test/fixtures/policy_test.py", line 437, in cleanUp
    self._delete_policy()
  File "/root/contrail-test/fixtures/policy_test.py", line 447, in _delete_policy
    self.quantum_fixture.delete_policy(self.policy_obj['policy']['id'])

TypeError:
'NetworkPolicy' object has no attribute '__getitem__'

Ifmap Server log:
***********************

2014-12-26 18:19:02,023 [pool-1-thread-3] TRACE - contrail:virtual-network-properties [state=NEW cardinality=singleValue lifetime=forever size=285 bytes on dnode{id{contrail:virtual-network:default-domain:TestApiPolicyFixture01-59485228:vn44, other, extended}}]
2014-12-26 18:19:02,023 [pool-1-thread-3] TRACE - contrail:id-perms [state=NEW cardinality=singleValue lifetime=forever size=659 bytes on dnode{id{contrail:virtual-network:default-domain:TestApiPolicyFixture01-59485228:vn44, other, extended}}]
2014-12-26 18:19:02,024 [pool-1-thread-3] TRACE - contrail:virtual-network-network-policy [state=NEW cardinality=singleValue lifetime=forever size=320 bytes on dlink{dnode{id{contrail:virtual-network:default-domain:TestApiPolicyFixture01-59485228:vn44, other, extended}}, dnode{id{contrail:network-policy:default-domain:TestApiPolicyFixture01-59485228:policy11, other, extended}}}]

Cassandra Logs:
***********************

2014 Dec 26 18:19:01.757383 nodea34 [Config:contrail-api:0:__default__][SYS_INFO] : VncApiConfigLog:1019 [VncApiCommon: identifier_uuid = 4d88c3d1-31e5-4f84-a5c5-c5cc93a991d2, object_type = virtual_network, identifier_name = default-domain:TestApiPolicyFixture01-59485228:vn44, url = http://10.204.216.30:8082/ref-update, operation = ref-update, useragent = /usr/local/lib/python2.7/dist-packages/subunit/run.py, remote_ip = 10.204.216.30:8082, body = {'ref-type': 'network-policy', 'uuid': '4d88c3d1-31e5-4f84-a5c5-c5cc93a991d2', 'ref-fq-name': ['default-domain', 'TestApiPolicyFixture01-59485228', 'policy11'], 'ref-uuid': '518a3905-1ef6-4053-87eb-22b264e67975', 'operation': 'DELETE', 'type': 'virtual-network', 'attr': None}, user = TestApiPolicyFixture01, project = TestApiPolicyFixture01-59485228, domain = None]
2014 Dec 26 18:19:01.766356 nodea34 [Config:contrail-api:0:__default__][SYS_INFO] : VncApiConfigLog:1020 [VncApiCommon: identifier_uuid = 518a3905-1ef6-4053-87eb-22b264e67975, object_type = network_policy, identifier_name = default-domain:TestApiPolicyFixture01-59485228:policy11, url = http://10.204.216.30:8082/network-policy/518a3905-1ef6-4053-87eb-22b264e67975, operation = delete, useragent = /usr/local/lib/python2.7/dist-packages/subunit/run.py, remote_ip = 10.204.216.30:8082, user = TestApiPolicyFixture01, project = TestApiPolicyFixture01-59485228, domain = None]

cores and logs are copied to:
bhushana@10.204.216.50:~/Documents/technical/bugs/<bug-id>
Access details
ip:-10.204.216.50
login:bhushana
passw:- bhu@123

tags: added: regression sanity
information type: Proprietary → Public
Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Bug update]

bug update...

Revision history for this message
Ritam Gangopadhyay (ritam) wrote :

This is not seen in R3.0 and R3.0.1.0 sanity. So marking those scopes as "invalid"

Changed in juniperopenstack:
status: New → Invalid
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.