OverviewThe 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
- 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[].
Logic1. 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 ParametersThe 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 callVerb | URI | JSON payload (Bare minimal) | Params | Type | Comments | JSON response | Note | POST | /api/ipam/prefixes/{prefix-id}/available-ips/ | { "custom_fields": { "external-key": "test", "resource-name": "cloudParamName" } } | prefix-id | Integer | The 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. |
5. Testing out the DGTo 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].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"
}
]
}
} |
6. Additional notes
Code Block |
---|
| Self Service flow, once the topology-operation run-time assign flow is forked to use the self-service flow, DG will trigger the self service execute node “configAssignmentNode” with the required input to get the resolved artifact template. DG then will persist the template in MDSAL and trigger the rest of capabilities according to execution order. Below is summary of flow. We can discuss the flow in more details on Monday’s call.
vnf-topology-operation
- This is the top level DG that will handle the rpc from MSO and it will invoke other DGs based on svc-action.
vnf-topology-operation-assign
- Called by vnf-topology-operation when svc-action=assign
- execute self-serve forking logic and invoke self-serve-vnf-assign DG
self-serve-vnf-assign
- Called by vnf-topology-operation-assign
- Set vnf-index
- Copy MSO request inputs to service-data
- Call self-serve-ra-assignment if vnf-parameters-data.param_length is not null
- When self-serve-ra-assignment returns success, loop thru VNF capability execution order to call each capability DG by capabaility-name
- Each capability DG will call self-serve-capability-param-resolution to resolve all unresolved value in resource-keys before calling its
- capability component.
- When ALL capability DG returns success, call self-serve-unresolved-composite-data DG.
- Call AAI Put to update AAI
- If ALL capability DG and AAI update are successful, persists service-data in MD-SAL and return SUCCESS to MSO
- If Any capability DG returns failure, persists service-data in MD-SAL and return FAILED to MSO
self-serve-ra-assignment
- Called by self-serve-vnf-assign
- Generate input json string for configAssignmentNode
- Call ConfigAssignmentNode
- Parse ConfigAssignmentNode Response
- Copy RA response to param[]
self-service-capability-param-resolution
- Called by all Capability DGs
- Loop thru all resource-key[].value that contains “$”
- Resolve resource-key[].value by looping thru all param[].value
- Return failure if resource-key[].value cannot be resolved. |
|