From c816d49282b7ded38254376c0d8252ae0cea4a8a Mon Sep 17 00:00:00 2001 From: Patricia Reinoso Date: Tue, 7 Feb 2023 12:26:57 +0100 Subject: [PATCH 1/2] Feature 10974: Add juju instantiation params documentation. How to add instantiation parameters during NS instantiation example. Mediawiki bundle no longer works. It was replaced with Squid. --- 05-osm-usage.md | 70 ++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 61 insertions(+), 9 deletions(-) diff --git a/05-osm-usage.md b/05-osm-usage.md index 834620c..7b1c379 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 --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 +--------------------------------------+-------------+-------------+-----------+---------------------+--------+ | id | operation | action_name | status | date | detail | +--------------------------------------+-------------+-------------+-----------+---------------------+--------+ @@ -1798,9 +1798,61 @@ osm ns-op-list hf-k8s To remove the network service you can: ```bash -osm ns-delete hf-k8s +osm ns-delete squid +``` + +##### 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 parameters for the Juju Bundle + 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` on the VNF `squid_cnf`. + +Then, use the flag `--config_file` during NS instantiation to indicate the YAML file you just created: + +```bash +osm ns-create --ns_name squid --nsd_name squid_cnf_ns --vim_account --config_file instantiation_params.yaml +``` + +Your NS `squid` 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 --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. -- GitLab From 4ac518b21a108b86e96a48e1d017c427ff2ffc65 Mon Sep 17 00:00:00 2001 From: reinosop Date: Tue, 7 Feb 2023 13:19:04 +0000 Subject: [PATCH 2/2] Update 05-osm-usage.md --- 05-osm-usage.md | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/05-osm-usage.md b/05-osm-usage.md index 7b1c379..52353ec 100644 --- a/05-osm-usage.md +++ b/05-osm-usage.md @@ -1781,13 +1781,13 @@ osm nspkg-create squid_metrics_cnf_ns You can instantiate the Network Service as follows: ```bash -osm ns-create --ns_name squid --nsd_name squid_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 squid +osm ns-op-list squid-ns +--------------------------------------+-------------+-------------+-----------+---------------------+--------+ | id | operation | action_name | status | date | detail | +--------------------------------------+-------------+-------------+-----------+---------------------+--------+ @@ -1798,16 +1798,14 @@ osm ns-op-list squid To remove the network service you can: ```bash -osm ns-delete squid +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). +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: @@ -1822,7 +1820,7 @@ additionalParamsForVnf: - kdu_name : squid-metrics-kdu # Instantiation parameters will be added here. additionalParams: - # “overlay” will be used as a keyword to identify the parameters for the Juju Bundle + # “overlay” will be used as a keyword to identify the instantiation parameters. overlay: # The overlay starts here. Use same format as Juju Bundles. applications: @@ -1834,20 +1832,20 @@ additionalParamsForVnf: 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` on the VNF `squid_cnf`. +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 --nsd_name squid_cnf_ns --vim_account --config_file instantiation_params.yaml +osm ns-create --ns_name squid-ns --nsd_name squid_cnf_ns --vim_account --config_file ``` -Your NS `squid` will be deployed including 3 units (instead of one), as specified in the instantiation parameters. +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 --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 } }}}}]}]}' +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. -- GitLab