From 5c95562ba061123ecee73138964487ba7eb220af Mon Sep 17 00:00:00 2001 From: rodriguezgar Date: Thu, 28 Apr 2022 19:28:36 +0200 Subject: [PATCH 1/2] Adding section for affinity-or-anti-affinity-group as instantiation paramter --- 05-osm-usage.md | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/05-osm-usage.md b/05-osm-usage.md index dd05328..c5b933c 100644 --- a/05-osm-usage.md +++ b/05-osm-usage.md @@ -265,6 +265,47 @@ Then: osm ns-create --ns_name h1 --nsd_name hackfest1-ns --vim_account openstack1 --config '{vnf: [ {member-vnf-index: "1", vdu: [ {id: hackfest1VM, volume: [ {name: Storage1, vim-volume-id: 8ab156fd-0f8e-4e01-b434-a0fce63ce1cf} ] } ] } ] }' ``` +### Specifying an affinity-or-anti affinity group + +Affinity-or-anti-affinity groups may be defined in the VNF descriptor, in the `df` section, under `affinity-or-anti-affinity-group`. +The type may be `affinity` or `anti-affinity`, and the scope must be `nfvi-node`. VDU profiles may reference one of the defined affinity-or-anti-affinity-group. Notice that, in Openstack, only one group is allowed. The following example shows a VNF with two VDU, both assigned to the same affinity-group `affinity-group-1`. Both virtual machines will be then instantiated in the same host. + +``` +vnfd: + description: A basic VNF descriptor w/ two VDUs and an affinity group + df: + - id: default-df + instantiation-level: + - id: default-instantiation-level + vdu-level: + - number-of-instances: 1 + vdu-id: affinity_basic-VM-1 + - number-of-instances: 1 + vdu-id: affinity_basic-VM-2 + vdu-profile: + - id: affinity_basic-VM-1 + min-number-of-instances: 1 + affinity-or-anti-affinity-group: + - id: affinity-group-1 + - id: affinity_basic-VM-2 + min-number-of-instances: 1 + affinity-or-anti-affinity-group: + - id: affinity-group-1 + affinity-or-anti-affinity-group: + - id: affinity-group-1 + type: affinity + scope: nfvi-node +``` + +An existing server-group may be passed as an instantiation parameter to be used as affinity-or-anti-affinity-group. In this case, the server-group will not be created, but reused, and will not be deleted when the Network Service instance is deleted. The following example shows the syntax + +``` + + --config '{additionalParamsForVnf: [{member-vnf-index: affinity-basic-1, affinity-or-anti-affinity-group: [{ id: affinity-group-1, "vim-affinity-group-id": "81b82372-bbd4-48d6-b368-4d0b9d04d592"}]}]}' +``` + +Where the `id` of the `affinity-or-anti-affinity-group` is the one in the descriptor, and the `vim-affinity-group-id` is the guid of the existing server-group in Openstack to be used (instead of being created). + ### Adding additional parameters Since OSM Release SIX, additional user parameters can be added, and they land at `vdu:cloud-init` (Jinja2 format) and/or `vnf-configuration` primitives (enclosed by `<>`). Here is an example of a VNF descriptor that uses two parameters called `touch_filename` and `touch_filename2`. -- GitLab From e8eccc255ea83ed314c10ebd8966f88919146cc6 Mon Sep 17 00:00:00 2001 From: rodriguezgar Date: Thu, 28 Apr 2022 19:33:13 +0200 Subject: [PATCH 2/2] Adding section for affinity-or-anti-affinity-group as instantiation paramter --- 05-osm-usage.md | 79 ++++++++++++++++++++++++------------------------- 1 file changed, 39 insertions(+), 40 deletions(-) diff --git a/05-osm-usage.md b/05-osm-usage.md index c5b933c..5251134 100644 --- a/05-osm-usage.md +++ b/05-osm-usage.md @@ -265,12 +265,49 @@ Then: osm ns-create --ns_name h1 --nsd_name hackfest1-ns --vim_account openstack1 --config '{vnf: [ {member-vnf-index: "1", vdu: [ {id: hackfest1VM, volume: [ {name: Storage1, vim-volume-id: 8ab156fd-0f8e-4e01-b434-a0fce63ce1cf} ] } ] } ] }' ``` +### Adding additional parameters + +Since OSM Release SIX, additional user parameters can be added, and they land at `vdu:cloud-init` (Jinja2 format) and/or `vnf-configuration` primitives (enclosed by `<>`). Here is an example of a VNF descriptor that uses two parameters called `touch_filename` and `touch_filename2`. + +```yaml +vnfd: + ... + vnf-configuration: + config-primitive: + - name: touch + parameter: + - data-type: STRING + default-value: + name: filename + initial-config-primitive: + - name: config + parameter: + - name: ssh-hostname + value: # this parameter is internal + - name: ssh-username + value: ubuntu + - name: ssh-password + value: osm4u + seq: '1' + - name: touch + parameter: + - name: filename + value: + seq: '2' +``` + +And they can be provided with: + +```yaml +--config '{additionalParamsForVnf: [{member-vnf-index: "1", additionalParams: {touch_filename: your-value, touch_filename2: your-value2}}]}' +``` + ### Specifying an affinity-or-anti affinity group Affinity-or-anti-affinity groups may be defined in the VNF descriptor, in the `df` section, under `affinity-or-anti-affinity-group`. The type may be `affinity` or `anti-affinity`, and the scope must be `nfvi-node`. VDU profiles may reference one of the defined affinity-or-anti-affinity-group. Notice that, in Openstack, only one group is allowed. The following example shows a VNF with two VDU, both assigned to the same affinity-group `affinity-group-1`. Both virtual machines will be then instantiated in the same host. -``` +```yaml vnfd: description: A basic VNF descriptor w/ two VDUs and an affinity group df: @@ -299,50 +336,12 @@ vnfd: An existing server-group may be passed as an instantiation parameter to be used as affinity-or-anti-affinity-group. In this case, the server-group will not be created, but reused, and will not be deleted when the Network Service instance is deleted. The following example shows the syntax -``` - +```yaml --config '{additionalParamsForVnf: [{member-vnf-index: affinity-basic-1, affinity-or-anti-affinity-group: [{ id: affinity-group-1, "vim-affinity-group-id": "81b82372-bbd4-48d6-b368-4d0b9d04d592"}]}]}' ``` Where the `id` of the `affinity-or-anti-affinity-group` is the one in the descriptor, and the `vim-affinity-group-id` is the guid of the existing server-group in Openstack to be used (instead of being created). -### Adding additional parameters - -Since OSM Release SIX, additional user parameters can be added, and they land at `vdu:cloud-init` (Jinja2 format) and/or `vnf-configuration` primitives (enclosed by `<>`). Here is an example of a VNF descriptor that uses two parameters called `touch_filename` and `touch_filename2`. - -```yaml -vnfd: - ... - vnf-configuration: - config-primitive: - - name: touch - parameter: - - data-type: STRING - default-value: - name: filename - initial-config-primitive: - - name: config - parameter: - - name: ssh-hostname - value: # this parameter is internal - - name: ssh-username - value: ubuntu - - name: ssh-password - value: osm4u - seq: '1' - - name: touch - parameter: - - name: filename - value: - seq: '2' -``` - -And they can be provided with: - -```yaml ---config '{additionalParamsForVnf: [{member-vnf-index: "1", additionalParams: {touch_filename: your-value, touch_filename2: your-value2}}]}' -``` - ## Understanding Day-1 and Day-2 Operations VNF configuration is done in three "days": -- GitLab