Versions Compared

Key

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

...

Code Block
languagepy
themeEmacs
titleSO <-> MC Cloud-Agnostic Workload Deployment Policy API
linenumberstrue
collapsetrue
#
#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)
#
#The same information is opaquely passed from OOF to SO
#

from jsonschema import validate

oof_to_so_and_so_to_mc_policyapi_apiext_request_schema = {
    "type" : "object",
    "propertiesvnfc-directives" : {

        # vnfc is not used in the OOF->MC path for R3, this is kept to be consistent
        # with the SO-> MC path"type": "array",
                "vnfcitems": { "type$ref": "string#/definitions/xxx1" },

        },
        "deployment-intentdefinitions": {"type": "object"},
                "propertiesxxx1" : {

                        # Azure, K8S, OpenStack, VMware VIO, Wind River Titanium
"type": "object",
                        "properties" : {
    "Cloud Type (Cloud Provider)": {"type", "string"},

                        "Infrastructure# High Availability for VNF": {"type", "boolean"},

VNFC name/id
                            "Infrastructure Resource Isolation for VNF "vnfc-name-id": {"type",: "string"},

                        #  Infrastructure Resource Isolation for VNF
  # cloud-specific realization of the specified deployment intent
               # Only certain pre-defined over-subscription values are allowed to
         # happens in multi-cloud in the cloud-specific plugin
        # reflect practical deployment and simplify implementation for R3
                "directive-list": {
       "Infrastructure Resource Isolation for VNF - Burstable QoS Oversubscription Percentage": {"type": "int"},
                },
        }"type": "array",
        "required": ["deployment-intent"]
}

#
#Example 1: vCPE, Burstable QoS
#vCPE: Infrastructure Resource Isolation for VNF with Burstable QoS
#
so_mc_policy_api_instance1 = {
        "vnfc": "vgw",
        "deployment-intentitems": {
 "$ref": "#/definitions/xxx2" }
             "Cloud Type (Cloud Provider)": "VMware VIO",
               },
 "Infrastructure Resource Isolation for VNF": "Burstable QoS",
                "Infrastructure Resource Isolation for VNF - Burstable QoS Oversubscription Percentage"definitions": 25,
{
            },
}

#
#Example 2:
#vCPE: Infrastructure Resource Isolation for VNF with Guaranteed QoS
#
so_mc_policy_api_instance2 = {
        "vnfc": "vgw",
        "deployment-intentxxx2": {
                "Infrastructure Resource Isolation for VNF": "Guaranteed QoS",
        },
}

#
#Example 3:
#vDNS: Infrastructure HA for VNF & Infrastructure Resource Isolation for VNF with Burstable QoS
#
so_mc_policy_api_instance3 = {
        "vnfctype": "vdnsobject",
        "deployment-intent": {
                "Cloud Type (Cloud Provider)": "VMware VIO",
                "Infrastructure High Availability for VNF""properties" : 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 #Intent, e.g. Infrastructure High Availability for VNF
# with Guaranteed QoS
#
so_mc_policy_api_instance4 = {
        "vnfc": "vdns",
        "deployment-intent": {
                "Infrastructure High Availability for VNF": True,
              "attribute_name":  "Infrastructure Resource Isolation for VNF": "Guaranteed QoS"{"type", "string"},
                                                        #Optional
                                                        "attribute_value": {"type", "string"},

                                                        "directive-list-inner": {
                                                                "type": "array",
                                                                "items": { "$ref": "#/definitions/xxx3" }
                                                        },
                                                        "definitions": {
                                                                "xxx3": {
                                                                        "type": "object",
                                                                        #Intent, e.g. Infrastructure High Availability for VNF
                                                                        "attribute_name": {"type", "string"},
                                                                        #Optional
                                                                        "attribute_value": {"type", "string"},
                                                                },
                                                        },
                                                },
                                        },
                                },
                        },
                },
        },
}

