X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=descriptor-packages%2Ftools%2Fgenerate_descriptor_pkg.sh;h=1b9a9e03fd9c9f6adea38c73074b56d78d680861;hb=c5a51c40540ea2b0bb888c98c8441a551b084d8f;hp=5cf2510d0cf9bfbaa78d8da859c3b0309f09ce49;hpb=76299c1338d1327c2c1877d8bb100145d097b9bc;p=osm%2Fdevops.git diff --git a/descriptor-packages/tools/generate_descriptor_pkg.sh b/descriptor-packages/tools/generate_descriptor_pkg.sh index 5cf2510d..1b9a9e03 100755 --- a/descriptor-packages/tools/generate_descriptor_pkg.sh +++ b/descriptor-packages/tools/generate_descriptor_pkg.sh @@ -43,10 +43,11 @@ VNFD_FOLDERS=(images scripts icons charms cloud_init) # Supported folders for NSD # OSM document specifies (ns|vnf)-config folder, while Rel 4.3 # is using (ns|vnf)_config. -NSD_FOLDERS=(scripts icons ns_config vnf_config) +NSD_FOLDERS=(scripts charms icons ns_config vnf_config) # Other files allowed in the descriptor base directory ALLOWED_FILES=(README) +ALLOWED_FILES_WILDCARDS=(README) DESC_TYPES=(vnfd nsd) DESC_EXTN=(yml yaml json xml) @@ -61,7 +62,7 @@ DEBUG=false ARCHIVE=false CREATE_NSD=false VENDOR='OSM' -INTF_TYPE='VIRTIO' +INTF_TYPE='PARAVIRT' VCPU=2 MEMORY=4096 STORAGE=10 @@ -98,8 +99,8 @@ Usage: --vendor : Vendor name for descriptor. Default OSM - --interface-type : Interface type [VIRTIO|SR-IOV|PCI-PASSTHROUGH|E1000] - Default VIRTIO + --interface-type : Interface type [PARAVIRT|SR-IOV|PCI-PASSTHROUGH|E1000] + Default PARAVIRT VM Flavour options: @@ -137,7 +138,7 @@ EOF CP_TYPE='VPORT' function get_cp_type() { case ${INTF_TYPE} in - VIRTIO ) CP_TYPE='VPORT';; + PARAVIRT ) CP_TYPE='VPORT';; SR-IOV ) CP_TYPE='VPORT';; PCI-PASSTHROUGH ) CP_TYPE='VPORT';; OM-MGMT ) CP_TYPE='VPORT';; @@ -173,7 +174,7 @@ vnfd:vnfd-catalog: - id: ${name} name: ${name} short-name: ${name} - description: Generated by OSM pacakage generator + description: Generated by OSM package generator vendor: ${VENDOR} version: '1.0' @@ -182,7 +183,7 @@ vnfd:vnfd-catalog: # Management interface mgmt-interface: - vdu-id: ${name}-VM + cp: vnf-cp0 # Atleast one VDU need to be specified vdu: @@ -230,24 +231,19 @@ EOF - name: eth0 type: EXTERNAL virtual-interface: - type: VIRTIO - bandwidth: '0' - vpci: '0000:00:0a.0' - external-connection-point-ref: eth0 + type: PARAVIRT + external-connection-point-ref: vnf-cp0 EOF # Add external interfaces for i in `seq 1 ${INTERFACES}`; do eth=$(($i)) - pci=$(get_pci $eth) cat >>$desc_file <>$desc_file <>$desc_file < - # provider-network: - # overlay-type: VLAN - # segmentation_id: - vnfd-connection-point-ref: - # Specify the constituent VNFs - # member-vnf-index-ref - entry from constituent vnf - # vnfd-id-ref - VNFD id - # vnfd-connection-point-ref - connection point name in the VNFD - - nsd:member-vnf-index-ref: 1 - nsd:vnfd-id-ref: ${vnfd} - # NOTE: Validate the entry below - nsd:vnfd-connection-point-ref: eth0 + - id: ${name}_vld0 + name: management + short-name: management + type: ELAN + mgmt-network: 'true' + # vim-network-name: + # provider-network: + # overlay-type: VLAN + # segmentation_id: + vnfd-connection-point-ref: + # Specify the constituent VNFs + # member-vnf-index-ref - entry from constituent vnf + # vnfd-id-ref - VNFD id + # vnfd-connection-point-ref - connection point name in the VNFD + - member-vnf-index-ref: 1 + vnfd-id-ref: ${vnfd} + # NOTE: Validate the entry below + vnfd-connection-point-ref: vnf-cp0 EOF # Add rest of VLDs for i in `seq 1 ${INTERFACES}`; do eth=$(($i)) cat >>$desc_file < - # provider-network: - # overlay-type: VLAN - # segmentation_id: - vnfd-connection-point-ref: - # Specify the constituent VNFs - # member-vnf-index-ref - entry from constituent vnf - # vnfd-id-ref - VNFD id - # vnfd-connection-point-ref - connection point name in the VNFD - - nsd:member-vnf-index-ref: 1 - nsd:vnfd-id-ref: ${vnfd} - # NOTE: Validate the entry below - nsd:vnfd-connection-point-ref: eth${eth} + - id: ${name}_vld${i} + name: ${name}_vld${i} + short-name: ${name}_vld${i} + type: ELAN + # vim-network-name: + # provider-network: + # overlay-type: VLAN + # segmentation_id: + vnfd-connection-point-ref: + # Specify the constituent VNFs + # member-vnf-index-ref - entry from constituent vnf + # vnfd-id-ref - VNFD id + # vnfd-connection-point-ref - connection point name in the VNFD + - member-vnf-index-ref: 1 + vnfd-id-ref: ${vnfd} + # NOTE: Validate the entry below + vnfd-connection-point-ref: vnf-cp${eth} EOF - done + done if [ $VERBOSE == true ]; then echo "INFO: Created $desc_file" @@ -762,7 +757,11 @@ if [ $CREATE == false ]; then for f in ${files[@]}; do if [ $(contains "${ALLOWED_FILES[@]}" $f) == "n" ]; then - echo "WARN: Unsupported file $f found" + for j in ${ALLOWED_FILES_WILDCARDS[@]}; do + if [[ $f != *"$j"* ]]; then + echo "WARN: Unsupported file $f found" + fi + done fi done @@ -796,6 +795,14 @@ if [ $CREATE == false ]; then fi cd $BASE_DIR + # Mrityunjay Yadav: Validate descriptor + GEN_BASEDIR=$(dirname "$0") + python3 $GEN_BASEDIR/validate_descriptor.py $BASE_DIR/$PKG/$descriptor + if [ $? -ne 0 ]; then + rc=$? + echo "ERROR: validating descriptor for $PKG ($rc)" >&2 + exit $rc + fi if [ $DRY_RUN == false ]; then if [ $VERBOSE == true ]; then tar zcvf "$DEST_DIR/$PKG.tar.gz" "${PKG}" ${RM}