Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Expand
titlePlugin IP Assignment DG flow using generic-resource-api [Assign]

Overview

The generic-resource-api is used to assign cloud parameter assignment during instantiation flow. The vf-module instantiation flow begins with the main DG, self-serve-vfmodule-assign, when the svc-action = assign in the rpc request.

The main DG will call a series of sub-DGs according to the execution order of all the predefined capability components, such as generate-name, vlan-tag-assignment, eipam-ip-assignment, etc.

For IP assignment, the main DG calls the sub-DG, self-serve-eipam-ip-assignment to start the ip assignment process.

This wiki serves as the blueprint for capability integration with generic-resource-api for ip assignments, and it is used to integrate EIPAM custom plugin to obtain ip address assignments during vf-module orchestration.

Prerequisite                  

The following parameters must be set in context memory prior to the self-serve-eipam-ip-assignment sub-DG is called.

  • ss.capability-name
    • value that matches the capability DG name; i.e. self-serve-eipam-ip-assignment
  • ss.capability-action
    • assign
  • vnf-index
    • The array index of the vnf that owns this vf-module in config tree
  • vf-module-index
    • The array index of this vf-module in config tree
  • service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[].

Logic

1.   Unresolved Parameter Resolution

-        Calls self-serve-capability-param-resolution DG to resolve all the unresolved values in vf-module-parameters.param[].resource-resolution-data.resource-key[].value where resource-resolution-data.capability-name matches this DG name.

2.   Call EIPAM Plugin

-        The EIPAM plugin returns the ip assignment in a context variable, called eipam-ip-block

-        eipam-ip-block.plans[].requests[].ip-prefix

-        eipam-ip-block.plans[].requests[].ip-prefix-length

-        eipam-ip-block.plans[].requests[].ReservedAssignments[0]. ReservedAssignment[3].ReservedKeyIPAddress

-        Insert an entry to EIPAM_IP_ASSIGNMENTS table

3.   Set Heat Parameters

The sub-DG, self-serve-vfmodule-assign will set value of then heat parameters based on the EIPAM

-        vmxvre_oam_ip_0 = eipam-ip-block.plans[].requests[].ip-prefix

-        vmxvre_oam_ip_prefix_0 = eipam-ip-block.plans[].requests[].ip-prefix-length

-        vmxvre_oam_gateway = eipam-ip-block.plans[].requests[].ReservedAssignments[0].

-        ReservedAssignment[3].ReservedKeyIPAddress

4.   Netbox API call

VerbURIJSON payload (Bare minimal)ParamsTypeCommentsJSON responseNote
POST/api/ipam/prefixes/{prefix-id}/available-ips/

{

  "custom_fields": {

    "external-key": "test",

    "resource-name": "cloudParamName"

  }

}

prefix-idIntegerThe ID of the prefix from which to retrieve next available IP

{


    "id": 4,


    "address": "192.168.10.2/32",


    "vrf": null,


    "tenant": null,


    "status": 1,


    "role": null,


    "interface": null,


    "description": "",


    "nat_inside": null,


    "custom_fields": {


        "external-key": "test",


        "resource-name": "cloudParamName"


    },


    "created": "2018-08-30",


    "last_updated": "2018-08-30T14:59:05.277820Z"


}

Loop function within the SDNC for getting the next available for each cloud param resource. 
Expand
titlePlugin IP Unassignment DG flow using generic-resource-api [Unassignment]

5.   Testing out the DG

To test the DG to resolve multiple IPs, that mock-up data can be used:

