From bcf269279aab1ac07e33246e6b5d58bd51d7ef34 Mon Sep 17 00:00:00 2001 From: Luis Date: Mon, 22 May 2023 19:45:09 +0000 Subject: [PATCH 1/2] feature 10972 support of volume multi-attach Signed-off-by: Luis --- 05-osm-usage.md | 144 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 144 insertions(+) diff --git a/05-osm-usage.md b/05-osm-usage.md index 52353ec..9fd6f5c 100644 --- a/05-osm-usage.md +++ b/05-osm-usage.md @@ -633,6 +633,150 @@ An existing persistent volume could be passed as an instantiation parameter by i Where the `name` of the `persistent-storage` is the one in the descriptor, and the `vim-volume-id` is the ID of volume in Openstack to be used (instead of being created). +### Creating a deployment with a multi-attach volume + +OSM supports the usage of multi-attach volumes when working with multiples VDUs in the same deployment. This feature only works in the Openstack Cloud environment and needs to be activated beforehand. Using `cinder`, create the volume type `multiattach` and activate it using the following commands: + +```bash +$ cinder type-create multiattach +$ cinder type-key multiattach set multiattach=" True" +``` + +Verify that the configuration was has been applied by using the following command: + +```bash +$ cinder type-list ++--------------------------------------+-------------+---------------------+-----------+ +| ID | Name | Description | Is_Public | ++--------------------------------------+-------------+---------------------+-----------+ +| b365d243-0c21-45e2-8e41-aa975c4bd78c | __DEFAULT__ | Default Volume Type | True | +| fdbf0985-86ca-4691-a5ba-9acb752bfed4 | multiattach | - | True | ++--------------------------------------+-------------+---------------------+-----------+ +``` + +Now, build a descriptor according to this feature: set `multiattach` flag as `true` under `vdu-storage-requirements` in the VNFD, then, add the volume id to both `vdu` under `virtual-storage-desc`, so it will attach itself to both VMs. The following is an example of a descriptor which generates a multi-attach volume: + +```yaml +vnfd: + description: A basic VNF descriptor w/ two VDU + df: + - id: default-df + instantiation-level: + - id: default-instantiation-level + vdu-level: + - number-of-instances: 1 + vdu-id: hackfest_basic-VM + - number-of-instances: 1 + vdu-id: hackfest_basic-VM1 + vdu-profile: + - id: hackfest_basic-VM + min-number-of-instances: 1 + affinity-or-anti-affinity-group: + - id: affinity-group-1 + - id: hackfest_basic-VM1 + min-number-of-instances: 1 + affinity-or-anti-affinity-group: + - id: affinity-group-1 + affinity-or-anti-affinity-group: + - id: affinity-group-1 + type: anti-affinity + scope: nfvi-node + ext-cpd: + - id: vnf-cp0-ext + int-cpd: + cpd: vdu-eth0-int + vdu-id: hackfest_basic-VM + - id: vnf-cp1-ext + int-cpd: + cpd: vdu-eth0-int + vdu-id: hackfest_basic-VM1 + id: hackfest_basic_multi-vnf + mgmt-cp: vnf-cp0-ext + product-name: hackfest_basic_multi-vnf + sw-image-desc: + - id: ubuntu18.04 + name: ubuntu18.04 + image: ubuntu18.04 + - id: ubuntu18.04-aws + name: ubuntu18.04-aws + image: ubuntu/images/hvm-ssd/ubuntu-artful-17.10-amd64-server-20180509 + vim-type: aws + - id: ubuntu18.04-azure + name: ubuntu18.04-azure + image: Canonical:UbuntuServer:18.04-LTS:latest + vim-type: azure + - id: ubuntu18.04-gcp + name: ubuntu18.04-gcp + image: ubuntu-os-cloud:image-family:ubuntu-1804-lts + vim-type: gcp + vdu: + - id: hackfest_basic-VM + name: hackfest_basic-VM + sw-image-desc: ubuntu18.04 + alternative-sw-image-desc: + - ubuntu18.04-aws + - ubuntu18.04-azure + - ubuntu18.04-gcp + virtual-compute-desc: hackfest_basic-VM-compute + virtual-storage-desc: + - root-volume + - hackfest_basic-VM-storage + int-cpd: + - id: vdu-eth0-int + virtual-network-interface-requirement: + - name: vdu-eth0 + virtual-interface: + type: PARAVIRT + - cloud-init: | + #cloud-config + password: osmpass + chpasswd: { expire: False } + ssh_pwauth: True + id: hackfest_basic-VM1 + name: hackfest_basic-VM1 + sw-image-desc: ubuntu18.04 + alternative-sw-image-desc: + - ubuntu18.04-aws + - ubuntu18.04-azure + - ubuntu18.04-gcp + virtual-compute-desc: hackfest_basic-VM-compute + virtual-storage-desc: + - root-volume + - hackfest_basic-VM-storage + int-cpd: + - id: vdu-eth0-int + virtual-network-interface-requirement: + - name: vdu-eth0 + virtual-interface: + type: PARAVIRT + version: 1.0 + virtual-compute-desc: + - id: hackfest_basic-VM-compute + virtual-cpu: + num-virtual-cpu: 1 + virtual-memory: + size: 1.0 + virtual-storage-desc: + - id: root-volume + size-of-storage: 5 + - id: hackfest_basic-VM-storage + type-of-storage: persistent-storage + size-of-storage: 10 + vdu-storage-requirements: + - key: multiattach + value: true +``` + +In this case, the volume `hackfest_basic-VM-storage` will be created under the name `shared-{virtual-storage-desc.id}-vnf` and will be the shared between both VMs. To check if it worked, run the `openstack volume list` and check if it is multi-attached to both VDUs. + +```bash ++--------------------------------------+-----------------------------------------------------------+-----------+------+-------------------------------------------------------------------------------------------------------------------------+ +| ID | Name | Status | Size | Attached to | ++--------------------------------------+-----------------------------------------------------------+-----------+------+-------------------------------------------------------------------------------------------------------------------------+ +| 91bf5674-5b85-41d1-aa3b-4848e2691088 | shared-hackfest_basic-VM-storage-hackfest_basic_multi-vnf | in-use | 10 | Attached to multi_test-vnf-hackfest_basic-VM1-0 on /dev/vdb Attached to multi_test-vnf-hackfest_basic-VM-0 on /dev/vdb | ++--------------------------------------+-----------------------------------------------------------+-----------+------+-------------------------------------------------------------------------------------------------------------------------+ +``` + ## Understanding Day-1 and Day-2 Operations VNF configuration is done in three "days": -- GitLab From d28394a9c2c9342120441fd82cec4722fe145b07 Mon Sep 17 00:00:00 2001 From: Luis Date: Mon, 22 May 2023 19:45:09 +0000 Subject: [PATCH 2/2] feature 10972 support of volume multi-attach Signed-off-by: Luis --- 05-osm-usage.md | 156 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 156 insertions(+) diff --git a/05-osm-usage.md b/05-osm-usage.md index 52353ec..3f20788 100644 --- a/05-osm-usage.md +++ b/05-osm-usage.md @@ -633,6 +633,162 @@ An existing persistent volume could be passed as an instantiation parameter by i Where the `name` of the `persistent-storage` is the one in the descriptor, and the `vim-volume-id` is the ID of volume in Openstack to be used (instead of being created). +### Creating a deployment with a multi-attach volume + +OSM supports the usage of multi-attach volumes when working with multiples VDUs in the same deployment. This feature only works in the Openstack Cloud environment and needs to be activated beforehand. Using `cinder`, create the volume type `multiattach` and activate it using the following commands: + +```bash +$ cinder type-create multiattach +$ cinder type-key multiattach set multiattach=" True" +``` + +Verify that the configuration was has been applied by using the following command: + +```bash +$ cinder type-list ++--------------------------------------+-------------+---------------------+-----------+ +| ID | Name | Description | Is_Public | ++--------------------------------------+-------------+---------------------+-----------+ +| b365d243-0c21-45e2-8e41-aa975c4bd78c | __DEFAULT__ | Default Volume Type | True | +| fdbf0985-86ca-4691-a5ba-9acb752bfed4 | multiattach | - | True | ++--------------------------------------+-------------+---------------------+-----------+ +``` + +Now, build a descriptor according to this feature: set `multiattach` flag as `true` under `vdu-storage-requirements` in the VNFD, then, add the volume id to both `vdu` under `virtual-storage-desc`, so it will attach itself to both VMs. The following is an example of a descriptor which generates a multi-attach volume: + +```yaml +vnfd: + description: A basic VNF descriptor w/ two VDU + df: + - id: default-df + instantiation-level: + - id: default-instantiation-level + vdu-level: + - number-of-instances: 1 + vdu-id: hackfest_basic-VM + - number-of-instances: 1 + vdu-id: hackfest_basic-VM1 + vdu-profile: + - id: hackfest_basic-VM + min-number-of-instances: 1 + affinity-or-anti-affinity-group: + - id: affinity-group-1 + - id: hackfest_basic-VM1 + min-number-of-instances: 1 + affinity-or-anti-affinity-group: + - id: affinity-group-1 + affinity-or-anti-affinity-group: + - id: affinity-group-1 + type: anti-affinity + scope: nfvi-node + ext-cpd: + - id: vnf-cp0-ext + int-cpd: + cpd: vdu-eth0-int + vdu-id: hackfest_basic-VM + - id: vnf-cp1-ext + int-cpd: + cpd: vdu-eth0-int + vdu-id: hackfest_basic-VM1 + id: hackfest_basic_multi-vnf + mgmt-cp: vnf-cp0-ext + product-name: hackfest_basic_multi-vnf + sw-image-desc: + - id: ubuntu18.04 + name: ubuntu18.04 + image: ubuntu18.04 + - id: ubuntu18.04-aws + name: ubuntu18.04-aws + image: ubuntu/images/hvm-ssd/ubuntu-artful-17.10-amd64-server-20180509 + vim-type: aws + - id: ubuntu18.04-azure + name: ubuntu18.04-azure + image: Canonical:UbuntuServer:18.04-LTS:latest + vim-type: azure + - id: ubuntu18.04-gcp + name: ubuntu18.04-gcp + image: ubuntu-os-cloud:image-family:ubuntu-1804-lts + vim-type: gcp + vdu: + - id: hackfest_basic-VM + name: hackfest_basic-VM + sw-image-desc: ubuntu18.04 + alternative-sw-image-desc: + - ubuntu18.04-aws + - ubuntu18.04-azure + - ubuntu18.04-gcp + virtual-compute-desc: hackfest_basic-VM-compute + virtual-storage-desc: + - root-volume + - hackfest_basic-VM-storage + int-cpd: + - id: vdu-eth0-int + virtual-network-interface-requirement: + - name: vdu-eth0 + virtual-interface: + type: PARAVIRT + - cloud-init: | + #cloud-config + password: osmpass + chpasswd: { expire: False } + ssh_pwauth: True + id: hackfest_basic-VM1 + name: hackfest_basic-VM1 + sw-image-desc: ubuntu18.04 + alternative-sw-image-desc: + - ubuntu18.04-aws + - ubuntu18.04-azure + - ubuntu18.04-gcp + virtual-compute-desc: hackfest_basic-VM-compute + virtual-storage-desc: + - root-volume + - hackfest_basic-VM-storage + int-cpd: + - id: vdu-eth0-int + virtual-network-interface-requirement: + - name: vdu-eth0 + virtual-interface: + type: PARAVIRT + version: 1.0 + virtual-compute-desc: + - id: hackfest_basic-VM-compute + virtual-cpu: + num-virtual-cpu: 1 + virtual-memory: + size: 1.0 + virtual-storage-desc: + - id: root-volume + size-of-storage: 5 + - id: hackfest_basic-VM-storage + type-of-storage: persistent-storage + size-of-storage: 10 + vdu-storage-requirements: + - key: multiattach + value: true +``` + +In this case, the volume `hackfest_basic-VM-storage` will be created under the name `shared-{virtual-storage-desc.id}-vnf` and will be the shared between both VMs. To check if it worked, run the `openstack volume list` and check if it is multi-attached to both VDUs. + +```bash ++--------------------------------------+-----------------------------------------------------------+-----------+------+-------------------------------------------------------------------------------------------------------------------------+ +| ID | Name | Status | Size | Attached to | ++--------------------------------------+-----------------------------------------------------------+-----------+------+-------------------------------------------------------------------------------------------------------------------------+ +| 91bf5674-5b85-41d1-aa3b-4848e2691088 | shared-hackfest_basic-VM-storage-hackfest_basic_multi-vnf | in-use | 10 | Attached to multi_test-vnf-hackfest_basic-VM1-0 on /dev/vdb Attached to multi_test-vnf-hackfest_basic-VM-0 on /dev/vdb | ++--------------------------------------+-----------------------------------------------------------+-----------+------+-------------------------------------------------------------------------------------------------------------------------+ +``` + +It is possible to add the the flag `keep-volume` so the volume will stay on Openstack after deleting the VM. Add the key in the `vdu-storage-requirements` to make it work: + +```yaml +vdu-storage-requirements: +- key: multiattach + value: true +- key: keep-volume + value: true +``` + +If the value for the `keep-volume` key is set to `false`, or if the key does not exist, the volume will be deleted from OpenStack along with the VMs when the NS (Network Service) is deleted. + ## Understanding Day-1 and Day-2 Operations VNF configuration is done in three "days": -- GitLab