Creating your own VNF package

From OSM Public Wiki
Revision as of 14:01, 30 May 2018 by Garciadeblas (talk | contribs) (Created page with "==VNF without primitives== ===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 wi...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

VNF without primitives

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

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

You can then follow the ping-pong example in OSM descriptor packages to integrate the charm into VNF primitives

Migrating old descriptors to release FOUR

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

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 in 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 IM osmclient devops

# If missing, add repository with:
apt update && add-apt-repository -y "deb [arch=amd64] 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