Hi Vamshi,

I checked the logs here and I saw there's something missing in your policy.
First, to apply the policies for a certain VNF included in a certain service, 
you need to make the two keys inside the policies('resources' and 
'policyScope') matching with the values you have in your SO request. You need 
to have your 'ServiceName' in the SO request available inside the 'policyScope' 
in the policy, and have your 'resourceModuleName' in the SO request available 
as part of 'resources' in the policies.

Take an example here. According to the pushed-policies.txt and the 
so-bpmn-log.txt you provided. We shall have a sample Distance policy being 
retrieved like this:

{
        "config": 
"{\"service\":\"distancePolicy\",\"guard\":\"False\",\"content\":{\"policyType\":\"distance_to_location\",\"applicableResources\":\"any\",\"identity\":\"distance-vFW\",\"policyScope\":[\"vfw\",\"us\",\"international\",\"ip\"],\"distanceProperties\":{\"distance\":{\"value\":\"100\",\"unit\":\"km\",\"operator\":\"<\"},\"locationInfo\":\"customer_loc\"},\"resources\":[\"vFW\",\"VfwHeatHpaV1\",\"HpaVf42\"]},\"priority\":\"3\",\"templateVersion\":\"OpenSource.version.1\",\"riskLevel\":\"2\",\"description\":\"Distance
 Policy for 
vFW\",\"policyName\":\"OSDF_DUBLIN.Distance_vFW_1\",\"version\":\"test1\",\"riskType\":\"test\"}",
        "matchingConditions": {
            "ECOMPName": "SampleDemo",
            "ONAPName": "SampleDemo",
            "policyScope": "vfw,us,international,ip",
            "policyType": "distance_to_location",
            "service": "distancePolicy"
        },
        "policyConfigMessage": "Config Retrieved! ",
        "policyConfigStatus": "CONFIG_RETRIEVED",
        "policyName": "OSDF_DUBLIN.Config_MS_Distance_vFW_1.1.xml",
        "policyType": "MicroService",
        "policyVersion": "1",
        "property": null,
        "responseAttributes": {},
        "type": "JSON"
}

So I think it is because of this, that a lot information are missing in the 
payload and cause the failure of placement.
Can you try updating the policies with the correct value and see if it can 
solve this problem?
Thanks.

Best Regards,
Ruoyu


From: onap-discuss@lists.onap.org [mailto:onap-discuss@lists.onap.org] On 
Behalf Of vamshi
Sent: Wednesday, August 14, 2019 7:26 PM
To: Ying, Ruoyu <ruoyu.y...@intel.com>; onap-discuss@lists.onap.org
Subject: Re: [onap-discuss] [SO][OOF] error while instantiating service

Hello Ruoyu,

Many thanks for your reply.

Here I pulled the logs need to understand the issue.  I've also attached logs 
from SO, OSDF and policies that are pushed. Thank you


OOF-OSDF - debug.log
------------------------------
2019-08-14T10:56:17,245+00:00||Thread-62||OOF_OSDF|a6ffc2dc-af83-11e9-a796-ce8f9b3345ee|DEBUG||10.42.4.26|dev-oof-oof-79f9f55959-fqgs4||||Sending
 first Conductor request for request_id 9f85f94d-52eb-4aba-a970-ebc3367052fa
2019-08-14T10:56:17,245+00:00||Thread-62||OOF_OSDF|a6ffc2dc-af83-11e9-a796-ce8f9b3345ee|DEBUG||10.42.4.26|dev-oof-oof-79f9f55959-fqgs4||||Payload
 to Conductor: {"name": "9f85f94d-52eb-4aba-a970-ebc3367052fa", "files": {}, 
"num_solution": "1", "timeout": 600, "template": {"homing_template_version": 
"2017-10-10", "optimization": {"minimize": {"sum": []}}, "constraints": {}, 
"parameters": {"REQUIRED_DISK": "", "customer_lat": "32.897480", 
"REQUIRED_MEM": "", "customer_long": "97.040443", "service_name": "vFW", 
"service_id": "e5bacb00-4e32-4e4b-811a-a327e2b00202"}, "locations": 
{"customer_loc": {"latitude": {"get_param": "customer_lat"}, "longitude": 
{"get_param": "customer_long"}}}, "demands": {}}}
2019-08-14T10:56:17,246+00:00||Thread-62||OOF_OSDF|a6ffc2dc-af83-11e9-a796-ce8f9b3345ee|DEBUG||10.42.4.26|dev-oof-oof-79f9f55959-fqgs4||||Requesting
 URL: https://oof-has-api:8091/v1/plans/
