blob: 6ffeedb6d26891d57b557969cb7f0fd89a052bbe [file] [log] [blame]
Andy Bavier43cdc662018-05-15 14:50:47 -07001{{/* vim: set filetype=mustache: */}}
2{{/*
3Copyright 2018-present Open Networking Foundation
4
5Licensed under the Apache License, Version 2.0 (the "License");
6you may not use this file except in compliance with the License.
7You may obtain a copy of the License at
8
9http://www.apache.org/licenses/LICENSE-2.0
10
11Unless required by applicable law or agreed to in writing, software
12distributed under the License is distributed on an "AS IS" BASIS,
13WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14See the License for the specific language governing permissions and
15limitations under the License.
16*/}}
17{{- define "base-openstack.fixtureTosca" -}}
18tosca_definitions_version: tosca_simple_yaml_1_0
19
20imports:
21 - custom_types/deployment.yaml
22 - custom_types/site.yaml
23 - custom_types/networktemplate.yaml
24 - custom_types/network.yaml
25 - custom_types/networkslice.yaml
26 - custom_types/sitedeployment.yaml
27
28description: set up site and deployment and link them
29
30topology_template:
31 node_templates:
32
33 {{ .Values.cordSiteName }}:
34 type: tosca.nodes.Site
35 properties:
36 name: {{ .Values.cordSiteName }}
37 site_url: http://mysite.opencord.us/
38 hosts_nodes: true
39
40 {{ .Values.cordDeploymentName }}:
41 type: tosca.nodes.Deployment
42 properties:
43 name: {{ .Values.cordDeploymentName }}
44{{- end -}}
45
46{{- define "base-openstack.serviceGraphTosca" -}}
47tosca_definitions_version: tosca_simple_yaml_1_0
48
49imports:
50 - custom_types/onosapp.yaml
Matteo Scandolo979695d2018-06-08 17:47:01 -070051 - custom_types/onosservice.yaml
Andy Bavier8b945912018-06-12 16:10:04 -070052 - custom_types/servicedependency.yaml
Andy Bavier43cdc662018-05-15 14:50:47 -070053 - custom_types/servicegraphconstraint.yaml
Matteo Scandolo82096382018-06-12 15:07:05 -070054 - custom_types/servicedependency.yaml
Matteo Scandolo979695d2018-06-08 17:47:01 -070055 - custom_types/serviceinstance.yaml
Andy Bavier43cdc662018-05-15 14:50:47 -070056 - custom_types/serviceinstancelink.yaml
57 - custom_types/vtnservice.yaml
58
59description: Configures the base-openstack service graph
60
61topology_template:
62 node_templates:
63
64 service#vtn:
65 type: tosca.nodes.VTNService
66 properties:
67 name: vtn
68 must-exist: true
69 resync: false
70
Matteo Scandolo979695d2018-06-08 17:47:01 -070071 service#ONOS_CORD:
72 type: tosca.nodes.ONOSService
73 properties:
74 name: ONOS_CORD
75 must-exist: true
76
77 # NOTE this is defined in the onos-service TOSCA
78 onos_app#vtn:
Andy Bavier43cdc662018-05-15 14:50:47 -070079 type: tosca.nodes.ONOSApp
80 properties:
Matteo Scandolo979695d2018-06-08 17:47:01 -070081 name: vtn
Andy Bavier43cdc662018-05-15 14:50:47 -070082 must-exist: true
83
Matteo Scandolo979695d2018-06-08 17:47:01 -070084 # NOTE this is defined in the vtn-service TOSCA
85 vtn_service_instance:
86 type: tosca.nodes.ServiceInstance
87 properties:
88 name: VTN config
89 must-exist: true
90
91 onos_app#vtn_VTN_Service:
Andy Bavier43cdc662018-05-15 14:50:47 -070092 type: tosca.nodes.ServiceInstanceLink
93 requirements:
94 - provider_service_instance:
Matteo Scandolo979695d2018-06-08 17:47:01 -070095 node: onos_app#vtn
Andy Bavier43cdc662018-05-15 14:50:47 -070096 relationship: tosca.relationships.BelongsToOne
97 - subscriber_service:
98 node: service#vtn
99 relationship: tosca.relationships.BelongsToOne
Matteo Scandolo979695d2018-06-08 17:47:01 -0700100
101 link#vtn_to_vtn-config:
102 type: tosca.nodes.ServiceInstanceLink
103 requirements:
104 - subscriber_service_instance:
105 node: vtn_service_instance
106 relationship: tosca.relationships.BelongsToOne
107 - provider_service_instance:
108 node: onos_app#vtn
109 relationship: tosca.relationships.BelongsToOne
110
111 service_dependency#onos-cord_vtn:
112 type: tosca.nodes.ServiceDependency
113 properties:
Scott Baker1d408032018-08-29 08:34:49 -0700114 connect_method: none
Matteo Scandolo979695d2018-06-08 17:47:01 -0700115 requirements:
116 - subscriber_service:
117 node: service#ONOS_CORD
118 relationship: tosca.relationships.BelongsToOne
119 - provider_service:
120 node: service#vtn
121 relationship: tosca.relationships.BelongsToOne
Andy Bavier43cdc662018-05-15 14:50:47 -0700122{{- end -}}
123
124{{- define "base-openstack.testTosca" -}}
125tosca_definitions_version: tosca_simple_yaml_1_0
126
127imports:
128 - custom_types/flavor.yaml
129 - custom_types/image.yaml
130 - custom_types/site.yaml
131 - custom_types/network.yaml
132 - custom_types/networkslice.yaml
133 - custom_types/slice.yaml
134
135description: for testing basic openstack functionality
136
137topology_template:
138 node_templates:
139
140 Ubuntu-14.04:
141 type: tosca.nodes.Image
142 properties:
143 name: "Ubuntu 14.04 64-bit"
144 disk_format: QCOW2
145 container_format: BARE
146 path: https://github.com/opencord/platform-install/releases/download/vms/trusty-server-cloudimg-amd64-disk1.img.20170201
147
148 {{ .Values.cordSiteName }}:
149 type: tosca.nodes.Site
150 properties:
151 name: {{ .Values.cordSiteName }}
152 must-exist: true
153
154# Define a test slice
155 {{ .Values.cordSiteName }}_test:
156 description: Test Slice
157 type: tosca.nodes.Slice
158 properties:
159 # network: noauto
160 name: {{ .Values.cordSiteName }}_test
161 requirements:
162 - site:
163 node: {{ .Values.cordSiteName }}
164 relationship: tosca.relationships.BelongsToOne
165 - default_image:
166 node: Ubuntu-14.04
167 relationship: tosca.relationships.BelongsToOne
168
169 management:
170 type: tosca.nodes.Network
171 properties:
172 name: management
173 must-exist: true
174
175# Connect test slice to management net
176 networkslice#management_to_{{ .Values.cordSiteName }}_test:
177 type: tosca.nodes.NetworkSlice
178 requirements:
179 - network:
180 node: management
181 relationship: tosca.relationships.BelongsToOne
182 - slice:
183 node: {{ .Values.cordSiteName }}_test
184 relationship: tosca.relationships.BelongsToOne
Andy Bavier6e6191a2018-05-22 14:53:10 -0700185{{- end -}}
186
187{{- define "base-openstack.computeNodeTosca" -}}
188tosca_definitions_version: tosca_simple_yaml_1_0
189
190imports:
191 - custom_types/deployment.yaml
192 - custom_types/node.yaml
193 - custom_types/site.yaml
194 - custom_types/sitedeployment.yaml
195
196description: Adds OpenStack compute nodes
197
198topology_template:
199 node_templates:
200
201# Site/Deployment, fully defined in deployment.yaml
202 site:
203 type: tosca.nodes.Site
204 properties:
205 name: {{ .Values.cordSiteName }}
206 must-exist: true
207
208 deployment:
209 type: tosca.nodes.Deployment
210 properties:
211 name: {{ .Values.cordDeploymentName }}
212 must-exist: true
213
214 site_deployment:
215 type: tosca.nodes.SiteDeployment
216 requirements:
217 - site:
218 node: site
219 relationship: tosca.relationships.BelongsToOne
220 - deployment:
221 node: deployment
222 relationship: tosca.relationships.BelongsToOne
223
224# OpenStack compute nodes
225
226 {{- range .Values.computeNodes }}
227 {{ .name }}:
228 type: tosca.nodes.Node
229 properties:
230 name: {{ .name }}
231 bridgeId: {{ .bridgeId }}
232 dataPlaneIntf: {{ .dataPlaneIntf }}
233 dataPlaneIp: {{ .dataPlaneIp }}
234 requirements:
235 - site_deployment:
236 node: site_deployment
237 relationship: tosca.relationships.BelongsToOne
238 {{- end }}
239{{- end -}}