Code Block
{
  "input": {
    "module-name": "GENERIC-RESOURCE-API",
    "rpc-name": "self-serve-netbox-ip-assignment",
    "mode": "sync",
    "sli-parameter": [
      {
        "parameter-name": "ss.capability-name",
        "string-value": "netbox-ip-assign"
      },
      {
        "parameter-name": "ss.capability-action",
        "string-value": "assign"
      },
      {
        "parameter-name": "vnf-index",
        "int-value": 0
      },
      {
        "parameter-name": "vf-module-index",
        "int-value": 0
      },
      {
        "parameter-name": "service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0

Overview

The generic-resource-api is used to unassign cloud parameters during the vf-module unassign flow. The vf-module unassign flow begins with the main DG, self-serve-vfmodule-unassign, when the svc-action = unassign in the rpc request.

The main DG will call a series of sub-DGs according to the execution order of all the predefined capability components, such as generate-name, vlan-tag-assignment, eipam-ip-assignment, etc to unassign cloud parameters.  Upon successful unassignment, the main DG will clear the service-data data in MD-SAL

Prerequisites

The following parameters must be set in context memory prior to the self-serve-eipam-ip-assignment sub-DG is called.

  • ss.capability-name

    • value that matches the capability DG name; i.e. self-serve-eipam-ip-assignment

  • ss.capability-action

    • unassign

  • vnf-index

    • The array index of the vnf that owns this vf-module in config tree

  • vf-module-index

    • The array index of this vf-module in config tree

  • service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index
    ].vf-module-data.vf-module-topology.vf-module-parameters.param
    [].
    _length",
            "string-value": "2"
          },
          {
            "parameter-name": "service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[0].name",
            "string-value": "unprotected_private_net_cidr"
          },
          {
            "parameter-name": "service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[0].resource-resolution-data.capability-name",
            "string-value": "netbox-ip-assign"
          },
          {
            "parameter-name": "service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[0].resource-resolution-data.status",
            "string-value": "PENDING"
          },
          {
            "parameter-name": "service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[0].resource-resolution-data.resource-key_length",
            "int-value": 4
          },
          {
            "parameter-name": "service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[0].resource-resolution-data.resource-key[0].name",
            "string-value": "service-instance-id"
          },
          {
            "parameter-name": "service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[0].resource-resolution-data.resource-key[0].value",
            "string-value": "1234-56789-4321-98766"
          },
          {
            "parameter-name": "service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[0].resource-resolution-data.resource-key[1].name",
            "string-value": "prefix-id"
          },
          {
            "parameter-name": "service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[0].resource-resolution-data.resource-key[1].value",
            "string-value": "1"
          },
          {
            "parameter-name": "service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[0].resource-resolution-data.resource-key[2].name",
            "string-value": "vf-module-id"
          },
          {
            "parameter-name": "service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[0].resource-resolution-data.resource-key[2].value",
            "string-value": "9999-999999-9999-999999"
          },
          {
            "parameter-name": "service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[0].resource-resolution-data.resource-key[3].name",
            "string-value": "external_key"
          },
          {
            "parameter-name": "service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[0].resource-resolution-data.resource-key[3].value",
            "string-value": "david-the-boss-blah"
          },
          {
            "parameter-name": "service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[1].name",
            "string-value": "protected_private_net_cidr"
          },
          {
            "parameter-name": "service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[1].resource-resolution-data.capability-name",
            "string-value": "netbox-ip-assign"
          },
          {
            "parameter-name": "service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[1].resource-resolution-data.status",
            "string-value": "PENDING"
          },
          {
            "parameter-name": "service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[1].resource-resolution-data.resource-key_length",
            "int-value": 4
          },
          {
            "parameter-name": "service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[1].resource-resolution-data.resource-key[0].name",
            "string-value": "service-instance-id"
          },
          {
            "parameter-name": "service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[1].resource-resolution-data.resource-key[0].value",
            "string-value": "1234-56789-4321-98765"
          },
          {
            "parameter-name": "service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[1].resource-resolution-data.resource-key[1].name",
            "string-value": "prefix-id"
          },
          {
            "parameter-name": "service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[1].resource-resolution-data.resource-key[1].value",
            "string-value": "1"
          },
          {
            "parameter-name": "service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[1].resource-resolution-data.resource-key[2].name",
            "string-value": "vf-module-id"
          },
          {
            "parameter-name": "service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[1].resource-resolution-data.resource-key[2].value",
            "string-value": "9999-999999-9999-999999"
          },
          {
            "parameter-name": "service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[1].resource-resolution-data.resource-key[3].name",
            "string-value": "external_key"
          },
          {
            "parameter-name": "service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[1].resource-resolution-data.resource-key[3].value",
            "string-value": "david-the-boss-blah-2"
          }
        ]
      }
    }
    done as part of the VF Module delete action.
    Expand
    titlePlugin IP Unassignment DG flow using generic-resource-api [Unassignment]


    Overview

    The generic-resource-api is used to unassign cloud parameters during the vf-module unassign flow. The vf-module unassign flow begins with the main DG, self-serve-vfmodule-unassign, when the svc-action = unassign in the rpc request.

    The main DG will call a series of sub-DGs according to the execution order of all the predefined capability components, such as generate-name, vlan-tag-assignment, eipam-ip-assignment, etc to unassign cloud parameters.  Upon successful unassignment, the main DG will clear the service-data data in MD-SAL

    Prerequisites

    The following parameters must be set in context memory prior to the self-serve-eipam-ip-assignment sub-DG is called.


    • ss.capability-name

      • value that matches the capability DG name; i.e. self-serve-eipam-ip-assignment

    • ss.capability-action

      • unassign

    • vnf-index

      • The array index of the vnf that owns this vf-module in config tree

    • vf-module-index

      • The array index of this vf-module in config tree

    • service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[].

    Logic

    1.   Set EIPAM_IP_ASSIGNMENTS status

    • set EIPAM_IP_ASSIGNMENTS.status t0 PENDING_DELETE by service-instance-id and client-key

    2.   Call EIPAM Plugin unassignIp

    • Calls EIPAM plugin unassignIp method to unassign ip from EIPAM

    3.   Set Heat Parameters status

    • Set service-data … vf-module-parameters.param[].resource-resolution-data.status to DELETED for the following params

      • vmxvre_oam_ip_0

      • vmxvre_oam_ip_prefix_0

      • vmxvre_oam_gateway

    4.   Netbox API call

    ActionVerbURIJSON payload (Bare minimal)ParamsTypeCommentsJSON responseNote
    Delete IPDELETE/api/ipam/ip-addresses/{ip-id}/-ip-idIntegerThe ID of the IP address to delete-done as part of the VF Module delete action.

    5.   Testing out the DG

    To test the DG to release multiple IPs, that mock-up data can be used:

    Code Block
    {
      "input": {
        "module-name": "GENERIC-RESOURCE-API",
        "rpc-name": "self-serve-netbox-ip-assignment",
        "mode": "sync",
        "sli-parameter": [
          {
            "parameter-name": "ss.capability-name",
            "string-value": "netbox-ip-assign"
          },
          {
            "parameter-name": "ss.capability-action",
            "string-value": "unassign"
          },
          {
            "parameter-name": "vnf-index",
            "int-value": 0
          },
          {
            "parameter-name": "vf-module-index",
            "int-value": 0
          },
          {
            "parameter-name": "service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param_length",
            "string-value": "2"
          },
          {
            "parameter-name": "service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[0].resource-resolution-data.capability-name",
            "string-value": "netbox-ip-assign"
          },
          {
            "parameter-name": "service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[0].resource-resolution-data.status",
            "string-value": "PENDING"
          },
          {
            "parameter-name": "service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[0].resource-resolution-data.resource-key_length",
            "int-value": 2
          },
          {
            "parameter-name": "service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[0].resource-resolution-data.resource-key[0].name",
            "string-value": "service-instance-id"
          },
          {
            "parameter-name": "service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[0].resource-resolution-data.resource-key[0].value",
            "string-value": "1234-56789-4321-98766"
          },
          {
            "parameter-name": "service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[0].resource-resolution-data.resource-key[1].name",
            "string-value": "external_key"
          },
          {
            "parameter-name": "service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[0].resource-resolution-data.resource-key[1].value",
            "string-value": "david-the-boss-blah"
          },
          {
            "parameter-name": "service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[1].resource-resolution-data.capability-name",
            "string-value": "netbox-ip-assign"
          },
          {
            "parameter-name": "service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[1].resource-resolution-data.status",
            "string-value": "PENDING"
          },
          {
            "parameter-name": "service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[1].resource-resolution-data.resource-key_length",
            "int-value": 2
          },
          {
            "parameter-name": "service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[1].resource-resolution-data.resource-key[0].name",
            "string-value": "service-instance-id"
          },
          {
            "parameter-name": "service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[1].resource-resolution-data.resource-key[0].value",
            "string-value": "1234-56789-4321-98765"
          },
          {
            "parameter-name": "service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[1].resource-resolution-data.resource-key[1].name",
            "string-value": "external_key"
          },
          {
            "parameter-name": "service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[1].resource-resolution-data.resource-key[1].value",
            "string-value": "david-the-boss-blah-2"
          }
        ]
      }
    }

    Logic

    1.   Set EIPAM_IP_ASSIGNMENTS status

    • set EIPAM_IP_ASSIGNMENTS.status t0 PENDING_DELETE by service-instance-id and client-key

    2.   Call EIPAM Plugin unassignIp

    • Calls EIPAM plugin unassignIp method to unassign ip from EIPAM

    3.   Set Heat Parameters status

    • Set service-data … vf-module-parameters.param[].resource-resolution-data.status to DELETED for the following params

      • vmxvre_oam_ip_0

      • vmxvre_oam_ip_prefix_0

      • vmxvre_oam_gateway

    Netbox Capability:

    ActionVerbURIJSON payload (Bare minimal)ParamsTypeCommentsJSON responseNote
    Delete IPDELETE/api/ipam/ip-addresses/{ip-id}/-ip-idIntegerThe ID of the IP address to delete-