2019-08-14T10:56:19,954+00:00||Thread-62||OOF_OSDF|a6ffc2dc-af83-11e9-a796-ce8f9b3345ee|DEBUG||10.42.4.26|dev-oof-oof-79f9f55959-fqgs4||||Received
 response [code: 201, headers: {'X-LatestVersion': '1.3.1', 'Content-Type': 
'application/json', 'Date': 'Wed, 14 Aug 2019 10:56:19 GMT', 'X-PatchVersion': 
'1', 'Server': 'nginx/1.14.2', 'Connection': 'keep-alive', 'Content-Length': 
'228', 'X-MinorVersion': '0'}, data: {'history': [], 'status_code': 201, 
'_next': None, 'request': <PreparedRequest [POST]>, 'reason': 'Created', 
'connection': <requests.adapters.HTTPAdapter object at 0x7f56ebdd75c0>, 
'_content': b'{"status": "template", "name": 
"9f85f94d-52eb-4aba-a970-ebc3367052fa", "links": [[{"href": 
"https://oof-has-api:8091/v1/plans/f4c6f2c8-45a7-4a67-a9d5-52c8e1372d37";, 
"rel": "self"}]], "id": "f4c6f2c8-45a7-4a67-a9d5-52c8e1372d37"}', 'headers': 
{'X-LatestVersion': '1.3.1', 'Content-Type': 'application/json', 'Date': 'Wed, 
14 Aug 2019 10:56:19 GMT', 'X-PatchVersion': '1', 'Server': 'nginx/1.14.2', 
'Connection': 'keep-alive', 'Content-Length': '228', 'X-MinorVersion': '0'}, 
'_content_consumed': True, 'cookies': <RequestsCookieJar[]>, 'elapsed': 
datetime.timedelta(0, 2, 687100), 'url': 'https://oof-has-api:8091/v1/plans/', 
'raw': <urllib3.response.HTTPResponse object at 0x7f56ebde0438>, 'encoding': 
None}]
2019-08-14T10:56:29,965+00:00||Thread-62||OOF_OSDF|a6ffc2dc-af83-11e9-a796-ce8f9b3345ee|DEBUG||10.42.4.26|dev-oof-oof-79f9f55959-fqgs4||||Attempting
 to read the plan from the conductor provided url 
https://oof-has-api:8091/v1/plans/f4c6f2c8-45a7-4a67-a9d5-52c8e1372d37
2019-08-14T10:56:29,965+00:00||Thread-62||OOF_OSDF|a6ffc2dc-af83-11e9-a796-ce8f9b3345ee|DEBUG||10.42.4.26|dev-oof-oof-79f9f55959-fqgs4||||Requesting
 URL: https://oof-has-api:8091/v1/plans/f4c6f2c8-45a7-4a67-a9d5-52c8e1372d37
