From 6316219125d503815baf8a869fbacc8c252876ad Mon Sep 17 00:00:00 2001 From: vegall Date: Mon, 6 Mar 2023 14:19:16 +0000 Subject: [PATCH] Feature 10972: Support of volume multi-attach Change-Id: I5adb9d3847c8d11b152cadcf82e46d65de93c833 Signed-off-by: vegall --- osm_lcm/ns.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/osm_lcm/ns.py b/osm_lcm/ns.py index 58d6475..9ceb609 100644 --- a/osm_lcm/ns.py +++ b/osm_lcm/ns.py @@ -963,6 +963,10 @@ class NsLcm(LcmBase): image["vim_info"] = {} for flavor in target["flavor"]: flavor["vim_info"] = {} + if db_nsr.get("shared-volumes"): + target["shared-volumes"] = deepcopy(db_nsr["shared-volumes"]) + for shared_volumes in target["shared-volumes"]: + shared_volumes["vim_info"] = {} if db_nsr.get("affinity-or-anti-affinity-group"): target["affinity-or-anti-affinity-group"] = deepcopy( db_nsr["affinity-or-anti-affinity-group"] @@ -1233,6 +1237,15 @@ class NsLcm(LcmBase): if target_vim not in ns_ags["vim_info"]: ns_ags["vim_info"][target_vim] = {} + # shared-volumes + if vdur.get("shared-volumes-id"): + for sv_id in vdur["shared-volumes-id"]: + ns_sv = find_in_list( + target["shared-volumes"], lambda sv: sv_id in sv["id"] + ) + if ns_sv: + ns_sv["vim_info"][target_vim] = {} + vdur["vim_info"] = {target_vim: {}} # instantiation parameters if vnf_params: -- 2.25.1