- Affinity_vCPE_1.json
#- Capacity_vGMuxInfra.json
#- Capacity_vG_1.json
- - Distance_vGMuxInfra_1.json
- Distance_vG_1.json
+ - Distance_vGMuxInfra_1.json
+ - hpa_policy_vG_1.json
+ - hpa_policy_vGMuxInfra_1.json
- Placement_Optimization_1.json
- QueryPolicy_vCPE.json
- #- hpa_policy_vGMuxInfra_1.json
- #- hpa_policy_vG_1.json
- vnfPolicy_vG.json
- vnfPolicy_vGMuxInfra.json
+ placement_policy_dir_vfw: "./test/policy-local-files/"
+ placement_policy_files_vfw: # workaroud for policy platform glitches (or "work-arounds" for other components)
+ #- Capacity_vFW_1.json
+ - Distance_vFW_1.json
+ - hpa_policy_vFW_1.json
+ - Placement_Optimization_1.json
+ - QueryPolicy_vFW.json
+ - vnfPolicy_vFW.json
service_info:
vCPE:
vcpeHostName: requestParameters.vcpeHostName
e2eVpnKey: requestParameters.e2eVpnKey
+ vFW:
+ vcpeHostName: requestParameters.vcpeHostName
+ e2eVpnKey: requestParameters.e2eVpnKey
references:
service_name:
placement:
policy_fetch: by_scope
policy_scope:
- default_scope: OSDF_R2
- vcpe_scope: OSDF_R2
+ default_scope: OSDF_CASABLANCA
+ vcpe_scope: OSDF_CASABLANCA
+ vfw_scope: OSDF_CASABLANCA
secondary_scopes:
-
- get_param: service_name
type: string
consraints:
- valid_values:
- - affinityPolicy
+ - zone
identity:
type: string
required: true
type: string
consraints:
- valid_values:
- - distancePolicy
+ - distance_to_location
identity:
type: string
required: true
type: string
consraints:
- valid_values:
- - hpaPolicy
- resource:
- type: string
+ - hpa
+ resources:
+ type: list
required: true
+ entry_schema:
+ type: string
identity:
type: string
required: true
type: list
required: true
entry_schema:
- - type: policy.data.flavorFeatures_properties
+ type: policy.data.flavorFeatures_properties
data_types:
policy.data.flavorFeatures_properties:
derived_from: tosca.nodes.Root
type: string
consraints:
- valid_values:
- - optimizationPolicy
+ - placement_optimization
identity:
type: string
required: true
type: string
consraints:
- valid_values:
- - queryPolicy
+ - request_param_query
identity:
type: string
required: true
demand_vnf_name_list, gp['instance_fit'])
resource_region_policy_list = tr.gen_resource_region_policy(demand_vnf_name_list, gp['region_fit'])
zone_policy_list = tr.gen_zone_policy(demand_vnf_name_list, gp['zone'])
- optimization_policy_list = tr.gen_optimization_policy(demand_vnf_name_list, gp['placementOptimization'])
+ optimization_policy_list = tr.gen_optimization_policy(demand_vnf_name_list, gp['placement_optimization'])
reservation_policy_list = tr.gen_reservation_policy(demand_vnf_name_list, gp['instance_reservation'])
capacity_policy_list = tr.gen_capacity_policy(demand_vnf_name_list, gp['vim_fit'])
hpa_policy_list = tr.gen_hpa_policy(demand_vnf_name_list, gp['hpa'])
- req_params_dict = tr.get_opt_query_data(request_json, gp['optimizationQueryPolicy'])
+ req_params_dict = tr.get_opt_query_data(request_json, gp['request_param_query'])
conductor_policies = [attribute_policy_list, distance_to_location_policy_list, inventory_policy_list,
resource_instance_policy_list, resource_region_policy_list, zone_policy_list,
reservation_policy_list, capacity_policy_list, hpa_policy_list]
service_id=request_json['serviceInfo']['serviceInstanceId'],
latitude=req_params_dict.get("customerLatitude", 0.0),
longitude=req_params_dict.get("customerLongitude", 0.0),
+ required_disk=req_params_dict.get("requiredDisk", ""),
+ required_mem=req_params_dict.get("requiredMemory", ""),
json=json)
json_payload = json.dumps(json.loads(rendered_req)) # need this because template's JSON is ugly!
return json_payload
"template": {\r
"homing_template_version": "2017-10-10",\r
"parameters": {\r
- "service_name": "{{ service_name }}",\r
+ "service_name": "{{ service_type }}",\r
"service_id": "{{ service_id }}",\r
"customer_lat": {{ latitude }},\r
- "customer_long": {{ longitude }}\r
+ "customer_long": {{ longitude }},\r
+ "REQUIRED_DISK": "{{ required_disk }}",\r
+ "REQUIRED_MEM": "{{ required_mem }}"\r
},\r
"locations": {\r
"customer_loc": {\r
{% endfor %}\r
}\r
}\r
-}
\ No newline at end of file
+}\r
{
- "service": "zone",
- "policyName": "OSDF_R2.Affinity_vCPE_1",
- "description": "Optimization query policy for vCPE",
+ "service": "affinityPolicy",
+ "policyName": "OSDF_CASABLANCA.Affinity_vCPE_1",
+ "description": "Zone policy for vCPE",
"templateVersion": "OpenSource.version.1",
"version": "test1",
"priority": "3",
--- /dev/null
+{
+ "service": "vim_fit",
+ "policyName": "OSDF_CASABLANCA.Capacity_vFW_1",
+ "description": "Capacity policy for vFW",
+ "templateVersion": "OpenSource.version.1",
+ "version": "test1",
+ "priority": "5",
+ "riskType": "test",
+ "riskLevel": "2",
+ "guard": "False",
+ "content": {
+ "identity": "capacity_vFW",
+ "policyScope": ["vFW", "US", "INTERNATIONAL", "ip", "vFW"],
+ "resources": ["vFW"],
+ "capacityProperty": {
+ "controller": "multicloud",
+ "request": "{\"vCPU\": 2, \"Memory\": {\"quantity\": {\"get_param\": \"REQUIRED_MEM\"}, \"unit\": \"GB\"}, \"Storage\": {\"quantity\": {\"get_param\": \"REQUIRED_DISK\"}, \"unit\": \"GB\"}}"
+ },
+ "policyType": "vim_fit",
+ "applicableResources": "any"
+ }
+}
{
"service": "vim_fit",
- "policyName": "OSDF_R2.Capacity_vGMuxInfra",
+ "policyName": "OSDF_CASABLANCA.Capacity_vGMuxInfra",
"description": "Capacity policy for vGMuxInfra",
"templateVersion": "OpenSource.version.1",
"version": "test1",
{
"service": "vim_fit",
- "policyName": "OSDF_R2.Capacity_vG_1",
+ "policyName": "OSDF_CASABLANCA.Capacity_vG_1",
"description": "Capacity policy for vG",
"templateVersion": "OpenSource.version.1",
"version": "test1",
--- /dev/null
+{
+ "service": "distancePolicy",
+ "policyName": "OSDF_CASABLANCA.Distance_vFW_1",
+ "description": "Distance Policy for vFW",
+ "templateVersion": "OpenSource.version.1",
+ "version": "test1",
+ "priority": "3",
+ "riskType": "test",
+ "riskLevel": "2",
+ "guard": "False",
+ "content": {
+ "distanceProperties": {
+ "locationInfo": "customer_loc",
+ "distance": { "value": "100", "operator": "<", "unit": "km" }
+ },
+ "identity": "distance-vFW",
+ "resources": ["vFW"],
+ "policyScope": ["vFW", "US", "INTERNATIONAL", "ip"],
+ "policyType": "distance_to_location",
+ "applicableResources": "any"
+ }
+}
{
- "service": "distance_to_location",
- "policyName": "OSDF_R2.Distance_vGMuxInfra",
+ "service": "distancePolicy",
+ "policyName": "OSDF_CASABLANCA.Distance_vGMuxInfra",
"description": "Distance Policy for vGMuxInfra",
"templateVersion": "OpenSource.version.1",
"version": "test1",
"guard": "False",
"content": {
"distanceProperties": {
- "locationInfo": "customer_location",
+ "locationInfo": "customer_loc",
"distance": { "value": "500", "operator": "<", "unit": "km" }
},
"identity": "distance-vGMuxInfra",
"resources": ["vGMuxInfra"],
"policyScope": ["vCPE", "US", "INTERNATIONAL", "ip", "vGMuxInfra"],
- "policyType": "distancePolicy",
+ "policyType": "distance_to_location",
"applicableResources": "any"
}
}
{
- "service": "distance_to_location",
- "policyName": "OSDF_R2.Distance_vG_1",
+ "service": "distancePolicy",
+ "policyName": "OSDF_CASABLANCA.Distance_vG_1",
"description": "Distance Policy for vG",
"templateVersion": "OpenSource.version.1",
"version": "test1",
"guard": "False",
"content": {
"distanceProperties": {
- "locationInfo": "customer_location",
+ "locationInfo": "customer_loc",
"distance": { "value": "1500", "operator": "<", "unit": "km" }
},
"identity": "distance-vG",
"resources": ["vG"],
"policyScope": ["vCPE", "US", "INTERNATIONAL", "ip", "vG"],
- "policyType": "distancePolicy",
+ "policyType": "distance_to_location",
"applicableResources": "any"
}
}
{
- "service": "placementOptimization",
- "policyName": "OSDF_R2.Placement_Optimization_1",
+ "service": "optimizationPolicy",
+ "policyName": "OSDF_CASABLANCA.Placement_Optimization_1",
"description": "Placement Optimization Policy for vGMuxInfra",
"templateVersion": "OpenSource.version.1",
"version": "test1",
"parameter": "hpa_score",
"weight": "200",
"operator": "product"
+ },
+ {
+ "resources": ["vFW"],
+ "customerLocationInfo": "customer_loc",
+ "parameter": "distance",
+ "weight": "100",
+ "operator": "product"
+ },
+ {
+ "resources": ["vFW"],
+ "parameter": "hpa_score",
+ "weight": "200",
+ "operator": "product"
}
],
"operator": "sum"
},
"identity": "optimization",
"policyScope": ["vCPE", "US", "INTERNATIONAL", "ip", "vGMuxInfra", "vG"],
- "policyType": "placementOptimization",
+ "policyType": "placement_optimization",
"objective": "minimize"
}
}
{
- "service": "optimizationQueryPolicy",
- "policyName": "OSDF_R2.QueryPolicy_vCPE",
- "description": "Optimization query policy for vCPE",
+ "service": "queryPolicy",
+ "policyName": "OSDF_CASABLANCA.QueryPolicy_vCPE",
+ "description": "Query policy for vCPE",
"templateVersion": "OpenSource.version.1",
"version": "test1",
"priority": "3",
{"attribute":"customerLongitude", "attribute_location": "customerLongitude"}
],
"policyScope": ["vCPE", "US", "INTERNATIONAL", "ip", "vGMuxInfra", "vG"],
- "policyType": "optimizationQueryPolicy",
+ "policyType": "request_param_query",
"serviceName": "vCPE",
"identity": "vCPE_Query_Policy"
}
{
- "service": "optimizationQueryPolicy",
- "policyName": "oofBeijing.queryPolicy_vCPE",
- "description": "Optimization query policy for vCPE",
- "templateVersion": "0.0.1",
- "version": "oofBeijing",
- "priority": "5",
+ "service": "queryPolicy",
+ "policyName": "OSDF_CASABLANCA.queryPolicy_vCPE",
+ "description": "Query policy for vCPE",
+ "templateVersion": "OpenSource.version.1",
+ "version": "test1",
+ "priority": "3",
"riskType": "test",
"riskLevel": "2",
"guard": "False",
{"attribute":"customerLongitude", "attribute_location": "customerLongitude", "value": 2.2}
],
"serviceName": "vCPE",
- "policyScope": ["vCPE", "US", "INTERNATIONAL", "ip", "vGMuxInfra", "vG", "optimizationQueryPolicy"],
- "policyType": "optimizationQueryPolicy"
+ "policyScope": ["vCPE", "US", "INTERNATIONAL", "ip", "vGMuxInfra", "vG"],
+ "policyType": "request_param_query",
+ "identity": "vCPE_Query_Policy"
}
}
--- /dev/null
+{
+ "service": "queryPolicy",
+ "policyName": "OSDF_CASABLANCA.QueryPolicy_vFW",
+ "description": "Query policy for vFW",
+ "templateVersion": "OpenSource.version.1",
+ "version": "test1",
+ "priority": "3",
+ "riskType": "test",
+ "riskLevel": "2",
+ "guard": "False",
+ "content": {
+ "queryProperties": [
+ {"attribute":"customerLatitude", "attribute_location": "customerLatitude"},
+ {"attribute":"customerLongitude", "attribute_location": "customerLongitude"}
+ ],
+ "policyScope": ["vFW", "US", "INTERNATIONAL", "ip"],
+ "policyType": "request_param_query",
+ "serviceName": "vFW",
+ "identity": "vFW_Query_Policy"
+ }
+}
--- /dev/null
+{
+ "service": "hpaPolicy",
+ "policyName": "OSDF_R2.hpa_policy_vG_1",
+ "description": "HPA policy for vG",
+ "templateVersion": "OpenSource.version.1",
+ "version": "test1",
+ "priority": "3",
+ "riskType": "test",
+ "riskLevel": "2",
+ "guard": "False",
+ "content": {
+ "resources": "vG",
+ "identity": "hpaPolicy_vG",
+ "policyScope": ["vCPE", "US", "INTERNATIONAL", "ip", "vG"],
+ "policyType": "hpaPolicy",
+ "flavorFeatures": [
+ {
+ "id": "vg_1",
+ "type": "vnfc",
+ "directives": [
+ {
+ "type": "flavor_directives",
+ "attributes": [
+ {
+ "attribute_name": "flavor_label_vm_01",
+ "attribute_value": ""
+ }
+ ]
+ }
+ ],
+ "flavorProperties":[
+ {
+ "hpa-feature" : "cpuTopology",
+ "mandatory" : "True",
+ "architecture": "generic",
+ "directives": [],
+ "hpa-feature-attributes": [
+ {"hpa-attribute-key":"numCpuSockets", "hpa-attribute-value": "2","operator": ">=", "unit": ""},
+ {"hpa-attribute-key":"numCpuSockets", "hpa-attribute-value": "4","operator": "<=", "unit": ""},
+ {"hpa-attribute-key":"numCpuCores", "hpa-attribute-value": "2", "operator":">=", "unit": ""},
+ {"hpa-attribute-key":"numCpuCores", "hpa-attribute-value": "4", "operator":"<=", "unit": ""},
+ {"hpa-attribute-key":"numCpuThreads", "hpa-attribute-value": "4", "operator":">=", "unit": ""},
+ {"hpa-attribute-key":"numCpuThreads", "hpa-attribute-value": "8", "operator":"<=", "unit": ""}
+ ]
+ },
+ {
+ "hpa-feature" : "basicCapabilities",
+ "mandatory" : "True",
+ "architecture": "generic",
+ "directives": [],
+ "hpa-feature-attributes": [
+ {"hpa-attribute-key": "numVirtualCpu", "hpa-attribute-value": "6", "operator": "=", "unit": ""},
+ {"hpa-attribute-key": "virtualMemSize", "hpa-attribute-value":"6", "operator": "=", "unit": "GB"}
+ ]
+ },
+ {
+ "hpa-feature" : "ovsDpdk",
+ "mandatory" : "False",
+ "score" : "3",
+ "architecture": "generic",
+ "directives": [],
+ "hpa-feature-attributes": [
+ {"hpa-attribute-key":"dataProcessingAccelerationLibrary", "hpa-attribute-value":"ovsDpdk_version", "operator": "=", "unit":""}
+ ]
+ },
+ {
+ "hpa-feature" : "cpuInstructionSetExtensions",
+ "mandatory" : "True",
+ "architecture": "INTEL-64",
+ "directives": [],
+ "hpa-feature-attributes": [
+ {"hpa-attribute-key":"instructionSetExtensions", "hpa-attribute-value":["<CPUINST>", "<CPUINST>"], "operator": "ALL", "unit":""}
+ ]
+ }
+ ]
+ },
+ {
+ "id": "vg_2",
+ "type": "vnfc",
+ "directives": [
+ {
+ "type": "flavor_directives",
+ "attributes": [
+ {
+ "attribute_name": "flavor_label_vm_02",
+ "attribute_value": ""
+ }
+ ]
+ }
+ ],
+ "flavorProperties":[
+ {
+ "hpa-feature" : "cpuPinningy",
+ "mandatory" : "True",
+ "architecture": "generic",
+ "directives": [],
+ "hpa-feature-attributes": [
+ {"hpa-attribute-key":"logicalCpuThreadPinningPolicy", "hpa-attribute-value":"<CPUTHREADPOLICY>", "operator": "=", "unit":""},
+ {"hpa-attribute-key":"logicalCpuPinningPolicy", "hpa-attribute-value": "<CPUPOLICY>","operator": "=", "unit":""}
+ ]
+ },
+ {
+ "hpa-feature" : "basicCapabilities",
+ "mandatory" : "True",
+ "architecture": "generic",
+ "directives": [],
+ "hpa-feature-attributes": [
+ {"hpa-attribute-key": "numVirtualCpu", "hpa-attribute-value": "6", "operator": "=", "unit": ""},
+ {"hpa-attribute-key": "virtualMemSize", "hpa-attribute-value":"6", "operator": "=", "unit": "GB"}
+ ]
+ },
+ {
+ "hpa-feature" : "localStorage",
+ "mandatory" : "False",
+ "score" : "5",
+ "architecture": "generic",
+ "directives": [],
+ "hpa-feature-attributes": [
+ {"hpa-attribute-key": "diskSize", "hpa-attribute-value": "2", "operator": "=", "unit": "GB"},
+ {"hpa-attribute-key": "ephemeralDiskSize", "hpa-attribute-value": "2", "operator": "=", "unit": "GB"},
+ {"hpa-attribute-key": "swapMemSize", "hpa-attribute-value":"16", "operator": "=", "unit": "MB"}
+ ]
+ },
+ {
+ "hpa-feature" : "pciePassthrough",
+ "mandatory" : "True",
+ "architecture": "generic",
+ "directives": [],
+ "hpa-feature-attributes": [
+ {"hpa-attribute-key": "pciCount", "hpa-attribute-value": "2", "operator": "=", "unit": ""},
+ {"hpa-attribute-key": "pciVendorId", "hpa-attribute-value":"8086", "operator": "=", "unit": ""},
+ {"hpa-attribute-key": "pciDeviceId", "hpa-attribute-value": "2", "operator": "=", "unit": ""}
+ ]
+ }
+ ]
+ },
+ {
+ "id": "vg_3",
+ "type": "vnfc",
+ "directives": [
+ {
+ "type": "flavor_directives",
+ "attributes": [
+ {
+ "attribute_name": "flavor_label_vm_03",
+ "attribute_value": ""
+ }
+ ]
+ }
+ ],
+ "flavorProperties":[
+ {
+ "hpa-feature" : "numa",
+ "mandatory" : "False",
+ "score" : "5",
+ "architecture": "generic",
+ "directives": [],
+ "hpa-feature-attributes": [
+ {"hpa-attribute-key": "numaNodes", "hpa-attribute-value": "2", "operator": "=", "unit": ""},
+ {"hpa-attribute-key": "numaCpu-0", "hpa-attribute-value":"2", "operator": "=", "unit": ""},
+ {"hpa-attribute-key": "numaMem-0", "hpa-attribute-value": "2048", "operator": "=", "unit": "MB"},
+ {"hpa-attribute-key": "numaCpu-1", "hpa-attribute-value":"4", "operator": "=", "unit": ""},
+ {"hpa-attribute-key": "numaMem-1", "value": "4096", "operator": "=", "unit": "MB"}
+ ]
+ },
+ {
+ "hpa-feature" : "basicCapabilities",
+ "mandatory" : "True",
+ "architecture": "generic",
+ "directives": [],
+ "hpa-feature-attributes": [
+ {"hpa-attribute-key": "numVirtualCpu", "hpa-attribute-value": "6", "operator": "=", "unit": ""},
+ {"hpa-attribute-key": "virtualMemSize", "hpa-attribute-value":"6", "operator": "=", "unit": "GB"}
+ ]
+ },
+ {
+ "hpa-feature" : "hugePages",
+ "mandatory" : "False",
+ "score" : "7",
+ "architecture": "generic",
+ "directives": [],
+ "hpa-feature-attributes": [
+ {"hpa-attribute-key": "memoryPageSize", "hpa-attribute-value": "<MEMORYPAGESIZE>", "operator": "=", "unit": ""}
+ ]
+ }
+ ]
+ }
+ ]
+ }
+}
{
"service": "hpaPolicy",
- "policyName": "OSDF_R2.hpa_policy_vGMuxInfra_1",
+ "policyName": "OSDF_CASABLANCA.hpa_policy_vGMuxInfra_1",
"description": "HPA policy for vGMuxInfra",
"templateVersion": "OpenSource.version.1",
"version": "test1",
"riskLevel": "2",
"guard": "False",
"content": {
- "resources": "vGMuxInfra",
- "identity": "hpaPolicy_vGMuxInfra",
+ "resources": ["vGMuxInfra"],
+ "identity": "hpa-vGMuxInfra",
"policyScope": ["vCPE", "US", "INTERNATIONAL", "ip", "vGMuxInfra"],
- "policyType": "hpaPolicy",
+ "policyType": "hpa",
"flavorFeatures": [
{
"id": "vgmux_1",
{
"service": "hpaPolicy",
- "policyName": "OSDF_R2.hpa_policy_vG_1",
+ "policyName": "OSDF_CASABLANCA.hpa_policy_vG_1",
"description": "HPA policy for vG",
"templateVersion": "OpenSource.version.1",
"version": "test1",
"riskLevel": "2",
"guard": "False",
"content": {
- "resources": "vG",
- "identity": "hpaPolicy_vG",
+ "resources": ["vG"],
+ "identity": "hpa-vG",
"policyScope": ["vCPE", "US", "INTERNATIONAL", "ip", "vG"],
- "policyType": "hpaPolicy",
+ "policyType": "hpa",
"flavorFeatures": [
{
"id": "vg_1",
{
- "service": "SubscriberPolicy",
- "policyName": "oofBeijing.SubscriberPolicy_v1",
+ "service": "subscriberPolicy",
+ "policyName": "OSDF_CASABLANCA.SubscriberPolicy_v1",
"description": "Subscriber Policy",
- "templateVersion": "0.0.1",
- "version": "oofBeijing",
+ "templateVersion": "OpenSource.version.1",
+ "version": "test1",
"priority": "1",
"riskType": "test",
"riskLevel": "3",
"policyType": "subscriberPolicy",
"serviceName": "vCPE"
}
-}
\ No newline at end of file
+}
--- /dev/null
+{
+ "service": "vnfPolicy",
+ "policyName": "OSDF_CASABLANCA.vnfPolicy_vFW",
+ "description": "vnfPolicy",
+ "templateVersion": "OpenSource.version.1",
+ "version": "test1",
+ "priority": "6",
+ "riskType": "test",
+ "riskLevel": "3",
+ "guard": "False",
+ "content": {
+ "identity": "vnf_vFW",
+ "policyScope": ["vCPE", "US", "INTERNATIONAL", "ip", "vFW"],
+ "policyType": "vnfPolicy",
+ "resources": ["vFW"],
+ "applicableResources": "any",
+ "vnfProperties": [
+ {
+ "inventoryProvider": "aai",
+ "serviceType": "",
+ "inventoryType": "cloud",
+ "customerId": "",
+ "orchestrationStatus": "",
+ "equipmentRole": ""
+
+ }
+ ]
+ }
+}
{
"service": "vnfPolicy",
- "policyName": "OSDF_R2.vnfPolicy_vG",
+ "policyName": "OSDF_CASABLANCA.vnfPolicy_vG",
"description": "vnfPolicy",
"templateVersion": "OpenSource.version.1",
"version": "test1",
{
"service": "vnfPolicy",
- "policyName": "OSDF_R2.vnfPolicy_vGMuxInfra",
+ "policyName": "OSDF_CASABLANCA.vnfPolicy_vGMuxInfra",
"description": "vnfPolicy",
"templateVersion": "OpenSource.version.1",
"version": "test1",