summaryrefslogtreecommitdiffstats
path: root/docs/refspec/open-o/sdn-nsd/enterprise2DC_template.yaml
blob: c5d8714414526b02ee92e1420a43a78696b39157 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
# Copyright 2017 Huawei Technologies Co., Ltd.
#
# 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.

###############################################################################
#####                        overlay_enterprise to dc                      ####
###############################################################################
tosca_definitions_version: tosca_simple_yaml_1_0
description: creates overlay connection from Enterprise to DC
imports:
     - Definitions/enterprise2DC_type_definition.yaml

###############################################################################

metadata:
    id: enterprise2Dc
    template_name: enterprise2DC
    version: 0.1
    vendor: sdno
    template_author: Huawei


####################################### TOPOLOGY ##############################
topology_template:
        inputs:
            vpnName:
                type: string
                description: Name of Overlayvpn
            vpnDescription:
                type: string
                description: description of Overlayvpn
            siteName:
                type: string
                description: Name of Site
            siteCidr:
                type: string
                description: enterprise site cidr
            subnetVlan:
                type: integer
                description: Vlan value of Subnet
            siteVni:
                type: integer
                description: VxLAN ID connect site to vCPE
            vpcName:
                type: string
                description: in format of domain/project/router, should keep consistent with NFVO
            vpcSubnetName:
                type: string
                description: name of subnet in VPC, should keep consistent with NFVO
            vpcSubnetCidr:
                type: string
                description: vpc cidr
            vpcVni:
                type: integer
                description: vpc subnet vxlanID, should keep consistent with NFVO
            vpnType:
                type: string
                description: vpn connection type between vCPE and vpc.
                constraints:
                    - valid_values: ['IpSec','VxLAN','MPLS_VPN']
                default: IpSec
            dcGwIp:
                type: string
                description: mgrIp of dcGW
            dcFwIp:
                type: string
                description: mgrIp of dc Firewall
            dcLbIp:
                type: string
                description: mgrIp of dc Load Balancer

# *****************************************************************************
# node templates
# *****************************************************************************

        node_templates:

        # Nodes
            thinCpe:
                type: sdno.node.Node
                properties:
                    siteName: {get_input: siteName} 
                    id: '0'
 
            vCpe:
                type: sdno.node.Node
                properties:
                    siteName: {get_input: siteName} 
                    id: '0'
 
            dcFw:                     
                type: sdno.node.Node
                properties:                         
                    ipAddress: {get_input: dcFwIp} 
                    id: '0'
 
            dcLb:                     
                type: sdno.node.Node                     
                properties:                         
                    ipAddress: {get_input: dcLbIp} 
                    id: '0'
 
            dcGw:                     
                type: sdno.node.Node                     
                properties:                         
                    ipAddress: {get_input: dcGwIp} 
                    id: '0'     
 
            # do we need another node for dc endpoint? original template had vpc as node as well        
 
        # Connectivity Service
 
            enterprise2Dc:
                type: sdno.node.ConnectivityService.Enterprise2Dc
                requirements:
                    - endPoint: thinCpeServiceEndpoint
                    - endPoint: dcServiceEndpoint
                    - realizes: siteSubnet
                    - realizes: vpn
                    - realizes: vpcSubnet
                    - realizes: sfc
 
            thinCpeServiceEndpoint:
                type: sdno.node.ServiceEndPoint.ThinCpe
                requirements:
                    - node: thinCpe  
            dcServiceEndpoint:
                type: sdno.node.ServiceEndPoint.DcEndpoint
                requirements:                         
                    #- node: vpc or something else
                    - node: dcGw
 
        # ***************************************************************************** 
        #            VPC Node Templates (VpcSubnet and Vpc)
        # *****************************************************************************

            vpcSubnet:
                type: sdno.node.Connection.VpcSubnet
                properties:
                    cidr:       {get_input: vpcSubnetCidr}
                    name:       {get_input: vpcSubnetName}
                    vni:        {get_input: vpcVni}
                requirements:
                    - realizes: vpc

            vpc:
                type: sdno.node.Connection.Vpc
                properties:
                    name:       {get_input: vpcName}

        # ***************************************************************************** 
        #            Site Node Templates (Subnet, Vlan, Site with thinCPE and cCPE)
        # *****************************************************************************

            siteSubnet:
                type: sdno.node.Connection.SiteSubnet
                properties:
                    vni:        {get_input: siteVni}
                    cidrBlock:  {get_input: siteCidr}
                    name:       {concat: ['siteSubnet_' , {get_input: vpcName}]}
                requirements:
                    - realizes: vlan

            vlan:
                type: sdno.node.Connection.Vlan
                properties:
                    vlanId:     {get_input: subnetVlan}
                    name:       {concat: ['vlan_' , {get_input: vpcName}]}
                requirements:
                    - realizes: site

            thinCpeConnectionEndPoint:
                type: sdno.node.ConnectionEndPoint.ThinCpe
                requirements:
                    - realizes: site
                    - node: thinCpe  

            vCpeConnectionEndPoint:
                type: sdno.node.ConnectionEndPoint.VCpe
                requirements:
                    - realizes: site
                    - node: vCpe  

            site:
                type: sdno.node.Connection.Site
                properties:
                    name:       {get_input: siteName}
                    siteDescriptor: {get_input: vpnType}
                requirements:
                    - endPoint: vCpeConnectionEndPoint
                    - endPoint: thinCpeConnectionEndPoint


        # ***************************************************************************** 
        #            VPN Node Templates (Vpn, VpnConnection with siteGW and vpcGW)
        #            Order of requests: vpn, siteGW, vpcGW, vpnConnection
        # *****************************************************************************

            vpn:
                type: sdno.node.Connection.Vpn
                properties:
                    name: {get_input: vpnName}
                    description: {get_input: vpnDescription}
                    vpnDescriptor: {get_input: vpnType}
                requirements:
                    - realizes: vpnConnection


            siteGateway:
                type: sdno.node.ConnectionEndPoint.SiteGateway
                properties:
                    name:       {concat: ['siteGateway_' , {get_input: vpcName}]}

            vpcGateway:
                type: sdno.node.ConnectionEndPoint.VpcGateway
                properties:
                    name:       {concat: ['vpcGateway_' , {get_input: vpcName}]}

            vpnConnection:
                type: sdno.node.Connection.VpnConnection
                properties:
                    name:       {concat: ['vpnConnection_' , {get_input: vpcName}]}
                requirements:
                    - endPoint: siteGateway
                    - endPoint: vpcGateway


        # ***************************************************************************** 
        #            SFC Node Template 
        # *****************************************************************************

            sfc:
                type: sdno.node.Connection.Sfc
                properties:
                    servicePathHops: 
                        - {hopNumber: 1, sfiId: {get_attribute: [dcFw, id] }, sfgId: "", name: 'dcFw'}
                        - {hopNumber: 2, sfiId: {get_attribute: [dcLb, id] }, sfgId: "", name: 'dcLb'}
                    scfNeId: {get_attribute: [dcGw, id]}
                    name:    {concat: ['sfc_' , {get_input: vpcName}]}

        substitution_mappings: 
            node_type: tosca.nodes.sdno.NS.overlayvpn