image["vim_info"] = {}
for flavor in target["flavor"]:
flavor["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"])
+ for affinity_or_anti_affinity_group in target["affinity-or-anti-affinity-group"]:
+ affinity_or_anti_affinity_group["vim_info"] = {}
if db_nslcmop.get("lcmOperationType") != "instantiate":
# get parameters of instantiation:
if target_vim not in ns_image["vim_info"]:
ns_image["vim_info"][target_vim] = {}
+ # Affinity groups
+ if vdur.get("affinity-or-anti-affinity-group-id"):
+ for ags_id in vdur["affinity-or-anti-affinity-group-id"]:
+ ns_ags = target["affinity-or-anti-affinity-group"][int(ags_id)]
+ if target_vim not in ns_ags["vim_info"]:
+ ns_ags["vim_info"][target_vim] = {}
+
vdur["vim_info"] = {target_vim: {}}
# instantiation parameters
# if vnf_params:
short-name: ALF
ssh-authorized-key: null
flavor : [{"vcpu-count":1,"memory-mb":1024,"storage-gb":"10","vim_info":[],"name":"mgmtVM-flv","id":"0"}]
+ affinity-or-anti-affinity-group : []
image : [ { "image" : "ubuntu16.04", "vim_info" : [ ], "id" : "0" } ]
vld:
- id: mgmt
vim-id: c2538499-4c30-41c0-acd5-80cb92f48061
ns-image-id: 0
ns-flavor-id: 0
+ affinity-or-anti-affinity-group-id : []
- _id: ab453219-2d9a-45c2-864d-2c0788385028
count-index: 0
interfaces:
vim-id: 87973c3f-365d-4227-95c2-7a8abc74349c
ns-image-id: 0
ns-flavor-id: 0
+ affinity-or-anti-affinity-group-id : []
vim-account-id: ea958ba5-4e58-4405-bf42-6e3be15d4c3a
vld:
- id: internal
vim-id: 248077b2-e3b8-4a37-8b72-575abb8ed912
ns-image-id: 0
ns-flavor-id: 0
+ affinity-or-anti-affinity-group-id : []
- _id: 889b874d-e1c3-4e75-aa45-53a9b0ddabd9
count-index: 0
interfaces:
vim-id: a4ce4372-e0ad-4ae3-8f9f-1c969f32e77b
ns-image-id: 0
ns-flavor-id: 0
+ affinity-or-anti-affinity-group-id : []
vim-account-id: ea958ba5-4e58-4405-bf42-6e3be15d4c3a
vld:
- id: internal