return trp_link_characteristics
+ # TODO: Review if we should adapt this method with SOL006 /nsd/vnfd/int-virtual-link-desc/df/qos fields.
def _produce_vld_desc(self):
"""
Creates the expected vlds from the nsd. Includes constraints if part of nsd.
Overrides constraints with any syntactically correct instantiation parameters
:return:
"""
+
+ all_vld_member_vnf_index_refs = {}
+ # TODO: Change for multiple DF support
+ ns_df = self._nsd.get('df', [{}])[0]
+ for vnf_profile in ns_df.get('vnf-profile', []):
+ for vlc in vnf_profile.get('virtual-link-connectivity', []):
+ vld_id = vlc.get('virtual-link-profile-id')
+ vld_member_vnf_index_ref = vnf_profile.get('id')
+ if vld_id in all_vld_member_vnf_index_refs:
+ all_vld_member_vnf_index_refs[vld_id].append(vld_member_vnf_index_ref)
+ else:
+ all_vld_member_vnf_index_refs[vld_id] = [vld_member_vnf_index_ref]
+
vld_desc = []
- for vld in self._nsd['vld']:
- if vld.get('mgmt-network', False) is False:
- vld_desc_entry = {}
- cp_refs = [ep_ref['member-vnf-index-ref'] for ep_ref in vld['vnfd-connection-point-ref']]
- if len(cp_refs) == 2:
- vld_desc_entry['cp_refs'] = cp_refs
- if 'link-constraint' in vld.keys():
- for constraint in vld['link-constraint']:
- if constraint['constraint-type'] == 'LATENCY':
- vld_desc_entry['latency'] = constraint['value']
- elif constraint['constraint-type'] == 'JITTER':
- vld_desc_entry['jitter'] = constraint['value']
- vld_desc.append(vld_desc_entry)
+ for vld in self._nsd.get('virtual-link-desc', ()):
+ if vld.get('mgmt-network', False) is True:
+ continue
+ vld_desc_entry = {}
+ cp_refs = all_vld_member_vnf_index_refs[vld.get('id')]
+ if len(cp_refs) == 2:
+ vld_desc_entry['cp_refs'] = cp_refs
+ # TODO: Change for multiple DF support
+ vld_df = vld.get('df', [{}])[0]
+ for constraint in vld_df.get('qos', {}):
+ if constraint == 'latency':
+ vld_desc_entry['latency'] = vld_df['qos'][constraint]
+ elif constraint == 'packet-delay-variation':
+ vld_desc_entry['jitter'] = vld_df['qos'][constraint]
+ vld_desc.append(vld_desc_entry)
# create candidates from instantiate params
if self._order_constraints is not None:
candidate_vld_desc = []
# use id to find the endpoints in the nsd
for entry in self._order_constraints.get('vld-constraints'):
- for vld in self._nsd['vld']:
- if entry['id'] == vld['id']:
+ for vld in self._nsd.get('virtual-link-desc', ()):
+ if entry['id'] == vld.get('id'):
vld_desc_instantiate_entry = {}
- cp_refs = [ep_ref['member-vnf-index-ref'] for ep_ref in vld['vnfd-connection-point-ref']]
+ cp_refs = all_vld_member_vnf_index_refs[vld.get('id')]
vld_desc_instantiate_entry['cp_refs'] = cp_refs
# add whatever constraints that are provided to the vld_desc_entry
# misspelled 'link-constraints' => empty dict
vld_desc_instantiate_entry['latency'] = value
elif constraint == 'jitter':
vld_desc_instantiate_entry['jitter'] = value
- if set(['latency', 'jitter']).intersection(vld_desc_instantiate_entry.keys()):
+ if {'latency', 'jitter'}.intersection(vld_desc_instantiate_entry.keys()):
candidate_vld_desc.append(vld_desc_instantiate_entry)
# merge with nsd originated, FIXME log any deviations?
for vld_d in vld_desc:
for the vim_accounts that are applicable, collect the vnf_price
"""
ns_desc = []
- for vnfd in self._nsd['constituent-vnfd']:
- vnf_info = {'vnf_id': vnfd['member-vnf-index']}
+ # TODO: Change for multiple DF support
+ ns_df = self._nsd.get('df', [{}])[0]
+ for vnf_profile in ns_df.get('vnf-profile', []):
+ vnf_info = {'vnf_id': vnf_profile['id']}
# prices
- prices_for_vnfd = self._vnf_prices[vnfd['vnfd-id-ref']]
+ prices_for_vnfd = self._vnf_prices[vnf_profile['vnfd-id']]
# the list of prices must be ordered according to the indexing of the vim_accounts
price_list = [_ for _ in range(len(self._vim_accounts_info))]
for k in prices_for_vnfd.keys():
# pinning to dc
if self._pinning is not None:
for pinned_vnf in self._pinning:
- if vnfd['member-vnf-index'] == pinned_vnf['member-vnf-index']:
+ if vnf_profile['id'] == pinned_vnf['member-vnf-index']:
vnf_info['vim_account'] = 'vim' + pinned_vnf['vimAccountId'].replace('-', '_')
ns_desc.append(vnf_info)
return tuples with mappings {<adjusted id>: <original id>} and {<original id>: <adjusted id>}
"""
+ # TODO: Change for multiple DF support
+ ns_df = nsd.get('df', [{}])[0]
next_idx = itertools.count()
- member_vnf_index2mzn = {e['member-vnf-index']: 'VNF' + str(next(next_idx)) for e in
- nsd['constituent-vnfd']}
+ member_vnf_index2mzn = {e['id']: 'VNF' + str(next(next_idx)) for e in
+ ns_df.get('vnf-profile', [])}
# reverse the name map dictionary, used when the placement result is remapped
mzn_name2member_vnf_index = {v: k for k, v in member_vnf_index2mzn.items()}
nsd = self._get_nsd(nslcmop['operationParams']['nsdId'])
member_vnf_index2mzn, mzn2member_vnf_index = self._create_vnf_id_maps(nsd)
# adjust vnf identifiers
- for e in nsd['constituent-vnfd']:
- e['member-vnf-index'] = member_vnf_index2mzn[e['member-vnf-index']]
- for vld in nsd['vld']:
- for cp_ref in vld['vnfd-connection-point-ref']:
- cp_ref['member-vnf-index-ref'] = member_vnf_index2mzn[cp_ref['member-vnf-index-ref']]
+ # TODO: Change for multiple DF support
+ ns_df = nsd.get('df', [{}])[0]
+ for vnf_profile in ns_df.get('vnf-profile', []):
+ vnf_profile['id'] = member_vnf_index2mzn[vnf_profile['id']]
+ for vlc in vnf_profile.get('virtual-link-connectivity', []):
+ for ccpd in vlc.get('constituent-cpd-id', []):
+ ccpd['constituent-base-element-id'] = member_vnf_index2mzn[ccpd['constituent-base-element-id']]
self.log.info("adjusted nsd: {}".format(nsd))
projects = self._get_projects()
self.log.info("projects: {}".format(projects))
vims_information = {_['name']: _['_id'] for _ in vim_accounts_data}
price_list = self._get_vnf_price_list(Server.vnf_price_list_file, projects[nslcmop_project])
pil_info = self._get_pil_info(Server.pil_price_list_file)
- pinnings = nslcmop['operationParams'].get('vnf')
+ pinnings = nslcmop['operationParams'].get('vnf', [])
# remap member-vnf-index values according to id map
for pinning in pinnings:
pinning['member-vnf-index'] = member_vnf_index2mzn[pinning['member-vnf-index']]
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-nsd:nsd-catalog:
- nsd:
- - constituent-vnfd:
- - member-vnf-index: 1
- vnfd-id-ref: cirros_vnfd_v2
- - member-vnf-index: 2
- vnfd-id-ref: cirros_vnfd_v2
- - member-vnf-index: 3
- vnfd-id-ref: cirros_vnfd_v2
- description: Placement constraints NSD
- id: three_vnf_constrained_nsd
- name: three_vnf_constrained_nsd
- short-name: three_vnf_constrained_nsd
- vendor: ArctosLabs
- version: '1.0'
- vld:
- - id: three_vnf_constrained_nsd_vld1
- link-constraint:
- - constraint-type: LATENCY
- value: 150
- - constraint-type: JITTER
- value: 30
- mgmt-network: !!bool False
- name: ns_constrained_nsd_vld1
- short-name: ns_constrained_nsd_vld1
- type: ELAN
- vim-network-name: private
- vnfd-connection-point-ref:
- - member-vnf-index-ref: 1
- vnfd-connection-point-ref: vnf-cp0
- vnfd-id-ref: cirros_vnfd_v2
- - member-vnf-index-ref: 2
- vnfd-connection-point-ref: vnf-cp0
- vnfd-id-ref: cirros_vnfd_v2
- - id: three_vnf_constrained_nsd_vld2
- link-constraint:
- - constraint-type: LATENCY
- value: 90
- - constraint-type: JITTER
- value: 30
- mgmt-network: !!bool False
- name: ns_constrained_nsd_vld2
- short-name: ns_constrained_nsd_vld2
- type: ELAN
- vim-network-name: private
- vnfd-connection-point-ref:
- - member-vnf-index-ref: 2
- vnfd-connection-point-ref: vnf-cp0
- vnfd-id-ref: cirros_vnfd_v2
- - member-vnf-index-ref: 3
- vnfd-connection-point-ref: vnf-cp0
- vnfd-id-ref: cirros_vnfd_v2
\ No newline at end of file
+nsd:
+ nsd:
+ - description: Placement constraints NSD
+ designer: ArctosLabs
+ df:
+ - id: default-df
+ vnf-profile:
+ - id: '1' # Old member-vnf-index
+ virtual-link-connectivity:
+ - constituent-cpd-id:
+ - constituent-base-element-id: '1'
+ constituent-cpd-id: vnf-cp0-ext
+ virtual-link-profile-id: three_vnf_constrained_nsd_vld1
+ vnfd-id: cirros_vnfd_v2
+ - id: '2'
+ virtual-link-connectivity:
+ - constituent-cpd-id:
+ - constituent-base-element-id: '2'
+ constituent-cpd-id: vnf-cp0-ext
+ virtual-link-profile-id: three_vnf_constrained_nsd_vld1
+ - constituent-cpd-id:
+ - constituent-base-element-id: '2'
+ constituent-cpd-id: vnf-cp0-ext
+ virtual-link-profile-id: three_vnf_constrained_nsd_vld2
+ vnfd-id: cirros_vnfd_v2
+ - id: '3'
+ virtual-link-connectivity:
+ - constituent-cpd-id:
+ - constituent-base-element-id: '3'
+ constituent-cpd-id: vnf-cp0-ext
+ virtual-link-profile-id: three_vnf_constrained_nsd_vld2
+ vnfd-id: cirros_vnfd_v2
+ id: three_vnf_constrained_nsd
+ name: three_vnf_constrained_nsd
+ version: '1.0'
+ virtual-link-desc:
+ - id: three_vnf_constrained_nsd_vld1
+ vim-network-name: private
+ df:
+ - id: default-df
+ qos:
+ latency: 90
+ packet-delay-variation: 30
+ - id: three_vnf_constrained_nsd_vld2
+ vim-network-name: private
+ df:
+ - id: default-df
+ qos:
+ latency: 150
+ packet-delay-variation: 30
+ vnfd-id:
+ - cirros_vnfd_v2
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-nsd:nsd-catalog:
- nsd:
- - constituent-vnfd:
- - member-vnf-index: one
- vnfd-id-ref: cirros_vnfd_v2
- - member-vnf-index: two
- vnfd-id-ref: cirros_vnfd_v2
- - member-vnf-index: three
- vnfd-id-ref: cirros_vnfd_v2
- description: Placement no constraints NSD
- id: three_vnf_no_constrained_nsd
- name: three_vnf_no_constrained_nsd
- short-name: three_vnf_no_constrained_nsd
- vendor: ArctosLabs
- version: '1.0'
- vld:
- - id: three_vnf_no_constrained_nsd_vld1
- link-constraint:
- - constraint-type: JITTER
- value: 30
- mgmt-network: !!bool False
- name: ns_no_constrained_nsd_vld1
- short-name: ns_no_constrained_nsd_vld1
- type: ELAN
- vim-network-name: private
- vnfd-connection-point-ref:
- - member-vnf-index-ref: one
- vnfd-connection-point-ref: vnf-cp0
- vnfd-id-ref: cirros_vnfd_v2
- - member-vnf-index-ref: two
- vnfd-connection-point-ref: vnf-cp0
- vnfd-id-ref: cirros_vnfd_v2
- - id: three_vnf_no_constrained_nsd_vld2
- link-constraint:
- - constraint-type: LATENCY
- value: 120
- mgmt-network: !!bool False
- name: ns_no_constrained_nsd_vld2
- short-name: ns_no_constrained_nsd_vld2
- type: ELAN
- vim-network-name: private
- vnfd-connection-point-ref:
- - member-vnf-index-ref: two
- vnfd-connection-point-ref: vnf-cp0
- vnfd-id-ref: cirros_vnfd_v2
- - member-vnf-index-ref: three
- vnfd-connection-point-ref: vnf-cp0
- vnfd-id-ref: cirros_vnfd_v2
\ No newline at end of file
+nsd:
+ nsd:
+ - description: Placement no constraints NSD
+ designer: ArctosLabs
+ df:
+ - id: default-df
+ vnf-profile:
+ - id: one
+ virtual-link-connectivity:
+ - constituent-cpd-id:
+ - constituent-base-element-id: one
+ constituent-cpd-id: vnf-cp0-ext
+ virtual-link-profile-id: three_vnf_no_constrained_nsd_vld1
+ vnfd-id: cirros_vnfd_v2
+ - id: two
+ virtual-link-connectivity:
+ - constituent-cpd-id:
+ - constituent-base-element-id: two
+ constituent-cpd-id: vnf-cp0-ext
+ virtual-link-profile-id: three_vnf_no_constrained_nsd_vld1
+ - constituent-cpd-id:
+ - constituent-base-element-id: two
+ constituent-cpd-id: vnf-cp0-ext
+ virtual-link-profile-id: three_vnf_no_constrained_nsd_vld2
+ vnfd-id: cirros_vnfd_v2
+ - id: three
+ virtual-link-connectivity:
+ - constituent-cpd-id:
+ - constituent-base-element-id: three
+ constituent-cpd-id: vnf-cp0-ext
+ virtual-link-profile-id: three_vnf_no_constrained_nsd_vld2
+ vnfd-id: cirros_vnfd_v2
+ id: three_vnf_no_constrained_nsd
+ name: three_vnf_no_constrained_nsd
+ version: '1.0'
+
+ virtual-link-desc:
+ - id: three_vnf_no_constrained_nsd_vld1
+ vim-network-name: private
+ df:
+ - id: default-df
+ qos:
+ packet-delay-variation: 30
+ - id: three_vnf_no_constrained_nsd_vld2
+ vim-network-name: private
+ df:
+ - id: default-df
+ qos:
+ latency: 120
+ vnfd-id:
+ - cirros_vnfd_v2
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-nsd:nsd-catalog:
+nsd:
nsd:
- - constituent-vnfd:
- - member-vnf-index: one
- vnfd-id-ref: cirros_vnfd_v2
- - member-vnf-index: two
- vnfd-id-ref: cirros_vnfd_v2
- - member-vnf-index: three
- vnfd-id-ref: cirros_vnfd_v2
- description: Placement constraints NSD
+ - vnfd-id:
+ - cirros_vnfd_v2
+
id: three_vnf_constrained_nsd
+ description: Placement constraints NSD
name: three_vnf_constrained_nsd
- short-name: three_vnf_constrained_nsd
- vendor: ArctosLabs
+ designer: ArctosLabs
version: '1.0'
- vld:
+
+ virtual-link-desc:
- id: three_vnf_constrained_nsd_vld1
- link-constraint:
- - constraint-type: LATENCY
- value: 150
- - constraint-type: JITTER
- value: 30
- mgmt-network: !!bool False
- name: ns_constrained_nsd_vld1
- short-name: ns_constrained_nsd_vld1
- type: ELAN
vim-network-name: private
- vnfd-connection-point-ref:
- - member-vnf-index-ref: one
- vnfd-connection-point-ref: vnf-cp0
- vnfd-id-ref: cirros_vnfd_v2
- - member-vnf-index-ref: two
- vnfd-connection-point-ref: vnf-cp0
- vnfd-id-ref: cirros_vnfd_v2
+ df:
+ - id: default-df
+ qos:
+ latency: 150
+ packet-delay-variation: 30
- id: three_vnf_constrained_nsd_vld2
- link-constraint:
- - constraint-type: LATENCY
- value: 90
- - constraint-type: JITTER
- value: 30
- mgmt-network: !!bool False
- name: ns_constrained_nsd_vld2
- short-name: ns_constrained_nsd_vld2
- type: ELAN
vim-network-name: private
- vnfd-connection-point-ref:
- - member-vnf-index-ref: two
- vnfd-connection-point-ref: vnf-cp0
- vnfd-id-ref: cirros_vnfd_v2
- - member-vnf-index-ref: three
- vnfd-connection-point-ref: vnf-cp0
- vnfd-id-ref: cirros_vnfd_v2
\ No newline at end of file
+ df:
+ - id: default-df
+ qos:
+ latency: 90
+ packet-delay-variation: 30
+
+ df:
+ - id: default-df
+ vnf-profile:
+ - id: one
+ virtual-link-connectivity:
+ - constituent-cpd-id:
+ - constituent-base-element-id: one
+ constituent-cpd-id: vnf-cp0-ext
+ virtual-link-profile-id: three_vnf_constrained_nsd_vld1
+ vnfd-id: cirros_vnfd_v2
+ - id: two
+ virtual-link-connectivity:
+ - constituent-cpd-id:
+ - constituent-base-element-id: two
+ constituent-cpd-id: vnf-cp0-ext
+ virtual-link-profile-id: three_vnf_constrained_nsd_vld1
+ - constituent-cpd-id:
+ - constituent-base-element-id: two
+ constituent-cpd-id: vnf-cp0-ext
+ virtual-link-profile-id: three_vnf_constrained_nsd_vld2
+ vnfd-id: cirros_vnfd_v2
+ - id: three
+ virtual-link-connectivity:
+ - constituent-cpd-id:
+ - constituent-base-element-id: three
+ constituent-cpd-id: vnf-cp0-ext
+ virtual-link-profile-id: three_vnf_constrained_nsd_vld2
+ vnfd-id: cirros_vnfd_v2
+
+
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-nsd:nsd-catalog:
- nsd:
- - constituent-vnfd:
- - member-vnf-index: 1
- vnfd-id-ref: hackfest-basic_vnfd
- description: Generated by OSM package generator
- id: hackfest-basic_nsd
- name: hackfest-basic_nsd
- short-name: hackfest-basic_nsd
- vendor: Abubakr Magzoub, Lancaster University
- version: '1.0'
- vld:
- - id: hackfest-basic_nsd_vld0
- mgmt-network: !!bool True
- name: management
- short-name: management
- type: ELAN
- vnfd-connection-point-ref:
- - member-vnf-index-ref: 1
- vnfd-connection-point-ref: vnf-cp0
- vnfd-id-ref: hackfest-basic_vnfd
+nsd:
+ nsd:
+ - description: Generated by OSM package generator
+ designer: Abubakr Magzoub, Lancaster University
+ df:
+ - id: default-df
+ vnf-profile:
+ - id: '1'
+ virtual-link-connectivity:
+ - constituent-cpd-id:
+ - constituent-base-element-id: '1'
+ constituent-cpd-id: vnf-cp0-ext
+ virtual-link-profile-id: hackfest-basic_nsd_vld0
+ vnfd-id: hackfest-basic_vnfd
+ id: hackfest-basic_nsd
+ name: hackfest-basic_nsd
+ version: '1.0'
+ virtual-link-desc:
+ - id: hackfest-basic_nsd_vld0
+ mgmt-network: true
+ vnfd-id:
+ - hackfest-basic_vnfd
+
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-nsd:nsd-catalog:
- nsd:
- - constituent-vnfd:
- - member-vnf-index: one
- vnfd-id-ref: cirros_vnfd_v2
- - member-vnf-index: two
- vnfd-id-ref: cirros_vnfd_v2
- - member-vnf-index: three
- vnfd-id-ref: cirros_vnfd_v2
- description: Placement constraints NSD
- id: three_vnf_constrained_nsd
- name: three_vnf_constrained_nsd
- short-name: three_vnf_constrained_nsd
- vendor: ArctosLabs
- version: '1.0'
- vld:
- - id: three_vnf_constrained_nsd_vld1
- mgmt-network: !!bool False
- name: ns_constrained_nsd_vld1
- short-name: ns_constrained_nsd_vld1
- type: ELAN
- vim-network-name: private
- vnfd-connection-point-ref:
- - member-vnf-index-ref: one
- vnfd-connection-point-ref: vnf-cp0
- vnfd-id-ref: cirros_vnfd_v2
- - member-vnf-index-ref: two
- vnfd-connection-point-ref: vnf-cp0
- vnfd-id-ref: cirros_vnfd_v2
- - id: three_vnf_constrained_nsd_vld2
- mgmt-network: !!bool False
- name: ns_constrained_nsd_vld2
- short-name: ns_constrained_nsd_vld2
- type: ELAN
- vim-network-name: private
- vnfd-connection-point-ref:
- - member-vnf-index-ref: two
- vnfd-connection-point-ref: vnf-cp0
- vnfd-id-ref: cirros_vnfd_v2
- - member-vnf-index-ref: three
- vnfd-connection-point-ref: vnf-cp0
- vnfd-id-ref: cirros_vnfd_v2
\ No newline at end of file
+nsd:
+ nsd:
+ - description: Placement constraints NSD
+ designer: ArctosLabs
+ df:
+ - id: default-df
+ vnf-profile:
+ - id: one
+ virtual-link-connectivity:
+ - constituent-cpd-id:
+ - constituent-base-element-id: one
+ constituent-cpd-id: vnf-cp0-ext
+ virtual-link-profile-id: three_vnf_constrained_nsd_vld1
+ vnfd-id: cirros_vnfd_v2
+ - id: two
+ virtual-link-connectivity:
+ - constituent-cpd-id:
+ - constituent-base-element-id: two
+ constituent-cpd-id: vnf-cp0-ext
+ virtual-link-profile-id: three_vnf_constrained_nsd_vld1
+ - constituent-cpd-id:
+ - constituent-base-element-id: two
+ constituent-cpd-id: vnf-cp0-ext
+ virtual-link-profile-id: three_vnf_constrained_nsd_vld2
+ vnfd-id: cirros_vnfd_v2
+ - id: three
+ virtual-link-connectivity:
+ - constituent-cpd-id:
+ - constituent-base-element-id: three
+ constituent-cpd-id: vnf-cp0-ext
+ virtual-link-profile-id: three_vnf_constrained_nsd_vld2
+ vnfd-id: cirros_vnfd_v2
+ id: three_vnf_constrained_nsd
+ name: three_vnf_constrained_nsd
+ version: '1.0'
+ virtual-link-desc:
+ - id: three_vnf_constrained_nsd_vld1
+ vim-network-name: private
+ - id: three_vnf_constrained_nsd_vld2
+ vim-network-name: private
+ vnfd-id:
+ - cirros_vnfd_v2
# See the License for the specific language governing permissions and\r
# limitations under the License.\r
\r
-nsd-catalog:\r
- nsd:\r
- - id: slice_hackfest_middle_nsd\r
- name: slice_hackfest_middle_nsd\r
- short-name: slice_hackfest_middle_ns\r
- description: NSD to be used on Slice Session of the 8th hackfest\r
- vendor: OSM\r
- version: '1.0'\r
- logo: osm_2x.png\r
-\r
- constituent-vnfd:\r
- - member-vnf-index: "1"\r
- vnfd-id-ref: slice_hackfest_middle_vnfd\r
-\r
- connection-point:\r
- - name: nsd_cp_mgmt\r
- vld-id-ref: nsd_vnfd_vld_mgmt\r
- - name: nsd_cp_data1\r
- vld-id-ref: nsd_vnfd_vld_data1\r
- - name: nsd_cp_data2\r
- vld-id-ref: nsd_vnfd_vld_data2\r
-\r
- vld:\r
- - id: nsd_vnfd_vld_mgmt\r
- name: nsd_vnfd_vld_mgmt\r
- short-name: nsd_vnfd_vld_mgmt\r
- type: ELAN\r
- mgmt-network: !!bool True\r
- vnfd-connection-point-ref:\r
- - member-vnf-index-ref: "1"\r
- vnfd-id-ref: slice_hackfest_middle_vnfd\r
- vnfd-connection-point-ref: eth0\r
- - id: nsd_vnfd_vld_data1\r
- name: nsd_vnfd_vld_data1\r
- short-name: nsd_vnfd_vld_data1\r
- type: ELAN\r
- mgmt-network: !!bool False\r
- vnfd-connection-point-ref:\r
- - member-vnf-index-ref: "1"\r
- vnfd-id-ref: slice_hackfest_middle_vnfd\r
- vnfd-connection-point-ref: eth1\r
- - id: nsd_vnfd_vld_data2\r
- name: nsd_vnfd_vld_data2\r
- short-name: nsd_vnfd_vld_data2\r
- type: ELAN\r
- mgmt-network: !!bool False\r
- vnfd-connection-point-ref:\r
- - member-vnf-index-ref: "1"\r
- vnfd-id-ref: slice_hackfest_middle_vnfd\r
- vnfd-connection-point-ref: eth2
\ No newline at end of file
+nsd:\r
+ nsd:\r
+ - description: NSD to be used on Slice Session of the 8th hackfest\r
+ designer: OSM\r
+ df:\r
+ - id: default-df\r
+ vnf-profile:\r
+ - id: '1'\r
+ virtual-link-connectivity:\r
+ - constituent-cpd-id:\r
+ - constituent-base-element-id: '1'\r
+ constituent-cpd-id: eth0-ext\r
+ virtual-link-profile-id: nsd_vnfd_vld_mgmt\r
+ - constituent-cpd-id:\r
+ - constituent-base-element-id: '1'\r
+ constituent-cpd-id: eth1-ext\r
+ virtual-link-profile-id: nsd_vnfd_vld_data1\r
+ - constituent-cpd-id:\r
+ - constituent-base-element-id: '1'\r
+ constituent-cpd-id: eth2-ext\r
+ virtual-link-profile-id: nsd_vnfd_vld_data2\r
+ vnfd-id: slice_hackfest_middle_vnfd\r
+ id: slice_hackfest_middle_nsd\r
+ name: slice_hackfest_middle_nsd\r
+ version: '1.0'\r
+ virtual-link-desc:\r
+ - id: nsd_vnfd_vld_mgmt\r
+ mgmt-network: true\r
+ - id: nsd_vnfd_vld_data1\r
+ - id: nsd_vnfd_vld_data2\r
+ vnfd-id:\r
+ - slice_hackfest_middle_vnfd
\ No newline at end of file
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-nsd:nsd-catalog:
+nsd:
nsd:
- description: Four cirros VNF latency and jitter constrained
+ designer: ArctosLabs
+ df:
+ - id: default-df
+ vnf-profile:
+ - id: '1'
+ virtual-link-connectivity:
+ - constituent-cpd-id:
+ - constituent-base-element-id: '1'
+ constituent-cpd-id: vnf_cp_one_cp-ext
+ virtual-link-profile-id: vl_two_vld
+ - constituent-cpd-id:
+ - constituent-base-element-id: '1'
+ constituent-cpd-id: vnf_cp_two_cp-ext
+ virtual-link-profile-id: vld_vnf_mgmt1
+ - constituent-cpd-id:
+ - constituent-base-element-id: '1'
+ constituent-cpd-id: vnf_cp_two_cp-ext
+ virtual-link-profile-id: vld_vnf_mgmt2
+ vnfd-id: test_one_a_vnfd
+ - id: '2'
+ virtual-link-connectivity:
+ - constituent-cpd-id:
+ - constituent-base-element-id: '2'
+ constituent-cpd-id: vnf_cp_one_cp-ext
+ virtual-link-profile-id: vl_two_vld
+ - constituent-cpd-id:
+ - constituent-base-element-id: '2'
+ constituent-cpd-id: vnf_cp_three_cp-ext
+ virtual-link-profile-id: vl_four_vld
+ - constituent-cpd-id:
+ - constituent-base-element-id: '2'
+ constituent-cpd-id: vnf_cp_two_cp-ext
+ virtual-link-profile-id: vl_five_vld
+ vnfd-id: test_two_vnfd
+ - id: '4'
+ virtual-link-connectivity:
+ - constituent-cpd-id:
+ - constituent-base-element-id: '4'
+ constituent-cpd-id: vnf_cp_one_cp-ext
+ virtual-link-profile-id: vl_four_vld
+ - constituent-cpd-id:
+ - constituent-base-element-id: '4'
+ constituent-cpd-id: vnf_cp_two_cp-ext
+ virtual-link-profile-id: vld_vnf_mgmt2
+ vnfd-id: test_one_a_vnfd
+ - id: '3'
+ virtual-link-connectivity:
+ - constituent-cpd-id:
+ - constituent-base-element-id: '3'
+ constituent-cpd-id: vnf_cp_one_cp-ext
+ virtual-link-profile-id: vl_five_vld
+ - constituent-cpd-id:
+ - constituent-base-element-id: '3'
+ constituent-cpd-id: vnf_cp_two_cp-ext
+ virtual-link-profile-id: vld_vnf_mgmt1
+ vnfd-id: test_one_a_vnfd
id: test_five_nsd
name: test_five_nsd
- short-name: test_five_nsd
- vendor: ArctosLabs
version: '1.0'
- constituent-vnfd:
- - member-vnf-index: 1
- vnfd-id-ref: test_one_a_vnfd
- - member-vnf-index: 2
- vnfd-id-ref: test_two_vnfd
- - member-vnf-index: 3
- vnfd-id-ref: test_one_a_vnfd
- - member-vnf-index: 4
- vnfd-id-ref: test_one_a_vnfd
- vld:
- - name: vl_two_vld
- id: vl_two_vld
- mgmt-network: !!bool False
- type: ELAN
- link-constraint:
- - constraint-type: LATENCY
- value: 120
- - constraint-type: JITTER
- value: 20
- vnfd-connection-point-ref:
- - member-vnf-index-ref: '1'
- vnfd-connection-point-ref: vnf_cp_one_cp
- vnfd-id-ref: test_one_a_vnfd
- - member-vnf-index-ref: '2'
- vnfd-connection-point-ref: vnf_cp_one_cp
- vnfd-id-ref: test_two_vnfd
- - name: vl_four_vld
- id: vl_four_vld
- mgmt-network: !!bool False
- type: ELAN
- link-constraint:
- - constraint-type: LATENCY
- value: 50
- - constraint-type: JITTER
- value: 10
- vnfd-connection-point-ref:
- - member-vnf-index-ref: '2'
- vnfd-connection-point-ref: vnf_cp_three_cp
- vnfd-id-ref: test_two_vnfd
- - member-vnf-index-ref: '4'
- vnfd-connection-point-ref: vnf_cp_one_cp
- vnfd-id-ref: test_one_a_vnfd
- - name: vl_five_vld
- id: vl_five_vld
- mgmt-network: !!bool False
- type: ELAN
- link-constraint:
- - constraint-type: LATENCY
- value: 20
- - constraint-type: JITTER
- value: 10
- vnfd-connection-point-ref:
- - member-vnf-index-ref: '2'
- vnfd-connection-point-ref: vnf_cp_two_cp
- vnfd-id-ref: test_two_vnfd
- - member-vnf-index-ref: '3'
- vnfd-connection-point-ref: vnf_cp_one_cp
- vnfd-id-ref: test_one_a_vnfd
- - name: vld_vnf_mgmt
- id: vld_vnf_mgmt1
- mgmt-network: !!bool True
- type: ELAN
- vnfd-connection-point-ref:
- - member-vnf-index-ref: '1'
- vnfd-connection-point-ref: vnf_cp_two_cp
- vnfd-id-ref: test_one_a_vnfd
- - member-vnf-index-ref: '3'
- vnfd-connection-point-ref: vnf_cp_two_cp
- vnfd-id-ref: test_one_a_vnfd
- - name: vld_vnf_mgmt
- id: vld_vnf_mgmt2
- mgmt-network: !!bool True
- type: ELAN
- vnfd-connection-point-ref:
- - member-vnf-index-ref: '1'
- vnfd-connection-point-ref: vnf_cp_two_cp
- vnfd-id-ref: test_one_a_vnfd
- - member-vnf-index-ref: '4'
- vnfd-connection-point-ref: vnf_cp_two_cp
- vnfd-id-ref: test_one_a_vnfd
+ virtual-link-desc:
+ - id: vl_two_vld
+ df:
+ - id: default-df
+ qos:
+ latency: 120
+ packet-delay-variation: 20
+ - id: vl_four_vld
+ df:
+ - id: default-df
+ qos:
+ latency: 50
+ packet-delay-variation: 10
+ - id: vl_five_vld
+ df:
+ - id: default-df
+ qos:
+ latency: 20
+ packet-delay-variation: 10
+ - id: vld_vnf_mgmt1
+ mgmt-network: true
+ - id: vld_vnf_mgmt2
+ mgmt-network: true
+ vnfd-id:
+ - test_one_a_vnfd
+ - test_two_vnfd
{'cp_refs': ['two', 'three'], 'latency': 120}]
nsd = self._get_ut_nsd_from_file('nsd_unittest2.yaml')
- nsd = nsd['nsd:nsd-catalog']['nsd'][0]
+ nsd = nsd['nsd']['nsd'][0]
nspdf = NsPlacementDataFactory(self._produce_ut_vim_accounts_info(TestNsPlacementDataFactory.vim_accounts),
self._produce_ut_vnf_price_list(),
nsd=nsd,
{'cp_refs': ['two', 'three'], 'latency': 90, 'jitter': 30}]
nsd = self._get_ut_nsd_from_file('nsd_unittest_no_vld_constraints.yaml')
- nsd = nsd['nsd:nsd-catalog']['nsd'][0]
+ nsd = nsd['nsd']['nsd'][0]
nspdf = NsPlacementDataFactory(self._produce_ut_vim_accounts_info(TestNsPlacementDataFactory.vim_accounts),
self._produce_ut_vnf_price_list(),
nsd=nsd,
{'cp_refs': ['two', 'three'], 'latency': 90, 'jitter': 30}]
nsd = self._get_ut_nsd_from_file('nsd_unittest3.yaml')
- nsd = nsd['nsd:nsd-catalog']['nsd'][0]
+ nsd = nsd['nsd']['nsd'][0]
nspdf = NsPlacementDataFactory(self._produce_ut_vim_accounts_info(TestNsPlacementDataFactory.vim_accounts),
self._produce_ut_vnf_price_list(),
nsd=nsd,
{'cp_refs': ['two', 'three'], 'latency': 121, 'jitter': 22}]
nsd = self._get_ut_nsd_from_file('nsd_unittest3.yaml')
- nsd = nsd['nsd:nsd-catalog']['nsd'][0]
+ nsd = nsd['nsd']['nsd'][0]
nspdf = NsPlacementDataFactory(self._produce_ut_vim_accounts_info(TestNsPlacementDataFactory.vim_accounts),
self._produce_ut_vnf_price_list(),
nsd=nsd,
{'cp_refs': ['two', 'three']}]
nsd = self._get_ut_nsd_from_file('nsd_unittest_no_vld_constraints.yaml')
- nsd = nsd['nsd:nsd-catalog']['nsd'][0]
+ nsd = nsd['nsd']['nsd'][0]
nspdf = NsPlacementDataFactory(self._produce_ut_vim_accounts_info(TestNsPlacementDataFactory.vim_accounts),
self._produce_ut_vnf_price_list(),
nsd=nsd,
{'cp_refs': ['two', 'three'], 'latency': 141, 'jitter': 42}]
nsd = self._get_ut_nsd_from_file('nsd_unittest_no_vld_constraints.yaml')
- nsd = nsd['nsd:nsd-catalog']['nsd'][0]
+ nsd = nsd['nsd']['nsd'][0]
nspdf = NsPlacementDataFactory(self._produce_ut_vim_accounts_info(TestNsPlacementDataFactory.vim_accounts),
self._produce_ut_vnf_price_list(),
nsd=nsd,
{'cp_refs': ['two', 'three'], 'latency': 151}]
nsd = self._get_ut_nsd_from_file('nsd_unittest_no_vld_constraints.yaml')
- nsd = nsd['nsd:nsd-catalog']['nsd'][0]
+ nsd = nsd['nsd']['nsd'][0]
nspdf = NsPlacementDataFactory(self._produce_ut_vim_accounts_info(TestNsPlacementDataFactory.vim_accounts),
self._produce_ut_vnf_price_list(),
nsd=nsd,
{'cp_refs': ['two', 'three']}]
nsd = self._get_ut_nsd_from_file('nsd_unittest_no_vld_constraints.yaml')
- nsd = nsd['nsd:nsd-catalog']['nsd'][0]
+ nsd = nsd['nsd']['nsd'][0]
nspdf = NsPlacementDataFactory(self._produce_ut_vim_accounts_info(TestNsPlacementDataFactory.vim_accounts),
self._produce_ut_vnf_price_list(),
nsd=nsd,
{'cp_refs': ['2', '3'], 'latency': 20, 'jitter': 10}, ]
nsd = self._get_ut_nsd_from_file('test_five_nsd.yaml')
- nsd = nsd['nsd:nsd-catalog']['nsd'][0]
+ nsd = nsd['nsd']['nsd'][0]
nspdf = NsPlacementDataFactory(self._produce_ut_vim_accounts_info(TestNsPlacementDataFactory.vim_accounts),
self._produce_ut_vnf_price_list(),
nsd=nsd,
vld_desc_expected = []
nsd = self._get_ut_nsd_from_file('nsd_unittest4.yaml')
- nsd = nsd['nsd:nsd-catalog']['nsd'][0]
+ nsd = nsd['nsd']['nsd'][0]
nspdf = NsPlacementDataFactory(self._produce_ut_vim_accounts_info(TestNsPlacementDataFactory.vim_accounts),
self._produce_ut_vnf_price_list(),
nsd=nsd,
def test__produce_vld_desc_slice_nsd(self):
vld_desc_expected = []
nsd = self._get_ut_nsd_from_file('slice_hackfest_middle_nsd.yaml')
- nsd = nsd['nsd-catalog']['nsd'][0]
+ nsd = nsd['nsd']['nsd'][0]
nspdf = NsPlacementDataFactory(self._produce_ut_vim_accounts_info(TestNsPlacementDataFactory.vim_accounts),
self._produce_ut_vnf_price_list(),
nsd=nsd,
{'cp_refs': ['two', 'three'], 'latency': 90, 'jitter': 30}]
nsd = self._get_ut_nsd_from_file('nsd_unittest3.yaml')
- nsd = nsd['nsd:nsd-catalog']['nsd'][0]
+ nsd = nsd['nsd']['nsd'][0]
nspdf = NsPlacementDataFactory(self._produce_ut_vim_accounts_info(TestNsPlacementDataFactory.vim_accounts),
self._produce_ut_vnf_price_list(),
nsd=nsd,
- fault case scenarios with non-existing vims, non-existing vnfds
"""
nsd = self._get_ut_nsd_from_file('nsd_unittest3.yaml')
- nsd = nsd['nsd:nsd-catalog']['nsd'][0]
+ nsd = nsd['nsd']['nsd'][0]
nspdf = NsPlacementDataFactory(self._produce_ut_vim_accounts_info(TestNsPlacementDataFactory.vim_accounts),
self._produce_ut_vnf_price_list(),
nsd=nsd,
def test__produce_ns_desc_with_more_vims(self):
nsd = self._get_ut_nsd_from_file('nsd_unittest1.yaml')
- nsd = nsd['nsd:nsd-catalog']['nsd'][0]
+ nsd = nsd['nsd']['nsd'][0]
nspdf = NsPlacementDataFactory(self._produce_ut_vim_accounts_info(self.vim_accounts_more_vims),
self._produce_ut_vnf_test_price_list('vnf_price_list_more_vims.yaml'),
nsd=nsd,
ns_desc = nspdf._produce_ns_desc()
# check that all expected member-vnf-index are present
vnfs = [e['vnf_id'] for e in ns_desc]
- self.assertEqual(Counter([1, 3, 2]), Counter(vnfs), 'vnf_id invalid')
+ self.assertEqual(Counter({'1': 1, '2': 1, '3': 1}), Counter(vnfs), 'vnf_id invalid')
expected_keys = ['vnf_id', 'vnf_price_per_vim']
for e in ns_desc:
def test__produce_ns_desc_with_fewer_vims(self):
nsd = self._get_ut_nsd_from_file('nsd_unittest1.yaml')
- nsd = nsd['nsd:nsd-catalog']['nsd'][0]
+ nsd = nsd['nsd']['nsd'][0]
nspdf = NsPlacementDataFactory(self._produce_ut_vim_accounts_info(self.vim_accounts_fewer_vims),
self._produce_ut_vnf_price_list(),
nsd=nsd,
ns_desc = nspdf._produce_ns_desc()
# check that all expected member-vnf-index are present
vnfs = [e['vnf_id'] for e in ns_desc]
- self.assertEqual(Counter([1, 3, 2]), Counter(vnfs), 'vnf_id invalid')
+ self.assertEqual(Counter({'1': 1, '2': 1, '3': 1}), Counter(vnfs), 'vnf_id invalid')
expected_keys = ['vnf_id', 'vnf_price_per_vim']
for e in ns_desc:
def test__produce_ns_desc_w_pinning(self):
nsd = self._get_ut_nsd_from_file('nsd_unittest3.yaml')
- nsd = nsd['nsd:nsd-catalog']['nsd'][0]
+ nsd = nsd['nsd']['nsd'][0]
pinning = [{'member-vnf-index': 'two', 'vimAccountId': '331ffdec-44a8-4707-94a1-af7a292d9735'}]
nspdf = NsPlacementDataFactory(self._produce_ut_vim_accounts_info(TestNsPlacementDataFactory.vim_accounts),
self._produce_ut_vnf_price_list(),
'vimeda92f47-29b9-4007-9709-c1833dbfbe31']]
nsd = self._get_ut_nsd_from_file('nsd_unittest3.yaml')
- nsd = nsd['nsd:nsd-catalog']['nsd'][0]
+ nsd = nsd['nsd']['nsd'][0]
nspdf = NsPlacementDataFactory(self._produce_ut_vim_accounts_info(TestNsPlacementDataFactory.vim_accounts),
self._produce_ut_vnf_price_list(),
nsd=nsd,
'vimeda92f47-29b9-4007-9709-c1833dbfbe31']]
nsd = self._get_ut_nsd_from_file('nsd_unittest3.yaml')
- nsd = nsd['nsd:nsd-catalog']['nsd'][0]
+ nsd = nsd['nsd']['nsd'][0]
nspdf = NsPlacementDataFactory(self._produce_ut_vim_accounts_info(TestNsPlacementDataFactory.vim_accounts),
self._produce_ut_vnf_price_list(),
nsd=nsd,
"schema_version": "1.1", "config": {}}]
# FIXME this is not correct re mgmt-network setting.
-nsd_from_db = {"_id": "15fc1941-f095-4cd8-af2d-1000bd6d9eaa", "short-name": "three_vnf_constrained_nsd_low",
- "name": "three_vnf_constrained_nsd_low", "version": "1.0",
- "description": "Placement constraints NSD",
+nsd_from_db = {"_id": "15fc1941-f095-4cd8-af2d-1000bd6d9eaa",
"_admin": {"modified": 1567672251.7531693,
"storage": {"pkg-dir": "ns_constrained_nsd", "fs": "local",
"descriptor": "ns_constrained_nsd/ns_constrained_nsd.yaml",
"projects_write": ["0a5d0c5b-7e08-48a1-a686-642a038bbd70"], "operationalState": "ENABLED",
"userDefinedData": {}, "created": 1567672251.7531693,
"projects_read": ["0a5d0c5b-7e08-48a1-a686-642a038bbd70"]},
- "constituent-vnfd": [{"vnfd-id-ref": "cirros_vnfd_v2", "member-vnf-index": "one"},
- {"vnfd-id-ref": "cirros_vnfd_v2", "member-vnf-index": "two"},
- {"vnfd-id-ref": "cirros_vnfd_v2", "member-vnf-index": "three"}],
- "id": "three_vnf_constrained_nsd_low", "vendor": "ArctosLabs",
- "vld": [{"type": "ELAN", "short-name": "ns_constrained_nsd_low_vld1",
- "link-constraint": [{"constraint-type": "LATENCY", "value": "100"},
- {"constraint-type": "JITTER", "value": "30"}],
- "vim-network-name": "external", "mgmt-network": True,
- "id": "three_vnf_constrained_nsd_low_vld1",
- "vnfd-connection-point-ref": [
- {"vnfd-id-ref": "cirros_vnfd_v2", "member-vnf-index-ref": "one",
- "vnfd-connection-point-ref": "vnf-cp0"},
- {"vnfd-id-ref": "cirros_vnfd_v2",
- "member-vnf-index-ref": "two",
- "vnfd-connection-point-ref": "vnf-cp0"}],
- "name": "ns_constrained_nsd_vld1"},
- {"type": "ELAN", "short-name": "ns_constrained_nsd_low_vld2",
- "link-constraint": [{"constraint-type": "LATENCY", "value": "50"},
- {"constraint-type": "JITTER", "value": "30"}],
- "vim-network-name": "lanretxe", "mgmt-network": True,
- "id": "three_vnf_constrained_nsd_low_vld2",
- "vnfd-connection-point-ref": [
- {"vnfd-id-ref": "cirros_vnfd_v2", "member-vnf-index-ref": "two",
- "vnfd-connection-point-ref": "vnf-cp0"},
- {"vnfd-id-ref": "cirros_vnfd_v2", "member-vnf-index-ref": "three",
- "vnfd-connection-point-ref": "vnf-cp0"}],
- "name": "ns_constrained_nsd_vld2"}]}
+ 'id': 'three_vnf_constrained_nsd_low',
+ 'name': 'three_vnf_constrained_nsd_low',
+ 'description': 'Placement constraints NSD',
+ 'designer': 'ArctosLabs',
+ 'version': '1.0',
+ 'vnfd-id': ['cirros_vnfd_v2'],
+ 'df': [{
+ 'id': 'default-df',
+ 'vnf-profile': [{
+ 'id': 'one',
+ 'vnfd-id': 'cirros_vnfd_v2',
+ 'virtual-link-connectivity': [{
+ 'virtual-link-profile-id': 'three_vnf_constrained_nsd_low_vld1',
+ 'constituent-cpd-id': [{
+ 'constituent-base-element-id': 'one',
+ 'constituent-cpd-id': 'vnf-cp0-ext'
+ }]
+ }]
+ }, {
+ 'id': 'two',
+ 'vnfd-id': 'cirros_vnfd_v2',
+ 'virtual-link-connectivity': [{
+ 'virtual-link-profile-id': 'three_vnf_constrained_nsd_low_vld1',
+ 'constituent-cpd-id': [{
+ 'constituent-base-element-id': 'two',
+ 'constituent-cpd-id': 'vnf-cp0-ext'
+ }]
+ }, {
+ 'virtual-link-profile-id': 'three_vnf_constrained_nsd_low_vld2',
+ 'constituent-cpd-id': [{
+ 'constituent-base-element-id': 'two',
+ 'constituent-cpd-id': 'vnf-cp0-ext'
+ }]
+ }]
+ }, {
+ 'id': 'three',
+ 'vnfd-id': 'cirros_vnfd_v2',
+ 'virtual-link-connectivity': [{
+ 'virtual-link-profile-id': 'three_vnf_constrained_nsd_low_vld2',
+ 'constituent-cpd-id': [{
+ 'constituent-base-element-id': 'three',
+ 'constituent-cpd-id': 'vnf-cp0-ext'
+ }]
+ }]
+ }]
+ }],
+ 'virtual-link-desc': [{
+ 'id': 'three_vnf_constrained_nsd_low_vld1',
+ 'mgmt-network': True,
+ 'vim-network-name': 'external'
+ }, {
+ 'id': 'three_vnf_constrained_nsd_low_vld2',
+ 'mgmt-network': True,
+ 'vim-network-name': 'lanretxe'
+ }],
+ }
######################################################