Cannot set multiple targets associated with aspectId

Bug #1906779 reported by Ayumu Ueha
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tacker
Fix Committed
Medium
Ashutosh Mishra

Bug Description

According to SOL001(*1) "A.6.1 ScalingAspect and InstantiationLevels policies with uniform delta",
number_of_instance of deltas in `VduScalingAspectDeltas` is able to have different value even if aspect_id and delta_id are the same as follows:
```
  policies
    ...
    - vdu_1_scaling_aspect_deltas:
        type: tosca.policies.nfv.VduScalingAspectDeltas
        properties:
          aspect: database // aspect_id
          deltas:
            delta_1: // delta_id
              number_of_instances: 2
        targets: [ vdu_1 ]
    ...
    - vdu_2_scaling_aspect_deltas:
        type: tosca.policies.nfv.VduScalingAspectDeltas
        properties:
          aspect: database // same aspect_id as vdu1
          deltas:
            delta_1: // same delta_id as vdu1
              number_of_instances: 3 // !! different value!!
        targets: [ vdu_2 ]
    ...
```

But in current implementation of tacker, extract policies information using tosca_utils._extract_policy_info(*2) method as follows (Excerpt from VduScalingAspectDeltas):

```
    if tosca_policies is not []:
        for p in tosca_policies:
            if p.type == ETSI_SCALING_ASPECT_DELTA:
                vdu_list = p.targets
                aspect_id = p.properties['aspect']
                deltas = p.properties['deltas']
                delta_id_dict = {}
                for delta_id, delta_val in deltas.items():
                    delta_num = delta_val['number_of_instances']
                    delta_id_dict[delta_id] = delta_num
                // !! Overwrite if the same aspect_id !!
                aspect_delta_dict[aspect_id] = delta_id_dict
                aspect_vdu_dict[aspect_id] = vdu_list
```
If it is the same aspect_id and delta_id, it will be overwritten by the value of the later one (overwrite by number_of_instance: 3 of vdu_2_scaling_aspect_deltas in case of the SOL001 definition example).

refs:
*1) SOL001: https://www.etsi.org/deliver/etsi_gs/NFV-SOL/001_099/001/02.06.01_60/gs_nfv-sol001v020601p.pdf
*2) _extract_policy_info(): https://opendev.org/openstack/tacker/src/branch/master/tacker/tosca/utils.py#L839-L885

Ayumu Ueha (ueha)
description: updated
Yasufumi Ogawa (yasufum)
Changed in tacker:
importance: Undecided → Medium
Revision history for this message
Yasufumi Ogawa (yasufum) wrote :

Any update?

Revision history for this message
Ashutosh Mishra (ashutosh15) wrote :

I am working on fix of this bug and I would like to change assignment.

Changed in tacker:
assignee: nobody → Ashutosh Mishra (ashutosh15)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tacker (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/tacker/+/825833

Changed in tacker:
status: New → In Progress
Changed in tacker:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/tacker/+/827505

Revision history for this message
Pooja Singla (psingla) wrote (last edit ):

Dear Ueha San, In bug description the explanation is given only for problematic area of the code not for the operations performed.
To get more clarity of the issue we would like to know the exact operations and reproduction steps for the same. This will help to understand the possible solution of the issue.

Revision history for this message
Ayumu Ueha (ueha) wrote :

As described in the Bug report, this is not an operation error, but a code issue.

Assuming that one aspectId can scale multiple VDUs according to SOL-VNFD, I think Tacker should be able to:
1) Perform a scale out operation with aspectId as `database`
2) vdu_1 and vdu_2 scale out simultaneously with 1) trigger.
   * vdu_1: two instances are increased.
     ```
     - vdu_1_scaling_aspect_deltas:
         type: tosca.policies.nfv.VduScalingDeltas
         properties:
         aspect: database
         deltas:
           delta_1:
             number_of_instances: 2
         targets: [ vdu_1 ]
     ```
   * vdu_2: three instances are increased.
     ```
     - vdu_2_scaling_aspect_deltas:
         type: tosca.policies.nfv.VduScalingDeltas
         properties:
         aspect: database
         deltas:
           delta_1:
             number_of_instances: 3
         targets: [ vdu_2 ]
     ```

However, with the current implementation of Tacker, neither Openstack VIM nor Kubernetes VIM can scale multiple VDUs at the same time, as described above.

I don't think it's a big problem because operator can define it with different aspectId and scale it with each.
However, if it fully complies with SOL, it may be a necessary modification.
I don't know the details, but I think a big modification is necessary.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.