conductor._ scale_grant and conductor._heal_grant's processing error

Bug #1930782 reported by Yi Feng
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tacker
Fix Released
Medium
Yi Feng

Bug Description

**Scale grant**
In the processing of Scale-out, "ID (random value) of add_resources" is generated and Grant request is sent before storing into vnfc_resource info.
In the case of Instantiate, vnfc_resouce_info's ID will be generated in conductor_server, and then use the id for grant's add_resources's ID before sending Grant. While in the case of Scale, vnfc_resouce_info's ID will be generated in VnfLcmDriver after sending grant.

https://opendev.org/openstack/tacker/src/branch/master/tacker/vnfm/infra_drivers/openstack/openstack.py#L1843-L1853
        for resource_name, resource in nested_hot['resources'].items():
            if resource['type'] == 'OS::Nova::Server':
                for i in range(size):
                    add_uuid = uuidutils.generate_uuid()
                    rsc = objects.ResourceDefinition(
                        id=add_uuid,
                        type=constants.TYPE_COMPUTE,
                        vdu_id=resource_name,
                        resource_template_id=resource_name)
                    add_resources.append(rsc)
                    uuid_list.append(add_uuid)
https://opendev.org/openstack/tacker/src/branch/master/tacker/vnfm/infra_drivers/openstack/openstack.py#L1507-L1519
                for rsc in scale_resurce_list:
                    if rsc.resource_type == 'OS::Nova::Server':
                        if rsc.physical_resource_id not in vnfc_rsc_list:
                            rsc_info = heatclient.resource_get(
                                scale_rsc.physical_resource_id,
                                rsc.resource_name)
                            LOG.debug("rsc %s", rsc_info)
                            if 'COMPLETE' in rsc.resource_status and '\
                            INIT_COMPLETE' != rsc.resource_status:
                                vnfc_resource_info = objects.VnfcResourceInfo()
                                vnfc_resource_info.id =\
                                    uuidutils.generate_uuid()
                                vnfc_resource_info.vdu_id = rsc.resource_name

As a result, in the processing of Scale-Out, it is not possible to obtain the correct grant.add_resource.zone_id.
vnfc_resource.id and grant.add_resources.resource_definition_id do not match.

**Heal grant**
When the request for heal_grant is executed, the ID of vnfc_resource_info will be updated and use it for add_resources'id in _heal_grant and saved in vnf_dict.
However, in post_heal_vnf after the end of Heal, the data of vnf_dict is not used at all. (ID of vnfc_resource_info has not been updated)
The data updated by heal_grant is not reflected in vnf_instance.instantiated_vnf_info.vnfc_resource_info of post_heal_vnf. So, the vnf_resource_info'id will not match the id of add_resources.
At the same time, the processing of heal_grant does not distinguish the situation of heal part and heal entire. In heal_entire, involving VL and Linkport re-add.
https://opendev.org/openstack/tacker/src/branch/master/tacker/conductor/conductor_server.py#L1274-L1299
       for vnfc_resource in vnf_instantiated_info_after.vnfc_resource_info:
                ....
                add_uuid = uuidutils.generate_uuid()
                resource = objects.ResourceDefinition()
                resource.id = add_uuid
                resource.type = constants.TYPE_COMPUTE
                resource.vdu_id = vnfc_resource.vdu_id
                resource.resource_template_id = vnfc_resource.vdu_id
                add_resources.append(resource)
                ...
            vnfc_resource.id = add_uuid
            vnfc_resource.compute_resource = objects.ResourceHandle()
...
      vnf_dict['vnf_instantiated_info_after'] = vnf_instantiated_info_after

https://opendev.org/openstack/tacker/src/branch/master/tacker/vnfm/infra_drivers/openstack/openstack.py#L1369-L1370
    def post_heal_vnf(self, context, vnf_instance, vim_connection_info,
                      heal_vnf_request):
        """Update resource_id for each vnfc resources
        :param context: A RequestContext
        :param vnf_instance: tacker.objects.VnfInstance to be healed
        :vim_info: Credentials to initialize Vim connection
        :heal_vnf_request: tacker.objects.HealVnfRequest object containing
                           parameters passed in the heal request
        """

To fix above bugs, we will change the processing of scale_grant and heal_grant.

