Versions Compared

Key

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

...

Code Block
titlecost_evaluation
collapsetrue
Request URI:
	POST http://{msb ip}:{msb port}/api/multicloud/v1/cost_evaluation

Request body:


[
    {
        "cloud-owner": "owner1",
        "cloud-region-id": "region1",

        "directives":[ 
         { 
            "vnfc_directives":[ 
               { 
                  "vnfc_id":"<ID of VNFC>", /*optional, but keep aligned to OOF/SO/MC API to make it simple*/
                  "directives":[
                     { 
                        "directive_name":"<Name of directive,example flavor_directive>",
                        "attributes":[ 
                           { 
                              "attribute_name":"<name of attribute, such as flavor label>",
                              "attribute_value":"<value such as cloud specific flavor>"
                           }
                        ]
                     },
                     { 
                        "directive_name":"<Name of directive,example vnic-info>",
                        "attributes":[ 
                           { 
                              "attribute_name":"<name of attribute, such as vnic-type>",
                              "attribute_value":"<value such as direct/normal>"
                           },
                           { 
                              "attribute_name":"<name of attribute, such as provider netweork>",
                              "attribute_value":"<value such as physnet>"
                           }
                        ]
                     }
                  ]
               }
            ]
         },
         {
            "vnf_directives":{ 
               "directives":[ 
                  { 
                     "directive_name":"<Name of directive>",
                     "attributes":[ 
                        { 
                           "attribute_name":"<name of attribute>",
                           "attribute_value":"<value>"
                        }
                     ]
                  },
                  { 
                     "directive_name":"<Name of directive>",
                     "attributes":[ 
                        { 
                           "attribute_name":"<name of attribute>",
                           "attribute_value":"<value >"
                        },
                        { 
                           "attribute_name":"<name of attribute>",
                           "attribute_value":"<value >"
                        }
                     ]
                  }
               ]
            }
         }
        ]
    },
    {
    
        "cloud-owner": "owner2",
        "cloud-region-id": "region2",

        "directives": []
    }
]

Response:


[
    {
        "cloud-owner": "owner1",
        "cloud-region-id": "region1",
        "net-value": 100
    },
    {
        "cloud-owner": "owner2",
        "cloud-region-id": "region2",
            "net-value": 101
    }
]


Step 4. OOF → MC - Push Cloud Agnostic Policy for the Service Instance 

4a) OOF Processing

The OOF ↔ MC cloud selection API, described below, is filled based on the Cloud Selection Policy for Homing retrieved in step 2) – need OOF code changes. 

OOF

...

<->

...

MC

...

Cloud

...

Selection

...

API

...

--

...

JSON

...

Schema

...

with

...

Use

...

Case

...

Examples

...

as

...

runnable

...

python

...

code:

...

Code Block
languagepy
themeEmacs
titleOOF <-> MC API Examples (Step 4a)
linenumberstrue
collapsetrue
//flexibility of having cloud type in the new API provides fine grained control, addresses capacity/cost differences across different cloud owners/regions and ensures backward compatibility

Proposed API URL: http://msb:80/api/multicloud/v0/intent_based_cloud_selection


#
#Spec Reference: https://wiki.onap.org/display/DW/Edge+Scoping+MVP+for+Casablanca+-+ONAP+Enhancements#EdgeScopingMVPforCasablanca-ONAPEnhancements-Cloud-agnosticPlacement/Networking&HomingPolicies(Phase1-CasablancaMVP,Phase2-StretchGoal)
#

from jsonschema import validate

oof_mc_policy_api_request_schema = {
        #list of VIM ids
        "Cloud Owner & Cloud Region List (VIM ids)": {"type", "array"},

        "oof-mc-policy-api-request": {
                "type": "array",
                "items": { "$ref": "#/definitions/xxx1" }
        },
        "definitions": {
                "xxx1": {
                        "type": "object",
                        "required": ["cloud-cost-evaluation", "cloud-deployment-intent"],
                        "properties" : {

                                # VNFC is not used in the OOF->MC path for R3
                                # This is kept to be consistent with the SO-> MC path
                                # As an example, vDNS VNF in ONAP has 3 VNFCs-DNS, Packet Gen & Load Balancer                      # each of the VNFCs could have different cloud policies
                                "vnfc": {"type": "string"},

                                # evaluate cloud cost if set
                                # cost is fixed per cloud type for all workloads, simplifying assumption for R3
                                # cost specified in the respective plugin through a configuration file
                                "cloud-cost-evaluation" : {"type" : "boolean"},

                                # cloud-specific realization of the specified deployment intent
                                # happens in multi-cloud in the cloud-specific plugin
                                "cloud-deployment-intent": {
                                                "type": "array",
                                                "items": { "$ref": "#/definitions/xxx2" }
                                },
                                "definitions": {
                                        "xxx2": {
                                                "type": "object",
                                                "properties" : {
                                                        "Infrastructure High Availability for VNF": {"type", "boolean"},

                                                        "Infrastructure Resource Isolation for VNF": {"type", "string"},

                                                        # Infrastructure Resource Isolation for VNF
                                                        # Only certain pre-defined over-subscription values are allowed to
                                                        # reflect practical deployment and simplify implementation for R3
                                                        "Infrastructure Resource Isolation for VNF - Burstable QoS Oversubscription Percentage": {"type": "int"},
                                                },
                                        },
                                },
                        },
                },
        },
}

