@@ -633,6 +633,163 @@ 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="<is> True"
```
Verify that the configuration was has been applied by using the following command:
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:
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.
| 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.
### Using existing flavors (OpenStack only)
Typically, OSM creates the flavors needed by the VDUs, which are specified by the `virtual-compute-desc` parameter in the VNFD. In some cases, flavors must contain a complex EPA configuration that is not supported by descriptors, so they need to be created manually in the VIM beforehand.