X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=NG-RO%2Fosm_ng_ro%2Fns.py;h=a8d7e643b55037fd2b3d7a4be6543d43abe30f3d;hb=a3aca8c5270edf3b13bdcc4ca14e1cf0175d6c5f;hp=3ae392ea4d3db16e436d8c2c74f7646d4ab08cf2;hpb=80c9dd0040eeccccd6abc2ec5b131b1ba672359e;p=osm%2FRO.git diff --git a/NG-RO/osm_ng_ro/ns.py b/NG-RO/osm_ng_ro/ns.py index 3ae392ea..a8d7e643 100644 --- a/NG-RO/osm_ng_ro/ns.py +++ b/NG-RO/osm_ng_ro/ns.py @@ -722,9 +722,12 @@ class Ns(object): guest_epa_quota.get("cpu-pinning-policy") == "DEDICATED" and not epa_vcpu_set ): + # Pinning policy "REQUIRE" uses threads as host should support SMT architecture + # Pinning policy "ISOLATE" uses cores as host should not support SMT architecture + # Pinning policy "PREFER" uses threads in case host supports SMT architecture numa[ "cores" - if guest_epa_quota.get("cpu-thread-pinning-policy") != "PREFER" + if guest_epa_quota.get("cpu-thread-pinning-policy") == "ISOLATE" else "threads" ] = max(vcpu_count, 1) local_epa_vcpu_set = True @@ -2338,15 +2341,23 @@ class Ns(object): # Check each VNF of the target for target_vnf in target_list: - # Find this VNF in the list from DB - vnfr_id = target_vnf.get("vnfInstanceId", None) - if vnfr_id: - existing_vnf = db_vnfrs.get(vnfr_id) - db_record = "vnfrs:{}:{}".format(vnfr_id, db_path) - # vim_account_id = existing_vnf.get("vim-account-id", "") + # Find this VNF in the list from DB, raise exception if vnfInstanceId is not found + vnfr_id = target_vnf["vnfInstanceId"] + existing_vnf = db_vnfrs.get(vnfr_id) + db_record = "vnfrs:{}:{}".format(vnfr_id, db_path) + # vim_account_id = existing_vnf.get("vim-account-id", "") + target_vdus = target_vnf.get("additionalParams", {}).get("vdu", []) # Check each VDU of this VNF - for target_vdu in target_vnf["additionalParams"].get("vdu", None): + if not target_vdus: + # Create target_vdu_list from DB, if VDUs are not specified + target_vdus = [] + for existing_vdu in existing_vnf.get("vdur"): + vdu_name = existing_vdu.get("vdu-name", None) + vdu_index = existing_vdu.get("count-index", 0) + vdu_to_be_healed = {"vdu-id": vdu_name, "count-index": vdu_index} + target_vdus.append(vdu_to_be_healed) + for target_vdu in target_vdus: vdu_name = target_vdu.get("vdu-id", None) # For multi instance VDU count-index is mandatory # For single session VDU count-indes is 0