From 8dd7de5f8340094b99def2a45ade865f00693e9d Mon Sep 17 00:00:00 2001 From: Benjamin Diaz Date: Fri, 19 Oct 2018 11:13:35 -0300 Subject: [PATCH] Removes obsolete create_monitoring function POL now manages lifecycle of NS through kafka messages. There is no use of the explicit autoscale config msg sent in create_monitoring. Signed-off-by: Benjamin Diaz --- osm_lcm/ns.py | 47 ----------------------------------------------- 1 file changed, 47 deletions(-) diff --git a/osm_lcm/ns.py b/osm_lcm/ns.py index 4b4adbf..f9244e5 100644 --- a/osm_lcm/ns.py +++ b/osm_lcm/ns.py @@ -394,50 +394,6 @@ class NsLcm(LcmBase): else: raise LcmException("ns_update_vnfr: Not found member_vnf_index={} at RO info".format(vnf_index)) - async def create_monitoring(self, nsr_id, vnf_member_index, vnfd_desc): - if not vnfd_desc.get("scaling-group-descriptor"): - return - for scaling_group in vnfd_desc["scaling-group-descriptor"]: - scaling_policy_desc = {} - scaling_desc = { - "ns_id": nsr_id, - "scaling_group_descriptor": { - "name": scaling_group["name"], - "scaling_policy": scaling_policy_desc - } - } - for scaling_policy in scaling_group.get("scaling-policy"): - scaling_policy_desc["scale_in_operation_type"] = scaling_policy_desc["scale_out_operation_type"] = \ - scaling_policy["scaling-type"] - scaling_policy_desc["threshold_time"] = scaling_policy["threshold-time"] - scaling_policy_desc["cooldown_time"] = scaling_policy["cooldown-time"] - scaling_policy_desc["scaling_criteria"] = [] - for scaling_criteria in scaling_policy.get("scaling-criteria"): - scaling_criteria_desc = {"scale_in_threshold": scaling_criteria.get("scale-in-threshold"), - "scale_out_threshold": scaling_criteria.get("scale-out-threshold"), - } - if not scaling_criteria.get("vnf-monitoring-param-ref"): - continue - for monitoring_param in vnfd_desc.get("monitoring-param", ()): - if monitoring_param["id"] == scaling_criteria["vnf-monitoring-param-ref"]: - scaling_criteria_desc["monitoring_param"] = { - "id": monitoring_param["id"], - "name": monitoring_param["name"], - "aggregation_type": monitoring_param.get("aggregation-type"), - "vdu_name": monitoring_param.get("vdu-ref"), - "vnf_member_index": vnf_member_index, - } - - scaling_policy_desc["scaling_criteria"].append(scaling_criteria_desc) - break - else: - self.logger.error( - "Task ns={} member_vnf_index={} Invalid vnfd vnf-monitoring-param-ref={} not in " - "monitoring-param list".format(nsr_id, vnf_member_index, - scaling_criteria["vnf-monitoring-param-ref"])) - - await self.msg.aiowrite("lcm_pm", "configure_scaling", scaling_desc, self.loop) - async def instantiate(self, nsr_id, nslcmop_id): logging_text = "Task ns={} instantiate={} ".format(nsr_id, nslcmop_id) self.logger.debug(logging_text + "Enter") @@ -846,9 +802,6 @@ class NsLcm(LcmBase): db_nsr_update["config-status"] = "configured" db_nsr_update["detailed-status"] = "done" - # step = "Sending monitoring parameters to PM" - # for c_vnf in nsd["constituent-vnfd"]: - # await self.create_monitoring(nsr_id, c_vnf["member-vnf-index"], needed_vnfd[c_vnf["vnfd-id-ref"]]) return except (ROclient.ROClientException, DbException, LcmException) as e: -- 2.25.1