X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=src%2Fgenerate_descriptor_pkg.sh;h=8edb06feaf4052dec45456c0907b2dd2f36a6c34;hb=ff2d83fe78a9b42e9bedbc6dd3c2ab78cc129b12;hp=b44967352000ab2656852cc4f5567f8ba3664fe9;hpb=1c36f4a61eca247cd3dd5d8e0609246faa6e49cb;p=osm%2Fdevops.git diff --git a/src/generate_descriptor_pkg.sh b/src/generate_descriptor_pkg.sh index b4496735..8edb06fe 100755 --- a/src/generate_descriptor_pkg.sh +++ b/src/generate_descriptor_pkg.sh @@ -65,7 +65,6 @@ INTF_TYPE='VIRTIO' VCPU=2 MEMORY=4096 STORAGE=10 -CLOUD_INIT='#cloud-config ' INTERFACES=1 function usage() { @@ -99,7 +98,7 @@ Usage: --vendor : Vendor name for descriptor. Default OSM - --interface-type : Interface type [VIRTIO|SR-IOV|PCI-PASSTHROUGH|E1000|OM-MGMT] + --interface-type : Interface type [VIRTIO|SR-IOV|PCI-PASSTHROUGH|E1000] Default VIRTIO VM Flavour options: @@ -119,7 +118,7 @@ Usage: --cloud-init : Cloud init script. Will be ignored if cloud-init-file is specified - --interfaces : Number of external interfaces. Default 1. + --interfaces : Number of external interfaces in additon to OM-MGMT. Default 1. End of create descriptor specific options @@ -198,7 +197,7 @@ EOF # Cloud init file cloud-init-file: '${cif}' EOF - else + elif [[ -n ${CLOUD_INIT} ]]; then cat >>$desc_file <>$desc_file <>$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 +EOF + + # Add rest of VLDs for i in `seq 1 ${INTERFACES}`; do - eth=$(($i - 1)) + eth=$(($i)) cat >>$desc_file < - segmentation_id: + # 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 @@ -295,7 +327,7 @@ EOF # vnfd-connection-point-ref - connection point name in the VNFD - nsd:member-vnf-index-ref: 1 nsd:vnfd-id-ref: ${vnfd} - # Validate the entry below + # NOTE: Validate the entry below nsd:vnfd-connection-point-ref: eth${eth} EOF done @@ -540,20 +572,20 @@ if [[ -z "$PKG" ]]; then exit 1 fi -cd $BASE_DIR -if [ $? -ne 0 ]; then +if [[ ! -d $BASE_DIR ]]; then if [ $CREATE == true ]; then mkdir -p $BASE_DIR if [ $? -ne 0 ]; then echo "ERROR: Unable to create base directory $BASE_DIR" >&2 exit 1 fi - cd $BASE_DIR - else - echo "ERROR: Unable to change to base directory $BASE_DIR!" >&2 - exit 1 fi fi +cd $BASE_DIR +if [ $? -ne 0 ]; then + echo "ERROR: Unable to change to base directory $BASE_DIR!" >&2 + exit 1 +fi # Get full base dir path BASE_DIR=`pwd`