Skip to content

Dependent VNFs receive single set of cfg values from multiple instances #272

@wittling

Description

@wittling

This is a race condition issue. It affects descriptors where a VNF ("VNF D") has:

  • a dependency with two or more VNFs of same type (VNF 1 and VNF 2),
  • VNF 1 and VNF 2 are of same type (different names), and each uses same set of parameters (confkey names), even if the configurations themselves have different names.

To re-create this issue:

  1. Create 1st VNF (name=l3gw1, type=l3gw)
    Create a configuration (name=l3gw1cfg), and include 3 parameters. Initialize these parameters to numerics i.e. { "confKey":"parm1", "value":"1" }, { "confKey":"parm2", "value":"2" }, { "confKey":"parm3", "value":"3" }

  2. Create 2nd VNF (name=l3gw2, type=l3gw), and include the same 3 parameters. Initialize these parameters to alphabetics i.e. { "confKey":"parm1", "value":"a" }, { "confKey":"parm2", "value":"b" }, { "confKey":"parm3", "value":"c" }

  3. Pass all of these parameters to a SINGLE dependent VNF ("VNF D") by configuring dependency in NSD. Important: Make sure you have a single VNF that depends on both VNF 1 and VNF 2 above.

  4. In the INSTANTIATE scripts of VNF 1 and VNF 2, dump the environment variables to a file. (at runtime, these will print out properly as initialized in the descriptor).

  5. In the CONFIGURE scripts of the VNF ("VNF D") that depends on VNF 1 and VNF 2, make sure you dump the parameters out to a file that ends in ".$$" so that you don't overwrite or append the same file. At runtime, you will actually get two files - one file as VNF 1 calls in, and one for VNF 2 as it calls in.

  6. After the CONFIGURE life cycle event of VNF D, proceed to examine the parameter values that are prefixed with the type prefix ("l3gw_").
    i.e. cat vnf1.env.3601 | sort
    i.e. cat vnf2.env.2743 | sort

You will notice that although the script ran TWICE - once for each VNF, you only see values of ONE of the VNFs in BOTH env files. Whether you see the numerics or the alphabetics depends on who wins the race condition. I believe it is the FIRST VNF that wins, based on my testing. Because the VNF with numerics ran its INSTANTIATE 3 seconds prior to the VNF using alphabetics and the scripts in my test were printing the numerics (this only my theory based on that observation).

Not having studied the source code on this, it appears to me as though the orchestrator has a single dictionary with ConfKeys, when it probably needs to maintain a dictionary per VNF instance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions