diff --git a/05-osm-usage.md b/05-osm-usage.md index 834620c3009562166b7f04f78d188bad295c9b19..52353ec2351198c5a8949c7c3e3fcc456cbf98bc 100644 --- a/05-osm-usage.md +++ b/05-osm-usage.md @@ -1769,25 +1769,25 @@ The easiest way of creating a Proxy charm that is able to implement primitives t #### KNF Juju Bundle -This is an example on how to onboard a service that uses a Juju Bundle. For this example the service to be onboarded is a mediawiki that is comprised by a mariadb-k8s database and a mediawiki-k8s frontend. +This is an example on how to onboard a service that uses a Juju Bundle. For this example the service to onboard is Squid, a web server application which provides proxy and cache services for protocols like HTTP or FTP. ```bash -wget http://osm-download.etsi.org/ftp/Packages/hackfests/mediawiki_cnf.tar.gz -wget http://osm-download.etsi.org/ftp/Packages/hackfests/mediawiki_cnf_ns.tar.gz -osm nfpkg-create mediawiki_cnf.tar.gz -osm nspkg-create mediawiki_cnf_ns.tar.gz +git clone --recursive https://osm.etsi.org/gitlab/vnf-onboarding/osm-packages +cd osm-packages +osm nfpkg-create squid_metrics_cnf +osm nspkg-create squid_metrics_cnf_ns ``` -You can instantiate the Network Service: +You can instantiate the Network Service as follows: ```bash -osm ns-create --ns_name hf-k8s --nsd_name ubuntu-cnf-ns --vim_account +osm ns-create --ns_name squid-ns --nsd_name squid_cnf_ns --vim_account ``` To check the status of the deployment you can run the following command: ```bash -osm ns-op-list hf-k8s +osm ns-op-list squid-ns +--------------------------------------+-------------+-------------+-----------+---------------------+--------+ | id | operation | action_name | status | date | detail | +--------------------------------------+-------------+-------------+-----------+---------------------+--------+ @@ -1798,9 +1798,59 @@ osm ns-op-list hf-k8s To remove the network service you can: ```bash -osm ns-delete hf-k8s +osm ns-delete squid-ns +``` + +##### How to Add Instantiation Parameters to KNF Juju Bundles + +It is possible to set custom parameters to KDUs upon NS instantiation, without modifying the previously validated KNF packages. + +Instantiation parameters will be added to the Juju Bundles using Overlays Bundles. [Overlay Bundles](https://juju.is/docs/sdk/charm-bundles#heading--overlay-bundle) allow you to customize settings in an upstream bundle for your own needs, without modifying the existing bundle directly. Juju Bundles and Overlay Bundles use the same YAML syntax. You can find the format of a bundle here: [Juju Bundle Documentation](https://juju.is/docs/olm/bundle). + +First, you need to create a YAML file that will contain the instantiation parameters for your KDU. It must containt the following parameters: + +```yaml +# Additional parameters will be added to the VNF. +additionalParamsForVnf: + # ID of the VNF. + - member-vnf-index: squid_cnf + # Additional parameters will be added to the KDU. + additionalParamsForKdu: + # ID of the KDU. + - kdu_name : squid-metrics-kdu + # Instantiation parameters will be added here. + additionalParams: + # “overlay” will be used as a keyword to identify the instantiation parameters. + overlay: + # The overlay starts here. Use same format as Juju Bundles. + applications: + squid: + scale: 3 +``` + +"overlay" is used as keyword to identify the Bundle Overlay. + +You can modify the number of units to deploy or set custom machine constraints. However, OSM will not allow you to add new applications to the original bundle. All the applications in the overlay must exist on the original bundle. + +The original Juju Bundle for squid-metrics-kdu, establishes only one unit for the `squid` application. In this example we set to 3 the number of units of the `squid` application of the `squid-metrics-kdu` KDU on the `squid_cnf` VNF. + +Then, use the flag `--config_file` during NS instantiation to indicate the YAML file you just created: + +```bash +osm ns-create --ns_name squid-ns --nsd_name squid_cnf_ns --vim_account --config_file ``` +Your `squid-ns` NS will be deployed including 3 units (instead of one), as specified in the instantiation parameters. + +Alternatively, you can use the `--config` flag of `osm ns-create` command to specify the instantiation parameters as follows: + +```bash +osm ns-create --ns_name squid-ns --nsd_name squid_cnf_ns --vim_account --config '{additionalParamsForVnf: [{member-vnf-index: squid_cnf, additionalParamsForKdu: [{ kdu_name: squid-metrics-kdu, additionalParams: { overlay: { applications: { squid: { scale: 3 } }}}}]}]}' +``` + +This approach is equivalent to using the `--config_file` flag. + + ## Subscription and Notification support in OSM [ETSI NFV SOL005](https://www.etsi.org/deliver/etsi_gs/NFV-SOL/001_099/005/02.04.01_60/gs_NFV-SOL005v020401p.pdf) defines a class of Northbound APIs through which entities can subscribe for changes in the Network Service (NS) life-cycle, Network service descriptor (NSD) and Virtual network service descriptor (VNFD). The entities get notified via HTTP REST APIs which those entities expose.