ODP: [POLICY][CLAMP] Error when submitting to Policy Engine #clamp #policy


Grech, Lukasz (Nokia - PL/Wroclaw) <lukasz.grech@...>
 

Thanks Sebastien,

Unfortunately it didn't work. I tried different combinations of parameters. Interestingly I had this working on bit older Frankfurt lab from a month ago. And now exact same policy is rejected on more recent lab.

Is there someone from POLICY team who can give some hints? Policy component rejects policies submitted from CLAMP. Error details are below.

Regards
-Lukasz

Od: Determe, Sebastien <sebastien.determe@...>
Wysłane: wtorek, 2 czerwca 2020 09:44
Do: Grech, Lukasz (Nokia - PL/Wroclaw) <lukasz.grech@...>; onap-discuss@... <onap-discuss@...>
Temat: RE: [POLICY][CLAMP] Error when submitting to Policy Engine #clamp #policy
 

Lukasz,

 

Here is an example of what we had for scaleout (try to put v0.0.1 for policyVersion)

Otherwise you can look at the logs in policy-api container but I don’t think you will get more details than what is returned by the api.

 

{

  "tca_policy": {

    "domain": "measurementsForVfScaling",

    "metricsPerEventName": [

      {

        "policyScope": "DCAE",

        "thresholds": [

          {

            "version": "1.0.2",

            "severity": "MAJOR",

            "thresholdValue": 200,

            "closedLoopEventStatus": "ONSET",

            "closedLoopControlName": "LOOP_test-vLB",

            "direction": "LESS_OR_EQUAL",

            "fieldPath": "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedTotalPacketsDelta"

          }

        ],

        "eventName": "vLoadBalancer",

        "policyVersion": "v0.0.1",

        "controlLoopSchemaType": "VM",

        "policyName": "DCAE.Config_tca-hi-lo"

      }

    ]

  }

}

 

Seb

 

From: Grech, Lukasz (Nokia - PL/Wroclaw) <lukasz.grech@...>
Sent: Monday, June 1, 2020 1:57 PM
To: Determe, Sebastien <sebastien.determe@...>; onap-discuss@...
Subject: ODP: [POLICY][CLAMP] Error when submitting to Policy Engine #clamp #policy

 

Thanks Sebastien for help. Here's the policy:

 

{

  "tca_policy": {

    "domain": "measurementsForVfScaling",

    "metricsPerEventName": [

      {

        "policyScope": "testPolicyScope",

        "thresholds": [

          {

            "version": "1",

            "severity": "CRITICAL",

            "thresholdValue": 30,

            "closedLoopEventStatus": "ONSET",

            "closedLoopControlName": "LOOP_lg-aa-loop-50",

            "direction": "LESS",

            "fieldPath": "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedTotalPacketsDelta"

          }

        ],

        "eventName": "vFirewallBroadcastPackets",

        "policyVersion": "1.0.0",

        "controlLoopSchemaType": "VM",

        "policyName": "testPolicyScope"

      }

    ]

  }

}

 

As a note, we had something similar working in Dublin, now I'm trying to "map it" to Frankfurt. Not sure about all the fields though, I'm not that familiar with ctrl-loops to be honest.

 

BTW. Is there any way for me to understand what's the problem with this policy? Asking Policy team each time doesn't seem too optimal ;) Maybe there's some log or something that I can check?

 

Regards

-Lukasz

 

 


Od: Determe, Sebastien <sebastien.determe@...>
Wysłane: piątek, 29 maja 2020 15:55
Do: onap-discuss@... <onap-discuss@...>; Grech, Lukasz (Nokia - PL/Wroclaw) <lukasz.grech@...>
Temat: RE: [CLAMP][POLICY] Error when submitting to Policy Engine #clamp #policy

 

Lukasz,

 

Policy rejects the TCA monitoring policy (onap.policies.monitoring.cdap.tca.hi.lo.app, APP box in clamp).

It means there is an issue with the configuration of it,

Could you copy paste the JSON config you have (click on the monitoring policy box and then click on the button EDIT JSON at the very top of the dialog)? so that may be someone from policy can have a look

 

Thanks,

Seb

 

From: onap-discuss@... <onap-discuss@...> On Behalf Of Grech, Lukasz (Nokia - PL/Wroclaw)
Sent: Friday, May 29, 2020 3:24 PM
To: onap-discuss@...
Subject: [onap-discuss] [CLAMP][POLICY] Error when submitting to Policy Engine #clamp #policy

 

Hi

 

I have a ctrl-loop created in CLAMP. I get an error when submitting policies to Policy Engine: 

 

------------------------------------------------------------------------------------------------------------

SUBMIT request failed, Error reported: org.apache.camel.http.common.HttpOperationFailedException: HTTP operation failed invoking https://policy-api.onap:6969/policy/api/v1/policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app/versions/1.0.0/policies?connectionTimeToLive=5000 with statusCode: 406 - Body: {"code":"NOT_ACCEPTABLE","error":"\n***validation of model failed***\nPfConceptKey(name=ToscaServiceTemplateSimple, version=1.0.0):org.onap.policy.models.tosca.simple.concepts.JpaToscaServiceTemplate:INVALID:no policy types are defined on the service template for the policies in the topology template\n********************************","details":["\n***validation of model failed***\nPfConceptKey(name=ToscaServiceTemplateSimple, version=1.0.0):org.onap.policy.models.tosca.simple.concepts.JpaToscaServiceTemplate:INVALID:no policy types are defined on the service template for the policies in the topology template\n********************************"]} 

------------------------------------------------------------------------------------------------------------

 

I looked for this message "no policy types are defined..." in Policy code and it seems it comes from service template validation (JpaToscaServiceTemplate.validatePolicyTypesInPolicies()). And it seems it's raised when there are no policy types defined in the template (if I get this right). However I looked in to the template generated by SDC and it looks like policy types are imported there. I'm attaching CSAR exported from SDC.

 

Could you give me a hint what might be wrong?

 

Thanks

-Lukasz    


Jorge Hernandez
 

Hi Lukasz,
The policy api  component has a limitation in this release where requires you to start fresh with a database if you perform an upgrade, which seems may be the case in your situation as I'm going through your emails, if you have gone from 2.2.3 to 2.2.4 that may be very well be the case that you hit.   To recover from the situation, you'll need to start fresh with the policy database when upgrading your installation, so make sure to take down the policy-mariadb pod to start fresh (make sure there is no PV/PVCs left, or leftover data under /dockerdata-nfs/dev-policy/policy-mariadb [check on the name, writing it from top of my head]).   Let me know how it goes.
Best regards,
Jorge