Yi Feng (fengyi765)
Changed in tacker:
assignee: nobody → Yi Feng (fengyi765)
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/+/795016

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

Reviewed: https://review.opendev.org/c/openstack/tacker/+/795016
Committed: https://opendev.org/openstack/tacker/commit/9e13a55aba31c47702d5aa835735aca6706e5a09
Submitter: "Zuul (22348)"
Branch: master

commit 9e13a55aba31c47702d5aa835735aca6706e5a09
Author: Yi Feng <email address hidden>
Date: Mon Jun 7 12:31:17 2021 +0900

    Modify processing of _heal_grant and _scale_grant

    In NFV-SOL003 V2.6.1, the add_resources'id in grant should be
    same as the vnfc_resource_info'id. However, at present, if
    you execute heal_grant and scale_grant request, the add_resources's
    resource_definition_id in grantResponse cannot match the
    vnfc_resource_info.id.

    In _scale_grant, to fix this bug, we changed the processing
    of _scale_grant in openstack._get_grant_resource_scale_out method.
    Firstly initialize the data of vnfc_resource_info according
    to the input parameters and the vnfd file, then initialize
    the add_resources data of grant according to the
    vnfc_resource_info data. After scaling out, store the data
    in the stack into vnfc_resource_info in the
    openstack.scale_resource_update method.

    In addition, in openstack._get_grant_resource_scale_out, there is
    also a problem with the placement_constraint rule setting, which
    is also corrected in this patch.

    In _heal_grant, if heal entire vnf_instance, we initialize
    remove_resources used old vnf_instance's info, and then
    reinitialize vnf_instance's info and use them to initialize
    add_resources. If heal partial vnf_instance, we just use
    update_resources in grant.

    For instantiate, if you need to use the data obtained by
    instantiate_grant in instantiate_end, the process should
    execute the post_instantiate_vnf method before instantiate_end,
    so the vnflcm_driver._instantiate_vnf method has also been
    modified.

    Closes-Bug: #1930782
    Change-Id: I1008472f5a7104324b61a413052dc44bc84c7ade

Changed in tacker:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tacker (stable/xena)

Fix proposed to branch: stable/xena
Review: https://review.opendev.org/c/openstack/tacker/+/810099

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tacker (stable/xena)

Reviewed: https://review.opendev.org/c/openstack/tacker/+/810099
Committed: https://opendev.org/openstack/tacker/commit/fa73e438cc4f3e5edb795f70b0e1960b0edd8439
Submitter: "Zuul (22348)"
Branch: stable/xena

commit fa73e438cc4f3e5edb795f70b0e1960b0edd8439
Author: Yi Feng <email address hidden>
Date: Mon Jun 7 12:31:17 2021 +0900

    Modify processing of _heal_grant and _scale_grant

    In NFV-SOL003 V2.6.1, the add_resources'id in grant should be
    same as the vnfc_resource_info'id. However, at present, if
    you execute heal_grant and scale_grant request, the add_resources's
    resource_definition_id in grantResponse cannot match the
    vnfc_resource_info.id.

    In _scale_grant, to fix this bug, we changed the processing
    of _scale_grant in openstack._get_grant_resource_scale_out method.
    Firstly initialize the data of vnfc_resource_info according
    to the input parameters and the vnfd file, then initialize
    the add_resources data of grant according to the
    vnfc_resource_info data. After scaling out, store the data
    in the stack into vnfc_resource_info in the
    openstack.scale_resource_update method.

    In addition, in openstack._get_grant_resource_scale_out, there is
    also a problem with the placement_constraint rule setting, which
    is also corrected in this patch.

    In _heal_grant, if heal entire vnf_instance, we initialize
    remove_resources used old vnf_instance's info, and then
    reinitialize vnf_instance's info and use them to initialize
    add_resources. If heal partial vnf_instance, we just use
    update_resources in grant.

    For instantiate, if you need to use the data obtained by
    instantiate_grant in instantiate_end, the process should
    execute the post_instantiate_vnf method before instantiate_end,
    so the vnflcm_driver._instantiate_vnf method has also been
    modified.

    Closes-Bug: #1930782
    Change-Id: I1008472f5a7104324b61a413052dc44bc84c7ade

tags: added: in-stable-xena
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tacker 6.0.0.0rc2

This issue was fixed in the openstack/tacker 6.0.0.0rc2 release candidate.

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.