oof_mc_policy_api_response_schema = {
        "oof-mc-policy-api-response": {
                "type": "array",
                "items": { "$ref": "#/definitions/xxx" }
        },
        "definitions": {
                "xxx": {
                        "type": "object",
                        "required": [ "VIM id", "net-value" ],
                        "properties": {

                                # VIM id
                                "VIM id": {
                                  "type": "string",
                                },

                                # For R3, net-value signifies cost per VIM id
                                # Referring to cloud-cost-evaluation in the API from OOF -> MC
                                        # cost is fixed per cloud type for all workloads
                                        # cost specified in the respective plugin through a configuration file
                                "net-value": {
                                  "type": "number",
                                }
                        }
                }
        }
}

#
#Example 1: vCPE, Burstable QoS
#vCPE: Infrastructure Resource Isolation for VNF with Burstable QoS
#
oof_mc_policy_api_instance1 = {
        #list of VIM ids
        "Cloud Owner & Cloud Region (VIM id)": {"Azure 1", "Azure 2", "VMware VIO 1"},

        "oof-mc-policy-request": [
                {
                        "vnfc": "vgw",
                        #list of VIM ids

                        "cloud-deployment-intent": [
                                {
                                                "Infrastructure Resource Isolation for VNF": "Burstable QoS",
                                                "Infrastructure Resource Isolation for VNF - Burstable QoS Oversubscription Percentage": 25,
                                }
                        ],
                },
        ]
}

#
#Example 2:
#vCPE: Infrastructure Resource Isolation for VNF with Guaranteed QoS
#
oof_mc_policy_api_instance2 = {
        #list of VIM ids
        "Cloud Owner & Cloud Region List (VIM ids)": {"Azure 1", "Azure 2", "VMware VIO 1", "Wind River Titanium 1"},

        "oof-mc-policy-request": [
                {
                        "vnfc": "vgw",
                        "cloud-cost-evaluation": True,

                        "cloud-deployment-intent": [
                                {
                                        "Infrastructure Resource Isolation for VNF": "Guaranteed QoS",
                                }
                        ],
                },
        ],
}

#
#Example 3:
#vDNS: Infrastructure HA for VNF & Infrastructure Resource Isolation for VNF with Burstable QoS
#
oof_mc_policy_api_instance3 = {
        #list of VIM ids
        "Cloud Owner & Cloud Region List (VIM ids)": {"Azure 1", "Azure 2", "VMware VIO 1", "Wind River Titanium 1"},

        "oof-mc-policy-request": [
                {
                        "vnfc": "vdns",
                        "cloud-cost-evaluation": True,
                        "cloud-deployment-intent": [
                                {
                                        "Infrastructure High Availability for VNF": True,
                                        "Infrastructure Resource Isolation for VNF": "Burstable QoS",
                                        "Infrastructure Resource Isolation for VNF - Burstable QoS Oversubscription Percentage": 25,
                                }
                        ],
                }
        ],
}

#
# Example 4:
# vDNS: Infrastructure HA for VNF & Infrastructure Resource Isolation for VNF
# with Guaranteed QoS
#
oof_mc_policy_api_instance4 = {
        #list of VIM ids
        "Cloud Owner & Cloud Region List (VIM ids)": {"Azure 1", "Azure 2", "VMware VIO 1", "Wind River Titanium 1"},
        "oof-mc-policy-request": [
                {
                        "vnfc": "vdns",
                        "cloud-cost-evaluation": True,
                        "cloud-deployment-intent": [
                                {
                                        "Infrastructure High Availability for VNF": True,
                                        "Infrastructure Resource Isolation for VNF": "Guaranteed QoS",
                                },
                        ],
                },
        ],
}

oof_mc_policy_api_response_instance = {
        "oof-mc-policy-api-response": [
                {
                        "VIM id": "Azure 1",
                        "net-value": 100
                },
                {
                        "VIM id": "VMware VIO 1",
                        "net-value": 101
                },
                {
                        "VIM id": "Wind River Titanium 2",
                        "net-value": 102
                },
                {
                        "VIM id": "Wind River Titanium 1",
                        "net-value": 102
                },
        ],
}

validate(oof_mc_policy_api_instance1, oof_mc_policy_api_request_schema)
validate(oof_mc_policy_api_instance2, oof_mc_policy_api_request_schema)
validate(oof_mc_policy_api_instance3, oof_mc_policy_api_request_schema)
validate(oof_mc_policy_api_instance4, oof_mc_policy_api_request_schema)

validate(oof_mc_policy_api_response_instance, oof_mc_policy_api_response_schema)

...