2019-08-14T10:56:31,497+00:00||Thread-62||OOF_OSDF|a6ffc2dc-af83-11e9-a796-ce8f9b3345ee|DEBUG||10.42.4.26|dev-oof-oof-79f9f55959-fqgs4||||Received
 response [code: 200, headers: {'X-LatestVersion': '1.3.1', 'Content-Type': 
'application/json', 'Date': 'Wed, 14 Aug 2019 10:56:31 GMT', 'X-PatchVersion': 
'1', 'Server': 'nginx/1.14.2', 'Connection': 'keep-alive', 'Content-Length': 
'316', 'X-MinorVersion': '0'}, data: {'history': [], 'status_code': 200, 
'_next': None, 'request': <PreparedRequest [GET]>, 'reason': 'OK', 
'connection': <requests.adapters.HTTPAdapter object at 0x7f56ebde0fd0>, 
'_content': b'{"plans": [{"status": "error", "message": "local variable 
\'triage_data_trans\' referenced before assignment", "name": 
"9f85f94d-52eb-4aba-a970-ebc3367052fa", "links": [[{"href": 
"https://oof-has-api:8091/v1/plans/f4c6f2c8-45a7-4a67-a9d5-52c8e1372d37";, 
"rel": "self"}]], "id": "f4c6f2c8-45a7-4a67-a9d5-52c8e1372d37"}]}', 'headers': 
{'X-LatestVersion': '1.3.1', 'Content-Type': 'application/json', 'Date': 'Wed, 
14 Aug 2019 10:56:31 GMT', 'X-PatchVersion': '1', 'Server': 'nginx/1.14.2', 
'Connection': 'keep-alive', 'Content-Length': '316', 'X-MinorVersion': '0'}, 
'_content_consumed': True, 'cookies': <RequestsCookieJar[]>, 'elapsed': 
datetime.timedelta(0, 1, 509218), 'url': 
'https://oof-has-api:8091/v1/plans/f4c6f2c8-45a7-4a67-a9d5-52c8e1372d37', 
'raw': <urllib3.response.HTTPResponse object at 0x7f56ebdcf048>, 'encoding': 
None}]
2019-08-14T10:56:31,498+00:00||Thread-62||OOF_OSDF|a6ffc2dc-af83-11e9-a796-ce8f9b3345ee|DEBUG||10.42.4.26|dev-oof-oof-79f9f55959-fqgs4||||Requesting
 URL: 
http://so-bpmn-infra.onap:8081/mso/WorkflowMessage/oofResponse/9f85f94d-52eb-4aba-a970-ebc3367052fa

Thanks & Regards,

Vamshi Krishna | Tech Mahindra

Sharda Centre, Off Karve Road, Erandwane, Pune 411 004, INDIA
Mobile: +91 9848639561, ext : 3492
Email Id - vn00480...@techmahindra.com<mailto:vn00480...@techmahindra.com>



[cid:image001.jpg@01D25617.55BC0E30]<http://www.techmahindra.com/>






From: Ying, Ruoyu <ruoyu.y...@intel.com<mailto:ruoyu.y...@intel.com>>
Sent: Wednesday, August 14, 2019 7:19 AM
To: onap-discuss@lists.onap.org<mailto:onap-discuss@lists.onap.org>; Vamshi 
Namilikonda <vn00480...@techmahindra.com<mailto:vn00480...@techmahindra.com>>
Subject: RE: [onap-discuss] [SO][OOF] error while instantiating service

Hi Vamshi,

This error mainly happens when there's something wrong with the optimization 
policy that is needed for placement. May you try login to the osdf pod and copy 
the debug log(especially the payload it send to conductor) here? That will help 
us to locate the root cause for the problem. Thanks.

Best Regards,
Ruoyu

From: onap-discuss@lists.onap.org<mailto:onap-discuss@lists.onap.org> 
[mailto:onap-discuss@lists.onap.org] On Behalf Of vamshi
Sent: Tuesday, August 13, 2019 5:42 PM
To: onap-discuss@lists.onap.org<mailto:onap-discuss@lists.onap.org>
Subject: [onap-discuss] [SO][OOF] error while instantiating service

Hello SO/OOF team,

