Creating your own VNF package (Release THREE): Difference between revisions
Garciadeblas (talk | contribs) No edit summary |
Garciadeblas (talk | contribs) No edit summary |
||
Line 75: | Line 75: | ||
This command fails if package python-osm-im is not installed. Follow these steps to install it if needed: | This command fails if package python-osm-im is not installed. Follow these steps to install it if needed: | ||
# Check that the current OSM debian repository is the stable Release | # Check that the current OSM debian repository is the stable Release FOUR repo: | ||
grep -h ^deb /etc/apt/sources.list /etc/apt/sources.list.d/* |grep osm-download | grep -h ^deb /etc/apt/sources.list /etc/apt/sources.list.d/* |grep osm-download | ||
# should be similar to this: | # should be similar to this: | ||
# deb [arch=amd64] http://osm-download.etsi.org/repository/osm/debian/ | # deb [arch=amd64] http://osm-download.etsi.org/repository/osm/debian/ReleaseFOUR stable osmclient | ||
# If missing, add repository with: | # If missing, add repository with: |
Revision as of 12:51, 30 May 2018
VNF without primitives
Using web form
You can access this web page and follow the instructions: http://riftio.com/osm-vnf-package-generator/
Using the CLI tool
- Clone the devops repo:
git clone https://osm.etsi.org/gerrit/osm/devops
- Run the following command to create a folder with all the files required for a single-VM VNF package:
./devops/descriptor-packages/tools/generate_descriptor_pkg.sh -t vnfd --image <IMAGE_PATH> -c <VNF_NAME>
- A folder called <VNF_NAME>_vnfd will be created with all the files required for a VNF package.
- Edit the descriptor file <VNF_NAME>_vnfd.yaml.
- By default, the descriptor is prepared for a single-VM VNF.
- Add as many VMs as required.
- Add also Internal VLDs as required.
- Add any artifacts needed by the VNF (eg, charm, icons, images etc ...) to the appropriate folder and make sure it is referenced in the descriptor.
- Once done, you can generate the tar.gz VNF package with the command:
./devops/descriptor-packages/tools/generate_descriptor_pkg.sh -t vnfd -N <VNF_NAME>_vnfd #Note: the argument -N is optional and is intended to keep the package files after creating the package
Note: If the descriptor is more complex such as a multi-VM VNF the GUI based composer tool is recommended to create the descriptor.
Using the GUI based composer
Creating and onboarding a VNF descriptor
The GUI composer tool is recommended for editing complex VNFs such as multi-VM VNFs
- Bring up the OSM GUI.
- Navigate to the "catalog" page and click on the "+" sign to choose "ADD VNFD" option.
- A new VNF will be added to the canvas. By default the VNF will contain a single VM/VDU.
- Use the "model driven" editor on the right most side of the page to update the various fields in the VNF descriptor.
- Use the "ADD VDU" and "ADD IVLD" buttons to add additional VDUs and Internal VLDs needed by the VNF.
- Select the VDUs and VLDs created and update the fields as needed using the model driven editor on the right.
- For VDUs that need connection to an Internal VLD, add internal connection points to the VDU. Once added, the connection points will be visible on the canvas.
- Make the connection to Internal VLD and VDU by clicking in the VDU and drawing a line to the VLD.
- Once all the edits to the descriptor are completed, click "ONBOARD" to onboard the descriptor.
Exporting a VNF descriptor package
A descriptor that has been on-boarded (through package onboard or through the GUI composer) will be available for export to create a descriptor package.
#Note: Release1 does not include the artifacts that was in the on-boarded package in the exported package.
Adding additional artifacts to a VNF descriptor package
The release1 implementation does not allow the editing of artifacts within a VNF package. So only descriptors can be generated using the GUI composer tool. If additional artifacts need to be included in the VNF package, then:
- Export the VNF package to myvnf.tar.gz.
- Untar the package using tar -zxvf myvnf.tar.gz.
- Copy the needed artifacts to the appropriate directory and update the descriptor to refer to them.
- Recreate the package using the CLI tool
VNF with primitives
You will have to create a proxy charm for the VNF. You can follow the general instructions below:
- Clone the devops repo:
git clone https://osm.etsi.org/gerrit/osm/devops
- Enter the juju-charms folder under devops and follow the instructions to create your own charm: Creating your own VNF charm
You can then follow the ping-pong example in OSM descriptor packages to integrate the charm into VNF primitives
Migrating old descriptors to release THREE
Only file containing the VNFD or NSD descriptor need to be migrated. Clone the devops repo, run the utility for that and generate the package:
git clone https://osm.etsi.org/gerrit/osm/devops ./devops/descriptor-packages/tools/upgrade_descriptor_version.py -i <old-descriptor-file> -o <new-descriptor-file> # generate package following the instructions of previous sections
Check and validate descriptors
This utility is under the 'devops' repository. Clone it using the above steps. Can be invoked with:
./devops/descriptor-packages/tools/validate_descriptor.py <DESCRIPTOR_FILE>
It is also integrated the devops/descriptor-packages makefile system
make test
This command fails if package python-osm-im is not installed. Follow these steps to install it if needed:
# Check that the current OSM debian repository is the stable Release FOUR repo: grep -h ^deb /etc/apt/sources.list /etc/apt/sources.list.d/* |grep osm-download # should be similar to this: # deb [arch=amd64] http://osm-download.etsi.org/repository/osm/debian/ReleaseFOUR stable osmclient # If missing, add repository with: apt update && add-apt-repository -y "deb http://osm-download.etsi.org/repository/osm/debian/ReleaseFOUR stable IM osmclient devops" curl "http://osm-download.etsi.org/repository/osm/debian/ReleaseFOUR/OSM%20ETSI%20Release%20Key.gpg" | apt-key add - # Install/update python-osm-im and its dependencies apt update apt install python-osm-im