Instantiation failed with error: "ValueError: Field `associated_vnfc_cp_id' cannot be None"

Bug #1948925 reported by Masaki Oyama
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tacker
Fix Released
Undecided
Unassigned

Bug Description

I failed to instantiate VNF including a scalable VDU designed not to be created in the initial state, with instantiateVnfRequest including information about a connection point binding to the VDU.

Details are as follows:

Conditions:
    - The VNF includes the VDU named as "VDU_1".
    - The VNF includes the CP named as "VDU1_CP0" binding to "VDU_1".
    - The number of instances of "VDU_1" can be 0 or 1, and it is designated as 0 by "instantiationLevelId" in instantiateVnfRequest.
    - instantiateVnfRequest includes the information about "VDU1_CP0"

VNFD:
 ```
 VDU_0:
      type: tosca.nodes.nfv.Vdu.Compute
      properties:
        name: VDU_0
        vdu_profile:
          min_number_of_instances: 1
          max_number_of_instances: 1

VDU_1:
      type: tosca.nodes.nfv.Vdu.Compute
      properties:
        name: VDU_1
        vdu_profile:
          min_number_of_instances: 0
          max_number_of_instances: 1

VDU0_CP0:
      type: tosca.nodes.nfv.VduCp
      properties: ...
      requirements:
        - virtual_binding: VDU_0

VDU1_CP0:
      type: tosca.nodes.nfv.VduCp
      properties: ...
      requirements:
        - virtual_binding: VDU_1

             .
             .
             .

- instantiation_levels:
    type: tosca.policies.nfv.InstantiationLevels
    properties:
      levels:
        r-node-min:
          scale_info:
            VDU_1:
              scale_level: 0
        r-node-max:
          scale_info:
            VDU_1:
              scale_level: 1
```

instantiateVnfRequest:
```
{
  "flavourId": "default",
  "instantiationLevelId": "r-node-min",
  "extVirtualLinks": [
    {
      "extCps": [
        {
          "cpConfig": [...],
          "cpdId": "VDU0_CP0"
        },
        {
          "cpConfig": [...],
          "cpdId": "VDU1_CP0"
        }
      ],
      "id": ...,
      "resourceId": ...
    },
  ],
  "vimConnectionInfo": ...,
  "additionalParams": ...,
}

Error:
```
ERROR oslo_messaging.rpc.server Exception during message handlingESC[00m: ValueError: Field `associated_vnfc_cp_id' cannot be None
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/oslo_messaging/rpc/server.py", line 165, in _process_incoming
    res = self.dispatcher.dispatch(message)
  File "/usr/local/lib/python3.8/dist-packages/oslo_messaging/rpc/dispatcher.py", line 309, in dispatch
    return self._do_dispatch(endpoint, method, ctxt, args)
  File "/usr/local/lib/python3.8/dist-packages/oslo_messaging/rpc/dispatcher.py", line 229, in _do_dispatch
    result = func(ctxt, **new_args)
  File "<decorator-gen-94>", line 2, in instantiate
  File "/opt/stack/tacker/tacker/common/coordination.py", line 143, in _synchronized
    return f(*a, **k)
  File "/opt/stack/tacker/tacker/conductor/conductor_server.py", line 1795, in instantiate
    self._instantiate_grant(context,
  File "/opt/stack/tacker/tacker/conductor/conductor_server.py", line 292, in decorated_function
    LOG.warning("Failed notification for vnf "
  File "/usr/local/lib/python3.8/dist-packages/oslo_utils/excutils.py", line 227, in __exit__
    self.force_reraise()
  File "/usr/local/lib/python3.8/dist-packages/oslo_utils/excutils.py", line 200, in force_reraise
    raise self.value
  File "/opt/stack/tacker/tacker/conductor/conductor_server.py", line 247, in decorated_function
    return function(self, context, *args, **kwargs)
  File "/opt/stack/tacker/tacker/conductor/conductor_server.py", line 1042, in _instantiate_grant
    vnflcm_utils._build_instantiated_vnf_info(vnfd_dict,
  File "/opt/stack/tacker/tacker/vnflcm/utils.py", line 545, in _build_instantiated_vnf_info
    inst_vnf_info.ext_cp_info = _set_ext_cp_info(instantiate_vnf_req,
  File "/opt/stack/tacker/tacker/vnflcm/utils.py", line 871, in _set_ext_cp_info
    ext_cp_info = objects.VnfExtCpInfo(
  File "/opt/stack/tacker/tacker/objects/base.py", line 57, in __init__
    super(TackerObject, self).__init__(context, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/oslo_versionedobjects/base.py", line 307, in __init__
    setattr(self, key, kwargs[key])
  File "/usr/local/lib/python3.8/dist-packages/oslo_versionedobjects/base.py", line 72, in setter
    field_value = field.coerce(self, name, value)
  File "/usr/local/lib/python3.8/dist-packages/oslo_versionedobjects/fields.py", line 202, in coerce
    return self._null(obj, attr)
  File "/usr/local/lib/python3.8/dist-packages/oslo_versionedobjects/fields.py", line 180, in _null
    raise ValueError(_("Field `%s' cannot be None") % attr)
ValueError: Field `associated_vnfc_cp_id' cannot be None
```

description: updated
description: updated
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/+/832224

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

Reviewed: https://review.opendev.org/c/openstack/tacker/+/832224
Committed: https://opendev.org/openstack/tacker/commit/98f7150fbb8b8abc677050e8d2e7627498c0f451
Submitter: "Zuul (22348)"
Branch: master

commit 98f7150fbb8b8abc677050e8d2e7627498c0f451
Author: Masaki Oyama <email address hidden>
Date: Mon Mar 7 12:57:11 2022 +0000

    Fix the definition of associated_vnfc_cp_id

    This patch will fix the definition of the field of
    associated_vnfc_cp_id. In the current implementation,
    the field of associated_vnfc_cp_id is not allowed to be null.
    But according to ETSI GS NFV-SOL 003 V3.6.1, the cardinality of
    associatedVnfcCpId is defined as "0..1",
    which means the associated_vnfc_cp_id is nullable.
    Therefore, this patch will fix it to comply with the standard of ETSI.

    Closes-Bug: #1948925
    Change-Id: I612835a7f8dd61c034b0f877d3356c901fc6027f

Changed in tacker:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tacker 7.0.0.0rc1

This issue was fixed in the openstack/tacker 7.0.0.0rc1 release candidate.

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.