I'm trying vFW automation script for instantiating vFW use case. By following 
page 
https://github.com/onap/integration/tree/master/test/hpa_automation/heat<https://ind01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fonap%2Fintegration%2Ftree%2Fmaster%2Ftest%2Fhpa_automation%2Fheat&data=02%7C01%7Cvn00480215%40techmahindra.com%7C3f2e1d386ba641038b0108d720598930%7Cedf442f5b9944c86a131b42b03a16c95%7C0%7C0%7C637013441256801870&sdata=z5YkJwtwNRt08MTiA2jzt7lmbnK09HV%2FTnsI7G8po%2Fs%3D&reserved=0>
I was facing below issue in SO while it is trying to request OOF , have pulled 
log from - dev-so-so-bpmn-infra-5b4f566958-7jql6. The detailed log has attached 
to this mail. Could you please suggest any thoughts with your observations. 
Thank you



2019-08-13T06:49:14.926Z|5899cd91-80a9-4adc-9b09-40ce5340a0e0| 
org.onap.so.bpmn.common.scripts.OofHoming - OOF Async Callback Response is: 
"{\"externalApplicationDetails\": {\"httpMethod\": \"GET\", \"httpStatusCode\": 
200, \"responseMessage\": {\"plans\": [{\"name\": 
\"c8fc2537-3080-4cc7-873e-82e1a404550d\", \"status\": \"error\", \"id\": 
\"375bcb8e-5ab8-403f-940f-306e5068363f\", \"links\": [[{\"rel\": \"self\", 
\"href\": 
\"https://oof-has-api:8091/v1/plans/375bcb8e-5ab8-403f-940f-306e5068363f\<https://oof-has-api:8091/v1/plans/375bcb8e-5ab8-403f-940f-306e5068363f/>"}]],
 \"message\": \"local variable 'triage_data_trans' referenced before 
assignment\"}]}, \"url\": 
\"https://oof-has-api:8091/v1/plans/375bcb8e-5ab8-403f-940f-306e5068363f\<https://oof-has-api:8091/v1/plans/375bcb8e-5ab8-403f-940f-306e5068363f/>"},
 \"serviceException\": {\"text\": \"A request exception has occurred when 
contacting an external system\", \"errorType\": \"InterfaceError\"}}"
2019-08-13T06:49:14.932Z|5899cd91-80a9-4adc-9b09-40ce5340a0e0| 
org.onap.so.bpmn.core.json.JsonUtils - getJsonRawValue(): unable to parse json 
to retrieve value for field=solutions.placementSolutions. Exception was: 
org.json.JSONException: A JSONObject text must begin with '{' at 1 [character 2 
line 1]
org.json.JSONException: A JSONObject text must begin with '{' at 1 [character 2 
line 1]
        at org.json.JSONTokener.syntaxError(JSONTokener.java:433)
        at org.json.JSONObject.<init>(JSONObject.java:194)
        at org.json.JSONObject.<init>(JSONObject.java:321)
        at 
org.onap.so.bpmn.core.json.JsonUtils.getJsonRawValue(JsonUtils.java:775)
        at 
org.onap.so.bpmn.core.json.JsonUtils.getJsonRawValue(JsonUtils.java:757)




Thanks & Regards,

Vamshi Krishna | Tech Mahindra

Sharda Centre, Off Karve Road, Erandwane, Pune 411 004, INDIA
Mobile: +91 9848639561, ext : 3492
Email Id - vn00480...@techmahindra.com<mailto:vn00480...@techmahindra.com>



[cid:image001.jpg@01D25617.55BC0E30]<http://www.techmahindra.com/>






============================================================================================================================
 Disclaimer: This message and the information contained herein is proprietary 
and confidential and subject to the Tech Mahindra policy statement, you may 
review the policy at http://www.techmahindra.com/Disclaimer.html externally 
http://tim.techmahindra.com/tim/disclaimer.html internally within TechMahindra. 
============================================================================================================================


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#18575): https://lists.onap.org/g/onap-discuss/message/18575
Mute This Topic: https://lists.onap.org/mt/32850918/21656
Group Owner: onap-discuss+ow...@lists.onap.org
Unsubscribe: https://lists.onap.org/g/onap-discuss/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to