Hi Takamune Cho,
Is this related to your work ?
The vFWDT execution is Ok from the workflow.py script to the ansible server. But the ansible server is not able to execute the playbook because there is a wrong argument ( timeout: unrecognized option: signal=KILL) in ansible server command:
Here is the command:
timeout --signal=KILL 3600 ansible-playbook -v --timeout 3600 --extra-vars "vnf_instance='vfwdt',
ConfigFileName='../traffic_distribution_config.json'" -i PlaybooksTemp/vfwdt_5a47fc4e-2cb4-48b5-87cb-229443641204_7dcd
4e7c-9dff-43c3-bef5-28b1b1276f8f/inventory/vfwdthosts PlaybooksTemp/vfwdt_5a47fc4e-2cb4-48b5-87cb-229443641204_7dcd4e7c
-9dff-43c3-bef5-28b1b1276f8f/distributetraffic/site.yml
timeout: unrecognized option: signal=KILL
Looking in the AnsibleServer.py, I think the code related to create this command is here:
if len(str_parameters) > 0:
cmd = 'export HOME=/root; env; cd ' + playbookdir + ';' +'timeout --signal=KILL ' + str(timeout) + \
' ansible-playbook -v --timeout ' + str(timeout) + ' --extra-vars ' + str_parameters + ' -i ' + \
inventory_path + ' ' + playbook_path + ' | tee log.file'
else:
cmd = 'export HOME=/root; env; cd ' + playbookdir + ';' +'timeout --signal=KILL ' + str(timeout) + \
' ansible-playbook -v --timeout ' + str(timeout) + ' -i ' + inventory_path + ' ' + playbook_path +' | tee log.file'
In the Jira , I see that you've made the appropriate change to make it run ?
But I'm a little by lost to trace all the modified file. What should be the appropriate file to change ?
Thanks,
I did remember there was a syntax error related to KILL signal issue. but I can't recall how I fixed it. what version are you using for ansible container?
Hi Takamune Cho,
Following the
I changed the lines to generate to cmd.
if len(str_parameters) > 0:
cmd = 'export HOME=/opt/ansible-server; env; timeout -s KILL -t ' + str(timeout) + \
' ansible-playbook -v --timeout ' + str(timeout) + ' --extra-vars ' + str_parameters + ' -i ' + \
inventory_path + ' ' + playbook_path + ' | tee log.file'
else:
cmd = 'export HOME=/opt/ansible-server; env; timeout -s KILL -t ' + str(timeout) + \
' ansible-playbook -v --timeout ' + str(timeout) + ' -i ' + inventory_path + ' ' + playbook_path
Now the playbook is executed but I get a different error at the end of the execution ( after checking traffic presence): Here is I can get from the ansible-server.log:
TASK [debug] *******************************************************************
ok: [vfwl01pgn5c42] => {
"msg": "traffic present [u'traffic present'] "
}
TASK [Traffic check trafficpresence is FALSE] **********************************
skipping: [vfwl01pgn5c42] => {"changed": false, "skip_reason": "Conditional result was False"}
TASK [debug] *******************************************************************
skipping: [vfwl01pgn5c42] => {}[14/Aug/2019:13:24:45] PlayBook Complete: PlaybooksTemp/vfwdt_53d9e6c5-00fe-4dc2-8d87-397d276566e6_5c4df19f-335b-43ae-8a10-025d058491cb/distributetrafficcheck
[14/Aug/2019:13:24:45] Return code:0
[14/Aug/2019:13:24:45] Return val:{'vfwl01pgn5c42': ['17', '3', '0', '0']}
[14/Aug/2019:13:24:45] Checking for results.txt files:
Process Process-12:
Traceback (most recent call last):
File "/usr/lib/python2.7/multiprocessing/process.py", line 267, in _bootstrap
self.run()
File "/usr/lib/python2.7/multiprocessing/process.py", line 114, in run
self._target(*self._args, **self._kwargs)
File "RestServer.py", line 285, in RunAnsible_Playbook
"StatusMessage": "SUCCESS"}
TypeError: list indices must be integers, not NoneType
TASK [debug] *******************************************************************
skipping: [vfwl01pgn5c42] => {}
PLAY RECAP *********************************************************************
vfwl01pgn5c42 : ok=17 changed=3 unreachable=0 failed=0
[14/Aug/2019:13:25:36] LOOKING AT ALL TestRecords: 5c4df19f-335b-43ae-8a10-025d058491cb
[14/Aug/2019:13:25:36] Not ActiveProcess for ID: 5c4df19f-335b-43ae-8a10-025d058491cb
[14/Aug/2019:13:25:36] RestServer.Dispatch: GET
[14/Aug/2019:13:25:37] Payload: {u'Type': u'GetResult', u'Id': u'5c4df19f-335b-43ae-8a10-025d058491cb'} Type GetResult
[14/Aug/2019:13:25:37] ** GetResult for: 5c4df19f-335b-43ae-8a10-025d058491cb
[14/Aug/2019:13:25:37] {'ExpectedDuration': '3600sec', 'StatusMessage': 'PENDING', 'StatusCode': 100}
[14/Aug/2019:13:25:37] Output: {}
[14/Aug/2019:13:25:37] StatusCode: 100
[14/Aug/2019:13:25:37] StatusMessage: PENDING
[14/Aug/2019:13:25:37] HTTP
Request Headers:
HOST: appc-ansible-server:8000
CONNECTION: Keep-Alive
Remote-Addr: 10.42.5.23
USER-AGENT: Apache-HttpClient/4.5.3 (Java/1.8.0_201)
ACCEPT-ENCODING: gzip,deflate
[14/Aug/2019:13:25:37] HTTP
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/cherrypy/_cprequest.py", line 630, in respond
self._do_respond(path_info)
File "/usr/lib/python2.7/site-packages/cherrypy/_cprequest.py", line 689, in _do_respond
response.body = self.handler()
File "/usr/lib/python2.7/site-packages/cherrypy/lib/encoding.py", line 221, in __call__
self.body = self.oldhandler(*args, **kwargs)
File "/usr/lib/python2.7/site-packages/cherrypy/lib/jsontools.py", line 58, in json_handler
value = cherrypy.serving.request._json_inner_handler(*args, **kwargs)
File "/usr/lib/python2.7/site-packages/cherrypy/_cpdispatch.py", line 54, in __call__
return self.callable(*self.args, **self.kwargs)
File "RestServer.py", line 750, in Dispatch
"Output": TestRecord[input_data['Id']]["Output"]["Output"],
KeyError: 'Output'
10.42.5.23 - - [14/Aug/2019:13:25:37] "GET /Dispatch?Id=5c4df19f-335b-43ae-8a10-025d058491cb&Type=GetResult HTTP/1.1" 500 1680 "" "Apache-HttpClient/4.5.3 (Java/1.8.0_201)"
Have you encountered this before ?
On the other hand , to answer your question about the version. I use the following image for the ansible-server:
image: onap/ccsdk-ansible-server-image:0.4.2
Thanks for your help
Hi
I'm following this tutorial https://docs.onap.org/en/dublin/submodules/integration.git/docs/docs_vFWDT.html?highlight=vFWDT to test the vFW traffic distribution use case.
I've been through all the steps listed in the tutorial. When I run the workflow.py script to distribute the traffic from one vFW to another vFW I got the following result :
ubuntu@onap-control-1:~/demo/tutorials/vFWDT/workflow$ python3 workflow.py d627168f-13b9-4705-89ea-fc1839f85fc8 172.24.52.68 True False False True
Executing workflow for VNF ID 'd627168f-13b9-4705-89ea-fc1839f85fc8' on ONAP with IP 172.24.52.68
OOF Cache True, is CL vFW False, only info False, check LCM result True
vFWDT Service Information:
{
"service-info": {
"global-customer-id": "DemoCust_6a835c42-c149-40d5-aff0-0894615cf129",
"service-instance-id": "dcc27475-81af-4db3-b924-57a8537c62a6",
"service-type": "vFWDT"
},
"vfw-model-info": {
"model-invariant-id": "3cbab73f-9925-4935-a388-6c2284ce4213",
"model-version-id": "d6dc464b-2181-4c32-8efa-bf34bfb4bab8",
"vnf-name": "Ete_vFWDTvFWSNK_6a835c42_2",
"vnf-type": "vFWDT 2019-08-12 16:12:/vFWDT_vFWSNK 63077407-db0f 1"
},
"vpgn-model-info": {
"model-invariant-id": "9f7ad498-691a-4897-abb3-4d4b7e17a9e7",
"model-version-id": "3493f844-9421-4975-9546-ee64f1446b8b",
"vnf-name": "Ete_vFWDTvPKG_6a835c42_0",
"vnf-type": "vFWDT 2019-08-12 16:12:/vFWDT_vPKG 514a7e95-a649 0"
},
"vf-module-id": "285615be-2eec-4ff9-b9c6-f78a800c9766"
}
Ansible Inventory:
[vpgn]
vfwl01pgn5c42 ansible_ssh_host=10.0.0.106 ansible_ssh_user=ubuntu
[vfw-sink]
vfwl02vfw5c42 ansible_ssh_host=10.0.0.104 ansible_ssh_user=ubuntu
vfwl01vfw5c42 ansible_ssh_host=10.0.0.102 ansible_ssh_user=ubuntu
Distribute Traffic Workflow Execution:
APPC REQ 0 - DistributeTrafficCheck
Request Accepted. Receiving result status...
Checking LCM DistributeTrafficCheck Status
SUCCESSFUL
APPC REQ 1 - DistributeTraffic
Request Accepted. Receiving result status...
Checking LCM DistributeTraffic Status
SUCCESSFUL
APPC REQ 2 - DistributeTrafficCheck
Request Accepted. Receiving result status...
Checking LCM DistributeTrafficCheck Status
SUCCESSFUL
APPC REQ 3 - DistributeTrafficCheck
Request Accepted. Receiving result status...
Checking LCM DistributeTrafficCheck Status
SUCCESSFUL
No matter which vFW I tried to distribute traffic to , it's always a success, but nothing happens ( I mean there is no change in VPP configuration in the vPKG). It's weird besauce I can shutdown all the VM related to this use case in OpenStack and I still get a "successful" traffic distribution ...
Where can I start to troubleshoot this issue. Is there a way in the Ansible server to see SSH connection to the vPKG ?
Is there any URL DMAAP topics ( like for the vFWCL) that I can querry to see if the APPC send the distribute traffic order to the Ansible Server ?
Thanks for your help!,