...
2a) OOF Processing - the fetched Policy (example below) is stored in a local data structure and is available for further use (need OOF code changes).
JSON Schema with Use Case Examples:
Code Block | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
# #Spec Reference: https://wiki.onap.org/display/ //Example 1: vCPE, Burstable QoS //vCPE: Infrastructure Resource Isolation for VNF with Burstable QoS // { DW/Edge+Scoping+MVP+for+Casablanca+-+ONAP+Enhancements#EdgeScopingMVPforCasablanca-ONAPEnhancements-Cloud-agnosticPlacement/Networking&HomingPolicies(Phase1-CasablancaMVP,Phase2-StretchGoal) # from jsonschema import validate oof_enhanced_cloud_selection_policy_schema = { "service": {"cloudSelectionPolicytype", "policyName": "oofMulti-cloudCasablanca.cloudSelectionPolicy_vCPE_VNF", "description": "Cloud Selection Policy for vCPE VNFs", "templateVersion": "0.0.1", "version": "oofMulti-cloudCasablanca", "priority": "3", "riskType": "test", "riskLevel": "2", "guard": "False", "content": { //Note on cloudOwner, cloudRegion usage: e.g. //"cloudOwner": "xyz", //can be a specific cloud owner such as Azure, VMware VIO, Wind River Titanium Cloud etc. //"cloudRegion": "1", //can be a specific cloud region for a cloud owner //If no cloudOwner is specified, policy applies to all cloudOwners //If no cloudRegion is specified, policy applies to all cloudRegions {//new in R3 "cost-intent": "TRUE", }, {//new in R3 "cloudOwner": "VMware VIO", //can be a specific cloud owner such as Azure, VMware VIO, Wind River Titanium Cloud etc. "deployment-intent": { "name": "Infrastructure Resource Isolation for VNF", // realization possible without dedicating CPU and Memory, refer to section on "Cloud Resource Partitioning for Differentiated QoS" // on how this can help in offering tiered services "qosProperty": { {"Burstable QoS": "TRUE", "Burstable QoS Oversubscription Percentage": "25"} } } }, } "resources": ["vgw", "vgmux"], //"vgw" is also interchangeably used as "vg" "applicableResources": "any", "identity": "cloud-atrributes", "policyScope": ["vCPE", "US", "INTERNATIONAL", "ip", "vgw", "vgmux"], "policyType": "AllPolicy" } // //Example 2: //vCPE: Infrastructure Resource Isolation for VNF with Guaranteed QoS // { "service": "cloudSelectionPolicy", "policyName": "oofMulti-cloudCasablanca.cloudSelectionPolicy_vCPE_VNF", "description": "Cloud Selection Policy for vCPE VNFs", "templateVersion": "0.0.1", "version": "oofMulti-cloudCasablanca", "priority": "3", "riskType": "test", "riskLevel": "2", "guard": "False", "content": { //Note on cloudOwner, cloudRegion usage: e.g. //"cloudOwner": "xyz", //can be a specific cloud owner such as Azurestring"}, "policyName": {"type": "string"}, "description": {"type": "string"}, "templateVersion": {"type": "string"}, "version": {"type": "string"}, "priority": {"type": "string"}, "riskType": {"type": "string"}, "riskLevel": {"type": "string"}, "guard": {"type": "string"}, "content": {"type" : "object"}, "properties" : { # vnfc is not used in the OOF->MC path for R3, this is kept to be consistent # with the SO-> MC path "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 "cost-intent" : {"type" : "boolean"}, "deployment-intent": {"type": "object"}, "properties" : { # Azure, K8S, OpenStack, VMware VIO, Wind River Titanium Cloud etc. //"cloudRegion": "1", //can be a specific cloud region for a cloud owner //If no cloudOwner is specified, policy applies to all cloudOwners //If no cloudRegion is specified,"Cloud policyType applies to all cloudRegions {//new in R3 "cost-intent": "TRUE", }, {//new in R3 "deployment-intent": { "name": "Infrastructure Resource Isolation for VNF", // realization possible without dedicating CPU and Memory, refer to section on "Cloud Resource Partitioning for Differentiated QoS" // on how this can help in offering tiered services "qosProperty": { {"Guaranteed QoS": "TRUE"} } } } } "resources": ["vgw", "vgmux"], //"vgw" is also interchangeably used as "vg" "applicableResources": "any", "identity": "cloud-atrributes", "policyScope": ["vCPE", "US", "INTERNATIONAL", "ip", "vgw", "vgmux"], "policyType": "AllPolicy" } // //Example 3: //vDNS: Infrastructure HA for VMs in a VNF & Infrastructure Resource Isolation for VNF with Burstable QoS // { "service": "cloudSelectionPolicy", "policyName": "oofMulti-cloudCasablanca.cloudSelectionPolicy_vDNS_VNF", "description": "Cloud Selection Policy for vDNS VNFs", "templateVersion": "0.0.1", "version": "oofMulti-cloudCasablanca", "priority": "3", "riskType": "test", "riskLevel": "2", "guard": "False", "content": { //Note on cloudOwner, cloudRegion usage: e.g. //"cloudOwner": "xyz", //can be a specific cloud owner such as Azure, VMware VIO, Wind River Titanium Cloud etc. //"cloudRegion": "1", //can be a specific cloud region for a cloud owner //If no cloudOwner is specified, policy applies to all cloudOwners //If no cloudRegion is specified, policy applies to all cloudRegions {//new in R3 "cost-intent": "TRUE", }, {//new in R3 "cloudOwner": "VMware VIO", //can be a specific cloud owner such as Azure, VMware VIO, Wind River Titanium Cloud etc. "deployment-intent": { "name": "Infrastructure Resource Isolation for VNF", // realization possible without dedicating CPU and Memory, refer to section on "Cloud Resource Partitioning for Differentiated QoS" // on how this can help in offering tiered services "qosProperty": { {"Burstable QoS": "TRUE", "Burstable QoS Oversubscription Percentage": "25"} } } }, {//new in R3 "deployment-intent": { "name": "Infrastructure High Availability (HA) for VNF", } }, } "resources": ["vDNS"], "applicableResources": "any", "identity": "cloud-atrributes", "policyScope": ["vDNS", "US", "INTERNATIONAL", "vDNS"], "policyType": "AllPolicy" } // //Example 4: //vDNS: Infrastructure HA for VMs in a VNF & Infrastructure Resource Isolation for VNF with Guaranteed QoS // { (Cloud Provider)": {"type", "string"}, "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"}, }, }, "required": ["cost-intent", "deployment-intent"], "resources": {"type", "array"}, #"vgw" is also interchangeably used as "vg" "applicableResources": {"type", "string"}, "identity": {"type", "string"}, "policyScope": {"type", "array"}, "policyType": {"type", "string"}, } # #Example 1: vCPE, Burstable QoS #vCPE: Infrastructure Resource Isolation for VNF with Burstable QoS # oof_mc_policy_api_instance1 = { "service": "cloudSelectionPolicy", "policyName": "oofMulti-cloudCasablanca.cloudSelectionPolicy_vDNSvCPE_VNF", "description": "Cloud Selection Policy for vDNSvCPE VNFs", "templateVersion": "0.0.1", "version": " "version": "oofMulti-cloudCasablanca", "priority": "3", "riskType": "test", "riskLevel": "2", "guard": "False", "content": { //Note on cloudOwner, cloudRegion usage: e.g. //"cloudOwner "vnfc": "xyzvgw", //can be a specific cloud owner such as Azure, VMware VIO, Wind River Titanium Cloud etc. //"cloudRegion": "1", //can be a specific cloud region for a cloud owner //If no cloudOwner is specified, policy applies to all cloudOwners //If no cloudRegion is specified, policy applies to all cloudRegions {//new in R3 "cost-intent": "TRUE", }, {//new in R3 "deployment-intent": { "name": "Infrastructure High Availability (HA) for VNF", } }, {//new in R3 "deployment-intent": { "name": "cost-intent": True, "deployment-intent": { "Cloud Type (Cloud Provider)": "VMware VIO", "Infrastructure Resource Isolation for VNF": "Burstable QoS", // realization possible without dedicating CPU and Memory, refer to section on "Cloud Resource Partitioning for Differentiated QoS" // on how this can help in offering tiered services "qosProperty": { {"Guaranteed QoS": "TRUE"} } } } } "resources": ["vDNS"], "Infrastructure Resource Isolation for VNF - Burstable QoS Oversubscription Percentage": 25, }, }, "resources": ["vgw"], #"vgw" is also interchangeably used as "vg" "applicableResources": "any", "identity": "cloud-atrributes", "policyScope": ["vDNSvCPE", "US", "INTERNATIONAL", "ip", "vDNSvgw", "vgmux"], "policyType": "AllPolicy" } |
Step 3. OOF → A&AI - Fetch Cloud-Agnostic (Standardized) Capabilities for the Service Instance
3a) OOF Processing - Perform Cloud Agnostic Capability check for each <cloud owner, cloud region>. OOF will prune any <cloud owner, cloud region> which is not satisfying the standardized capabilities.
Step 4. OOF → MC - Push Cloud Agnostic Policy for the Service Instance
4a) OOF Processing
The enhanced OOF ↔ MC capacity check API, described below, is filled based on the enhanced Capacity Check & Cloud Selection Policy for Homing retrieved in step 2) – need OOF code changes.
}
#
#Example 2:
#vCPE: Infrastructure Resource Isolation for VNF with Guaranteed QoS
#
oof_mc_policy_api_instance2 = {
"service": "cloudSelectionPolicy",
"policyName": "oofMulti-cloudCasablanca.cloudSelectionPolicy_vCPE_VNF",
"description": "Cloud Selection Policy for vCPE VNFs",
"templateVersion": "0.0.1",
"version": "oofMulti-cloudCasablanca",
"priority": "3",
"riskType": "test",
"riskLevel": "2",
"guard": "False",
"content": {
"vnfc": "vgw",
"cost-intent": True,
"deployment-intent": {
"Infrastructure Resource Isolation for VNF": "Guaranteed QoS",
},
},
"resources": ["vgw"], #"vgw" is also interchangeably used as "vg"
"applicableResources": "any",
"identity": "cloud-atrributes",
"policyScope": ["vCPE", "US", "INTERNATIONAL", "ip", "vgw", "vgmux"],
"policyType": "AllPolicy"
}
#
#Example 3:
#vDNS: Infrastructure HA for VNF & Infrastructure Resource Isolation for VNF with Burstable QoS
#
oof_mc_policy_api_instance3 = {
"service": "cloudSelectionPolicy",
"policyName": "oofMulti-cloudCasablanca.cloudSelectionPolicy_vDNS_VNF",
"description": "Cloud Selection Policy for vDNS VNFs",
"templateVersion": "0.0.1",
"version": "oofMulti-cloudCasablanca",
"priority": "3",
"riskType": "test",
"riskLevel": "2",
"guard": "False",
"content": {
"vnfc": "vdns",
"cost-intent": True,
"deployment-intent": {
"Cloud Type (Cloud Provider)": "VMware VIO",
"Infrastructure High Availability for VNF": True,
"Infrastructure Resource Isolation for VNF": "Burstable QoS",
"Infrastructure Resource Isolation for VNF - Burstable QoS Oversubscription Percentage": 25,
},
},
"resources": ["vDNS"],
"applicableResources": "any",
"identity": "cloud-atrributes",
"policyScope": ["vDNS", "US", "INTERNATIONAL", "vDNS"],
"policyType": "AllPolicy"
}
#
# Example 4:
# vDNS: Infrastructure HA for VNF & Infrastructure Resource Isolation for VNF
# with Guaranteed QoS
#
oof_mc_policy_api_instance4 = {
"service": "cloudSelectionPolicy",
"policyName": "oofMulti-cloudCasablanca.cloudSelectionPolicy_vDNS_VNF",
"description": "Cloud Selection Policy for vDNS VNFs",
"templateVersion": "0.0.1",
"version": "oofMulti-cloudCasablanca",
"priority": "3",
"riskType": "test",
"riskLevel": "2",
"guard": "False",
"content": {
"vnfc": "vdns",
"cost-intent": True,
"deployment-intent": {
"Infrastructure High Availability for VNF": True,
"Infrastructure Resource Isolation for VNF": "Guaranteed QoS",
},
},
"resources": ["vDNS"],
"applicableResources": "any",
"identity": "cloud-atrributes",
"policyScope": ["vDNS", "US", "INTERNATIONAL", "vDNS"],
"policyType": "AllPolicy"
} |
Step 3. OOF → A&AI - Fetch Cloud-Agnostic (Standardized) Capabilities for the Service Instance
3a) OOF Processing - Perform Cloud Agnostic Capability check for each <cloud owner, cloud region>. OOF will prune any <cloud owner, cloud region> which is not satisfying the standardized capabilities.
Step 4. OOF → MC - Push Cloud Agnostic Policy for the Service Instance
4a) OOF Processing
The enhanced OOF ↔ MC capacity check API, described below, is filled based on the enhanced Capacity Check & Cloud Selection Policy for Homing retrieved in step 2) – need OOF code changes.
JSON Schema with Use Case Examples: https://gerrit.onap.org/r/#/c/58531/2/usage-examples/oof-mc-r3-interface-examples.py
Code Block | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
//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
#
#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 = {
"type" : "object",
"properties" : {
# vnfc is not used in the OOF->MC path for R3, this is kept to be consistent
# with the SO-> MC path
"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
"cost-intent" : {"type" : "boolean"},
"deployment-intent": {"type": "object"},
"properties" : {
# Azure, K8S, OpenStack, VMware VIO, Wind River Titanium
"Cloud Type (Cloud Provider)": {"type", "string"},
"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"},
},
},
"required": ["cost-intent", "deployment-intent"]
}
#
#Example 1: vCPE, Burstable QoS
#vCPE: Infrastructure Resource Isolation for VNF with Burstable QoS
#
oof_mc_policy_api_instance1 = {
"vnfc": "vgw",
"cost-intent": True,
"deployment-intent": {
"Cloud Type (Cloud Provider)": "VMware VIO",
"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 = {
"vnfc": "vgw",
"cost-intent": True,
"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 = {
"vnfc": "vdns",
"cost-intent": True,
"deployment-intent": {
"Cloud Type (Cloud Provider)": "VMware VIO",
"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 = {
"vnfc": "vdns",
"cost-intent": True,
"deployment-intent": {
"Infrastructure High Availability for VNF": True,
"Infrastructure Resource Isolation for VNF": "Guaranteed QoS",
},
}
oof_mc_policy_api_response_schema = {
"cloudRegionNetValue": {
"type": "array",
"items": { "$ref": "#/definitions/xxx" }
},
"definitions": {
"xxx": {
"type": "object",
"required": [ "VIM", "netValue" ],
"properties": {
# VIM id
"VIM": {
"type": "string",
},
# For R3, netValue signifies cost per VIM id
# Referring to cost-intent 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
"netValue": {
"type": "number",
}
}
}
}
}
oof_mc_policy_api_response_instance = {
"cloudRegionNetValue": [
{
"VIM": "Azure",
"netValue": 100
},
{
"VIM": "VMware 1",
"netValue": 101
},
{
"VIM": "Wind River Titanium 2",
"netValue": 102
},
{
"VIM": "Wind River Titanium 1",
"netValue": 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) | ||||||||||
Code Block | ||||||||||
| ||||||||||
//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
JSON Schema with Use Case Examples: https://gerrit.onap.org/r/#/c/58531/2/usage-examples/oof-mc-r3-interface-examples.py |
Code Block | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
// //Policy Relevant to Azure plugins // //fixed workload deployment cost for all workloads (simplifying assumption for R3) { "workloadDeploymentCost": "100", } // //Policy Relevant to Wind River OpenStack plugin // //fixed workload deployment cost for all workloads (simplifying assumption for R3) { "workloadDeploymentCost": "100", (set to higher or lower value for testing) } ... |
...