#
#Example 1: vCPE, Burstable QoS
#vCPE: Infrastructure Resource Isolation for VNF with Burstable QoS
#
oof_to_so_and_so_to_mc_api_ext_request_instance1 = {
        "vnfc-directives": [
                {
                        "vnfc-name-id": "vgw",
                        "intent-directive-list": [
                                {
                                        "attribute_name": "Infrastructure Resource Isolation for VNF",
                                        "attribute_value": "Burstable QoS",
                                        "intent-directive-list-inner": [
                                                {
                                                        "attribute_name": "Infrastructure Resource Isolation for VNF - Burstable QoS Oversubscription Percentage",
                                                        "attribute_value": "25",
                                                },
                                        ],
                                },
                        ],
                },
                #
                #hpa is purely exemplary in this example
                #
                {
                        "vnfc-name-id": "vgw",
                        "hpa-directive-list": [
                                {
                                        "attribute_name": "sriov-param1",
                                        "attribute_value": "sriov-param1-value",
                                },
                        ],
                },
        ],
}

#
#Example 2:
#vCPE: Infrastructure Resource Isolation for VNF with Guaranteed QoS
#
oof_to_so_and_so_to_mc_api_ext_request_instance2 = {
        "vnfc-directives": [
                {
                        "vnfc-name-id": "vdns",
                        "intent-directive-list": [
                                {
                                        "attribute_name": "Infrastructure Resource Isolation for VNF",
                                        "attribute_value": "Guaranteed QoS",
                                },
                        ],
                },
        ],
}

#
#Example 3:
#vDNS: Infrastructure HA for VNF & Infrastructure Resource Isolation for VNF with Burstable QoS
#
oof_to_so_and_so_to_mc_api_ext_request_instance3 = {
        "vnfc-directives": [
                {
                        "vnfc-name-id": "vdns",
                        "intent-directive-list": [
                                {
                                        "attribute_name": "Infrastructure High Availability for VNF",
                                },
                                {
                                        "attribute_name": "Infrastructure Resource Isolation for VNF",
                                        "attribute_value": "Burstable QoS",
                                        "intent-directive-list-inner": [
                                                {
                                                        "attribute_name": "Infrastructure Resource Isolation for VNF - Burstable QoS Oversubscription Percentage",
                                                        "attribute_value": "25",
                                                },
                                        ],
                                },
                        ],
                },
        ],
}

#
# Example 4:
# vDNS: Infrastructure HA for VNF & Infrastructure Resource Isolation for VNF
# with Guaranteed QoS
#
oof_to_so_and_so_to_mc_api_ext_request_instance4 = {
        "vnfc-directives": [
                {
                        "vnfc-name-id": "vdns",
                        "intent-directive-list": [
                                {
                                        "attribute_name": "Infrastructure High Availability for VNF",
                                },
                                {
                                        "attribute_name": "Infrastructure Resource Isolation for VNF",
                                        "attribute_value": "Guaranteed QoS",
                                },
                        ],
                },
        }],
}

validate(oof_to_so_and_so_to_mc_policyapi_ext_apirequest_instance1, oof_to_so_and_so_to_mc_policyapi_apiext_request_schema)
validate(oof_to_so_and_so_to_mc_api_policyext_apirequest_instance2, oof_to_so_and_so_to_mc_policyapi_apiext_request_schema)
validate(oof_to_so_and_so_to_mc_policyapi_ext_apirequest_instance3, oof_to_so_and_so_to_mc_policyapi_apiext_request_schema)
validate(oof_to_so_and_so_to_mc_policyapi_ext_apirequest_instance4, oof_to_so_and_so_to_mc_policyapi_apiext_request_schema)
 

Follow ups:

  • Use Cases for Integration testing
    • vCPE
      • In the current state, this use case cannot support the intent "Infra HA for VMs in a VNF"
      • This use case has been tested in R2 with OOF↔MC capacity check API
    • vDNS 
      • Can support intent "Infra HA for VMs in a VNF" and "Infrastructure Resource Isolation for VNF"
      • Nothing additional needed in OOF or MC
      • Changes needed in SO to call OOF API
        • Marcus from Intel is driving this
  • Policy DB – is there any restriction on the type of json objects that can be stored?
    • Matti to follow up with Ankit

...