Add cloud init to Ubuntu VNF
[osm/devops.git] / src / generate_descriptor_pkg.sh
index 8edb06f..b496497 100755 (executable)
@@ -151,6 +151,18 @@ get_pci() {
    printf '%02x' $((10 + $1)) | tr '[:upper:]' '[:lower:]'
 }
 
+function write_readme() {
+    dir=$1
+    file=${dir}/README
+    date=$(date)
+
+    cat >$file <<EOF
+Descriptor created by OSM descriptor package generated
+Created on $date
+EOF
+
+}
+
 function write_vnfd_tmpl() {
     name=$(basename $1)
     desc_file="${name}.yaml"
@@ -174,6 +186,8 @@ vnfd:vnfd-catalog:
 
         # Atleast one VDU need to be specified
         vdu:
+        # Additional VDUs can be created by copying the
+        # VDU descriptor below
         -   id: ${name}-VM
             name: ${name}-VM
             description: ${name}-VM
@@ -215,7 +229,7 @@ EOF
     cat >>$desc_file <<EOF
             -   name: eth0
                 virtual-interface:
-                    type: OM-MGMT
+                    type: VIRTIO
                     bandwidth: '0'
                     vpci: 0000:00:0a.0
                 vnfd-connection-point-ref: eth0
@@ -249,6 +263,37 @@ EOF
 EOF
     done
 
+    cat >>$desc_file <<EOF
+
+        # Uncomment and update below to enable juju
+        # charm configuration for the VNF
+        # vnf-configuration:
+        #     juju:
+        #         charm: <charm name>
+        #     service-primitive:
+        #     -   name: config
+        #         parameter:
+        #         -   name: <config parameter>
+        #             data-type: [STRING|INTEGER]
+        #             mandatory: [true|false]
+        #             default-value: <value>
+        #     -   name: <action name>
+        #         parameter:
+        #         -   name: <action parameter>
+        #             data-type: [STRING|INTEGER]
+        #             mandatory: [true|false]
+        #             default-value: <value>
+        #     initial-config-primitive:
+        #     -   name: config
+        #         parameter:
+        #         -   name: <config name>
+        #             value: <value>
+        #     -   name: <action name>
+        #         parameter:
+        #         -   name: <action parameter>
+        #             value: <value>
+EOF
+
     if [ $VERBOSE == true ]; then
         echo "INFO: Created $desc_file"
     fi
@@ -293,6 +338,7 @@ EOF
                 name: management
                 short-name: management
                 type: ELAN
+                mgmt-network: 'true'
                 # vim-network-name: <update>
                 # provider-network:
                 #     overlay-type: VLAN
@@ -475,6 +521,8 @@ function generate_package(){
         write_nsd_tmpl $dir $vnfd
     fi
 
+    write_readme $dir
+
     if [ $ARCHIVE == true ]; then
         # Create archive of the package
         cd $dest_dir