Commit 58367afa authored by garciadeblas's avatar garciadeblas
Browse files

Merge branch 'keep_vol' into 'master'

Adding documentation for feature 10936 keeping persistent volume of VNF

See merge request !111
parents 209676a9 764b31da
Loading
Loading
Loading
Loading
+60 −0
Original line number Diff line number Diff line
@@ -573,6 +573,66 @@ An existing server-group may be passed as an instantiation parameter to be used

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).

### Keeping Persistent Volumes

OSM supports three types of volumes: persistent, swap and ephemeral. Swap and ephemeral volumes are deleted together with the virtual machine. 
Persistent volumes are used as an root disk or ordinary disk and could be kept in the Openstack Cloud environment upon virtual machine deletion by setting `keep-volume` flag `true` under `vdu-storage-requirements` in the VNFD. If the `keep-volume` is set to `false` or is not included in the descriptor, persistent volume is deleted together with virtual machine. A sample descriptor which keeps persistent volumes is given as follows:

```yaml
vnfd:
  description: A basic VNF descriptor w/ one VDU and several volumes, keeping persistent volume
  df:
  - id: default-df
    instantiation-level:
    - id: default-instantiation-level
      vdu-level:
      - number-of-instances: 1
        vdu-id: keep-persistent-vol-VM
    vdu-profile:
    - id: keep-persistent-vol-VM
      min-number-of-instances: 1
  id: keep_persistent-volumes-vnf
  mgmt-cp: vnf-mgmt-ext
  product-name: keep_persistent-volumes-vnf
  vdu:
  - id: keep-persistent-vol-VM
    name: keep-persistent-vol-VM
    sw-image-desc: ubuntu20.04
    alternative-sw-image-desc:
    - ubuntu20.04-aws
    - ubuntu20.04-azure
    virtual-compute-desc: keep-persistent-vol-VM-compute
    virtual-storage-desc:
    - root-volume
    - persistent-volume
    - ephemeral-volume
  version: 1.0
  virtual-storage-desc:
  - id: root-volume
    type-of-storage: persistent-storage
    size-of-storage: 10
    vdu-storage-requirements:
      - key: keep-volume
        value: 'true'
  - id: persistent-volume
    type-of-storage: persistent-storage
    size-of-storage: 1
    vdu-storage-requirements:
      - key: keep-volume
        value: 'true'
  - id: ephemeral-volume
    type-of-storage: ephemeral-storage
    size-of-storage: 2
```

An existing persistent volume could be passed as an instantiation parameter by identifing the name of `volume` and `vim-volume-id` which is exact volume ID in the Openstack Cloud. `vim-volume-id` is only accepted as an instantiation parameter, it could not be provided in the descriptor. If the `vim-volume-id` is provided as a persistent volume, new persistent volume is not created, but reused. Existing volumes which are provided with `vim-volume-id` parameter are always kept without checking `keep-volume` flag, when the Network Service instance is deleted. The following example shows the syntax:

```yaml
--config '{ vnf: [ {member-vnf-index: vnf-persistent-volumes, vdu: [ {id: keep-persistent-vol-VM, volume: [{"name": root-volume, vim-volume-id: 53c485d0-7f32-4675-919d-a3ccaf655629}, {"name": persistent-volume, vim-volume-id: 4391a6af-6e00-470c-960f-73213840431e}] } ] } ] }'
```

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).

## Understanding Day-1 and Day-2 Operations

VNF configuration is done in three "days":