...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
{ "homing_template_version": "2017-10-10", "parameters": { "service_name": "Residential vCPE", "service_id": "vcpe_service_id", "customer_lat": 32.89748, "customer_long": -97.040443, "REQUIRED_MEM": 4, "REQUIRED_DISK": 100, "pnf_id": "some_pnf_id" }, "locations": { "customer_loc": { "latitude": { "get_param": "customer_lat" }, "longitude": { "get_param": "customer_long" } }, "brg_loc": { "pnf_host_name": { "get_param": "pnf_id" } } }, "demands": { "vGMuxInfra": [ { "inventory_provider": "aai", "inventory_type": "service", "attributes": { "equipment_type": "vG_Mux", "customer_id": "some_company" }, "excluded_candidates": [ { "candidate_id": "1ac71fb8-ad43-4e16-9459-c3f372b8236d" } ], "existing_placement": [ { "candidate_id": "21d5f3e8-e714-4383-8f99-cc480144505a" } ] } ], "vG": [ { "inventory_provider": "aai", "inventory_type": "cloud" } ] }, "constraints": [ { "constraint_vgmux_customer": { "type": "distance_to_location", "demands": [ "vGMuxInfra" ], "properties": { "distance": "< 100 km", "location": "customer_loc" } } }, { "colocation": { "type": "zone", "demands": [ "vGMuxInfra", "vG" ], "properties": { "qualifier": "same", "category": "region" } } }, { "hpa_constraint": { "type": "hpa", "demands": [ "vG" ], "properties": { "evaluate": [ { "label": "flavor_label_1", "features": [ { "hpa-feature": "basicCapabilities", "hpa-version": "v1", "hpa-hw-archarchitecture": "generic", "hpa-feature-attributes": [ { "hpa-attrattribute-key": "numVirtualCpu", "hpa-attrattribute-value": "4", "operator": "=" }, { "hpa-attrattribute-key": "virtualMemSize", "hpa-attrattribute-value": "4", "operator": "=", "unit": "GB" } ] }, { "hpa-feature": "numa", "hpa-version": "v1", "hpa-hw-archarchitecture": "generic", "hpa-feature-attributes": [ { "hpa-attrattribute-key": "numaNodes", "hpa-attrattribute-value": "2", "operator": "=" }, { "hpa-attrattribute-key": "numaCpu-0", "hpa-attrattribute-value": ["2", "operator": "=" 0, }, 1{ ]"hpa-attribute-key": "numaCpu-1", "operatorhpa-attribute-value": "=4", }, "operator": "=" { }, "hpa-attr-key": "numaCpu-1", { "hpa-attrattribute-valuekey": ["numaMem-0", 2"hpa-attribute-value": "2", 3"operator": "=", "unit": "GB" 4, }, 5 { ], "operator"hpa-attribute-key": "=numaMem-1", }, "hpa-attribute-value": "4", { "hpa-attr-key": "numaMem-0""operator": "=", "hpa-attr-valueunit": "2GB", } "operator": "=", ] "unit": "GB" }, }, { { "hpa-feature": "cpuPinning", "hpa-attr-keyversion": "numaMem-1v1", "hpa-attr-valuearchitecture": "4generic", "operatorhpa-feature-attributes": "=",[ { "unit": "GB" }"hpa-attribute-key": "logicalCpuThreadPinningPolicy", ] "hpa-attribute-value": "prefer", }, "operator": "=" { }, "hpa-feature": "cpuPinning", { "hpa-version": "v1", "hpa-hwattribute-archkey": "genericlogicalCpuPinningPolicy", "hpa-featureattribute-attributesvalue": [ "dedicated", { "hpa-attr-key"operator": "logicalCpuThreadPinningPolicy=", } "hpa-attr-value": "prefer", ] "operator": "=" } }, ] }, { { "hpa-attr-keylabel": "logicalCpuPinningPolicyflavor_label_2", "hpa-attr-value": "dedicated", "operator": "=" } ] } ] }, { "label": "flavor_label_2", "features": [ { "hpa-feature": "basicCapabilities", "hpa-version": "v1", "hpa-hw-arch": "generic", "hpa-feature-attributes": [ { "hpa-attr-key": "numVirtualCpu", "hpa-attr-value": "8", "features": [ "operator": "=" { }, "hpa-feature": "basicCapabilities", { "hpa-version": "v1", "hpa-attr-key"architecture": "virtualMemSizegeneric", "hpa-attrfeature-valueattributes": "16",[ { "operator": "=", "unithpa-attribute-key": "GBnumVirtualCpu", } "hpa-attribute-value": "8", ] "operator": "=" }, }, { { "hpa-feature": "numa", "hpa-attribute-versionkey": "v1virtualMemSize", "hpa-hwattribute-archvalue": "generic16", "hpa-feature-attributes": [ "operator": "=", { "unit": "GB" "hpa-attr-key": "numaNodes",} ] "hpa-attr-value": "2", }, "operator": "=" { }, "hpa-feature": "numa", { "hpa-version": "v1", "hpa-attr-keyarchitecture": "numaCpu-0generic", "hpa-attrfeature-valueattributes": [ { 0, "hpa-attribute-key": "numaNodes", 1 ]"hpa-attribute-value": "2", "operator": "=" }, { "hpa-attrattribute-key": "numaCpu-10", "hpa-attrattribute-value": ["2", 2, "operator": "=" 3, }, 4,{ "hpa-attribute-key": "numaCpu-1", 5 ]"hpa-attribute-value": "4", "operator": "=" }, { "hpa-attrattribute-key": "numaMem-0", "hpa-attrattribute-value": "2", "operator": "=", "unit": "GB" }, { "hpa-attrattribute-key": "numaMem-1", "hpa-attrattribute-value": "4", "operator": "=", "unit": "GB" } ] }, { "hpa-feature": "memoryPageSize", "hpa-version": "v1", "hpa-hw-archarchitecture": "generic", "hpa-feature-attributes": [ { "hpa-attrattribute-key": "memoryPageSize", "hpa-attrattribute-value": "2", "operator": "=", "unit": "GB" } ] } ] } ] } } }, { "cloud_min_guarantee": { "type": "attribute", "demands": [ "vG" ], "properties": { "evaluate": { "cpu_min_guarantee": true, "mem_min_guarantee": true } } } }, { "check_cloud_capacity": null, "type": "vim_fit", "demands": [ "vG" ], "properties": { "vim-controller": "multicloud", "request": { "vCPU": 10, "mem": { "quantity": { "get_param": "REQUIRED_MEM" }, "unit": "GB" }, "disk": { "quantity": { "get_param": "REQUIRED_DISK" }, "unit": "GB" } } } } ], "optimization": { "minimize": { "sum": [ { "distance_between": [ "customer_loc", "vGMuxInfra" ] }, { "distance_between": [ "customer_loc", "vG" ] } ] } } } |
...
# sample homing template for vCPE
homing_template_version: '2017-10-10'
parameters:
service_name: Residential vCPE
service_id: vcpe_service_id
customer_lat: 32.897480
customer_long: -97.040443
REQUIRED_MEM: 4
REQUIRED_DISK: 100
pnf_id: some_pnf_id
# List of geographical locations
locations:
customer_loc:
latitude: {get_param: customer_lat}
longitude: {get_param: customer_long}
brg_loc:
pnf_host_name: {get_param: pnf_id}
# List of VNFs (demands) to be homed
demands:
vGMuxInfra:
- inventory_provider: aai
inventory_type: service
attributes:
equipment_type: vG_Mux
customer_id: some_company
orchestration-status: Activated
model-invariant-id: d4da47f8-df13-4c94-9ecf-5c417bf53e27
model-version-id: 80ca8d06-d770-4803-9186-a0f8a3091fee
excluded_candidates:
- candidate_id: 1ac71fb8-ad43-4e16-9459-c3f372b8236d
existing_placement:
- candidate_id: 21d5f3e8-e714-4383-8f99-cc480144505a
vG:
- inventory_provider: aai
inventory_type: cloud
constraints:
# distance between the customer and vGMuxInfra
- constraint_vgmux_customer:
type: distance_to_location
demands: [vGMuxInfra]
properties:
distance: < 100 km
location: customer_loc
# cloud region co-location constraint
- colocation:
type: zone
demands: [vGMuxInfra, vG]
properties:
qualifier: same
category: region
# required HPA features, grouped by label.
# Each label corresponds to a flavor mapped by Conductor
- hpa_constraint:
type: hpa
demands: [vG]
properties:
evaluate:
- label: flavor_label_1
features:
- hpa-feature: basicCapabilities
hpa-version: v1
hpa-hw-archarchitecture: generic
hpa-feature-attributes:
- hpa-attrattribute-key: numVirtualCpu
hpa-attrattribute-value: "4"
operator: "="
- hpa-attrattribute-key: virtualMemSize
hpa-attrattribute-value: "4"
operator: "="
unit: "GB"
- hpa-feature: numa
hpa-version: v1
hpa-hw-archarchitecture: generic
hpa-feature-attributes:
- hpa-attrattribute-key: numaNodes
hpa-attrattribute-value: "2"
operator: "="
- hpa-attrattribute-key: numaCpu-0
hpa-attrattribute-value: [0, 1]"2"
operator: "="
- hpa-attrattribute-key: numaCpu-1
hpa-attrattribute-value: [2, 3, 4, 5]"4"
operator: "="
- hpa-attrattribute-key: numaMem-0
hpa-attrattribute-value: "2"
operator: "="
unit: "GB"
- hpa-attrattribute-key: numaMem-1
hpa-attrattribute-value: "4"
operator: "="
unit: "GB"
- hpa-feature: cpuPinning
hpa-version: v1
hpa-hw-archarchitecture: generic
hpa-feature-attributes:
- hpa-attrattribute-key: logicalCpuThreadPinningPolicy
hpa-attrattribute-value: prefer
operator: "="
- hpa-attrattribute-key: logicalCpuPinningPolicy
hpa-attrattribute-value: dedicated
operator: "="
- label: flavor_label_2
features:
- hpa-feature: basicCapabilities
hpa-version: v1
hpa-hw-archarchitecture: generic
hpa-feature-attributes:
- hpa-attrattribute-key: numVirtualCpu
hpa-attrattribute-value: "8"
operator: "="
- hpa-attrattribute-key: virtualMemSize
hpa-attrattribute-value: "16"
operator: "="
unit: "GB"
- hpa-feature: numa
hpa-version: v1
hpa-hw-archarchitecture: generic
hpa-feature-attributes:
- hpa-attrattribute-key: numaNodes
hpa-attrattribute-value: "2"
operator: "="
- hpa-attrattribute-key: numaCpu-0
hpa-attrattribute-value: [0, 1]"2"
operator: "="
- hpa-attrattribute-key: numaCpu-1
hpa-attrattribute-value: [2, 3, 4, 5]"4"
operator: "="
- hpa-attrattribute-key: numaMem-0
hpa-attrattribute-value: "2"
operator: "="
unit: "GB"
- hpa-attrattribute-key: numaMem-1
hpa-attrattribute-value: "4"
operator: "="
unit: "GB"
- hpa-feature: memoryPageSize
hpa-version: v1
hpa-hw-archarchitecture: generic
hpa-feature-attributes:
- hpa-attrattribute-key: memoryPageSize
hpa-attrattribute-value: "2"
operator: "="
unit: "GB"
# min guarantee constraints
- cloud_min_guarantee:
type: attribute
demands: [vG]
properties:
evaluate:
cpu_min_guarantee: true
mem_min_guarantee: true
# check capacity
- check_cloud_capacity:
type: vim_fit
demands: [vG]
properties:
vim-controller: multicloud
request:
vCPU: 10
mem:
quantity: {get_param: REQUIRED_MEM}
unit: GB
disk:
quantity: {get_param: REQUIRED_DISK}
unit: GB
# objective function
optimization:
minimize:
sum:
- distance_between:
- customer_loc
- vGMuxInfra
- distance_between:
- customer_loc
- vG