blob: 5fc5e6bc081cc462dc2cab5840c2b1d5438860c8 [file] [log] [blame]
---
{#
Copyright 2017-present Open Networking Foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
#}
tosca_definitions_version: tosca_simple_yaml_1_0
description: Just enough Tosca to get the vEG slice running on the CORD POD, created by ecord profile
imports:
- custom_types/addressmanagerservice.yaml
- custom_types/addresspool.yaml
- custom_types/image.yaml
- custom_types/network.yaml
- custom_types/networkslice.yaml
- custom_types/networktemplate.yaml
- custom_types/nodelabel.yaml
- custom_types/onosapp.yaml
- custom_types/onosservice.yaml
- custom_types/service.yaml
- custom_types/servicedependency.yaml
- custom_types/serviceinstanceattribute.yaml
- custom_types/serviceinstancelink.yaml
- custom_types/site.yaml
- custom_types/slice.yaml
- custom_types/vegservice.yaml
- custom_types/vrouterservice.yaml
topology_template:
node_templates:
# site, image, fully created in deployment.yaml
{{ site_name }}:
type: tosca.nodes.Site
properties:
name: {{ site_name }}
must-exist: true
image#vsg-1.1:
type: tosca.nodes.Image
properties:
name: vsg-1.1
# management networks, fully created in management-net.yaml
management:
type: tosca.nodes.Network
properties:
must-exist: true
name: management
# service that holds ecord subscribers
service#ecord:
type: tosca.nodes.Service
properties:
name: ecord
{% if use_vtn_net_management_host %}
management_host:
type: tosca.nodes.Network
properties:
name: management_host
must-exist: true
{% endif %}
# ONOS_CORD, fully created in vtn.yaml
service#ONOS_CORD:
type: tosca.nodes.ONOSService
properties:
name: ONOS_CORD
must-exist: true
# ONOS_Fabric, fully created in fabric.yaml
service#ONOS_Fabric:
type: tosca.nodes.ONOSService
properties:
name: ONOS_Fabric
must-exist: true
# CORD Services
# Using same addresses as the r-cord VSG
addresses_veg:
type: tosca.nodes.AddressPool
properties:
name: addresses_veg
addresses: {{ addresspool_vsg_cidr }}
gateway_ip: {{ addresspool_vsg_cidr | ipaddr('1') | ipaddr('address') }}
gateway_mac: {{ fabric_gateway_hwaddr }}
requirements:
- service:
node: service#addressmanager
relationship: tosca.relationships.BelongsToOne
addresses_public:
type: tosca.nodes.AddressPool
properties:
name: addresses_public
addresses: {{ addresspool_public_cidr }}
gateway_ip: {{ addresspool_public_cidr | ipaddr('1') | ipaddr('address') }}
gateway_mac: {{ fabric_gateway_hwaddr }}
requirements:
- service:
node: service#addressmanager
relationship: tosca.relationships.BelongsToOne
service#addressmanager:
type: tosca.nodes.AddressManagerService
properties:
name: addressmanager
label_veg:
type: tosca.nodes.NodeLabel
properties:
name: label_veg
service#veg:
type: tosca.nodes.VEGService
properties:
name: veg
public_key: {{ lookup('file', config_cord_profile_dir + '/key_import/veg_rsa.pub') }}
private_key_fn: /opt/xos/services/veg/keys/veg_rsa
# node_label: label_veg
veg_vrouter:
type: tosca.nodes.ServiceDependency
properties:
connect_method: None
requirements:
- subscriber_service:
node: service#veg
relationship: tosca.relationships.BelongsToOne
- provider_service:
node: service#vrouter
relationship: tosca.relationships.BelongsToOne
# NOTE are this connected?
veg_addressmanager:
type: tosca.nodes.ServiceDependency
properties:
connect_method: None
requirements:
- subscriber_service:
node: service#veg
relationship: tosca.relationships.BelongsToOne
- provider_service:
node: service#addressmanager
relationship: tosca.relationships.BelongsToOne
service#vrouter:
type: tosca.nodes.VRouterService
properties:
name: vrouter
rest_hostname: onos-fabric.{{ site_suffix }}
rest_port: 8181
rest_user: onos
rest_pass: rocks
# NOTE: shouldn't the addresses be attached to address_manager? I don't think vRouter is used now
# requirements:
# - addresses_veg:
# node: addresses_veg
# relationship: tosca.relationships.ProvidesAddresses
# - addresses_public:
# node: addresses_public
# relationship: tosca.relationships.ProvidesAddresses
vRouter_ONOS_app:
type: tosca.nodes.ONOSApp
requirements:
- owner:
node: service#ONOS_Fabric
relationship: tosca.relationships.BelongsToOne
properties:
name: vRouter_ONOS_app
dependencies: org.onosproject.fpm
vRouter_ONOS_app_autogenerate:
type: tosca.nodes.ServiceInstanceAttribute
requirements:
- service_instance:
node: vRouter_ONOS_app
relationship: tosca.relationships.BelongsToOne
properties:
name: autogenerate
value: vrouter-network-cfg
vRouter_ONOS_app_ONOS_CORD:
type: tosca.nodes.ServiceInstanceLink
requirements:
- provider_service_instance:
node: vRouter_ONOS_app
relationship: tosca.relationships.BelongsToOne
- subscriber_service:
node: service#vrouter
relationship: tosca.relationships.BelongsToOne
veg_template:
type: tosca.nodes.NetworkTemplate
properties:
name: veg_template
visibility: private
translation: none
vtn_kind: VSG
# Networks required by the CORD setup
{{ site_name }}_veg-access:
type: tosca.nodes.Network
properties:
name: {{ site_name }}_veg-access
# ip_version: 4
requirements:
- template:
node: veg_template
relationship: tosca.relationships.BelongsToOne
- owner:
node: {{ site_name }}_veg
relationship: tosca.relationships.BelongsToOne
networkslice#{{ site_name }}_veg-access_to_{{ site_name }}_veg:
type: tosca.nodes.NetworkSlice
requirements:
- network:
node: {{ site_name }}_veg-access
relationship: tosca.relationships.BelongsToOne
- slice:
node: {{ site_name }}_veg
relationship: tosca.relationships.BelongsToOne
# CORD Slices
{{ site_name }}_veg:
description: vEG Controller Slice
type: tosca.nodes.Slice
properties:
network: noauto
name: {{ site_name }}_veg
requirements:
- service:
node: service#veg
relationship: tosca.relationships.BelongsToOne
- site:
node: {{ site_name }}
relationship: tosca.relationships.BelongsToOne
- default_image:
node: image#vsg-1.1
relationship: tosca.relationships.BelongsToOne
networkslice#management_to_{{ site_name }}_veg:
type: tosca.nodes.NetworkSlice
requirements:
- network:
node: management
relationship: tosca.relationships.BelongsToOne
- slice:
node: {{ site_name }}_veg
relationship: tosca.relationships.BelongsToOne
{% if use_vtn_net_management_host %}
networkslice#management_host_to_{{ site_name }}_veg:
type: tosca.nodes.NetworkSlice
requirements:
- network:
node: management_host
relationship: tosca.relationships.BelongsToOne
- slice:
node: {{ site_name }}_veg
relationship: tosca.relationships.BelongsToOne
{% endif %}
# TODO: migrate interfaces when we'll start using
# in#lanside:
# type: tosca.nodes.InterfaceType
# properties:
# direction: in
# out#lanside:
# type: tosca.nodes.InterfaceType
# properties:
# direction: out
# in#wanside:
# type: tosca.nodes.InterfaceType
# properties:
# direction: in
# out#wanside:
# type: tosca.nodes.InterfaceType
# properties:
# direction: out
# veg_lanside:
# type: tosca.nodes.ServiceInterface
# requirements:
# - service:
# node: service#veg
# relationship: tosca.relationships.MemberOfService
# - interface:
# node: in#lanside
# relationship: tosca.relationships.IsType
# veg_wanside:
# type: tosca.nodes.ServiceInterface
# requirements:
# - service:
# node: service#veg
# relationship: tosca.relationships.MemberOfService
# - interface:
# node: out#wanside
# relationship: tosca.relationships.IsType
# addressmanager_wanside:
# type: tosca.nodes.ServiceInterface
# requirements:
# - service:
# node: service#addressmanager
# relationship: tosca.relationships.MemberOfService
# - interface:
# node: in#wanside
# relationship: tosca.relationships.IsType