blob: e580a8a79958710faa3bc46ffc588d49df69d678 [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 Bavier43cdc662018-05-15 14:50:47 -070052 - custom_types/servicegraphconstraint.yaml
Matteo Scandolo979695d2018-06-08 17:47:01 -070053 - custom_types/serviceinstance.yaml
Andy Bavier43cdc662018-05-15 14:50:47 -070054 - custom_types/serviceinstancelink.yaml
55 - custom_types/vtnservice.yaml
56
57description: Configures the base-openstack service graph
58
59topology_template:
60 node_templates:
61
62 service#vtn:
63 type: tosca.nodes.VTNService
64 properties:
65 name: vtn
66 must-exist: true
67 resync: false
68
Matteo Scandolo979695d2018-06-08 17:47:01 -070069 service#ONOS_CORD:
70 type: tosca.nodes.ONOSService
71 properties:
72 name: ONOS_CORD
73 must-exist: true
74
75 # NOTE this is defined in the onos-service TOSCA
76 onos_app#vtn:
Andy Bavier43cdc662018-05-15 14:50:47 -070077 type: tosca.nodes.ONOSApp
78 properties:
Matteo Scandolo979695d2018-06-08 17:47:01 -070079 name: vtn
Andy Bavier43cdc662018-05-15 14:50:47 -070080 must-exist: true
81
Matteo Scandolo979695d2018-06-08 17:47:01 -070082 # NOTE this is defined in the vtn-service TOSCA
83 vtn_service_instance:
84 type: tosca.nodes.ServiceInstance
85 properties:
86 name: VTN config
87 must-exist: true
88
89 onos_app#vtn_VTN_Service:
Andy Bavier43cdc662018-05-15 14:50:47 -070090 type: tosca.nodes.ServiceInstanceLink
91 requirements:
92 - provider_service_instance:
Matteo Scandolo979695d2018-06-08 17:47:01 -070093 node: onos_app#vtn
Andy Bavier43cdc662018-05-15 14:50:47 -070094 relationship: tosca.relationships.BelongsToOne
95 - subscriber_service:
96 node: service#vtn
97 relationship: tosca.relationships.BelongsToOne
Matteo Scandolo979695d2018-06-08 17:47:01 -070098
99 link#vtn_to_vtn-config:
100 type: tosca.nodes.ServiceInstanceLink
101 requirements:
102 - subscriber_service_instance:
103 node: vtn_service_instance
104 relationship: tosca.relationships.BelongsToOne
105 - provider_service_instance:
106 node: onos_app#vtn
107 relationship: tosca.relationships.BelongsToOne
108
109 service_dependency#onos-cord_vtn:
110 type: tosca.nodes.ServiceDependency
111 properties:
112 connect_method: None
113 requirements:
114 - subscriber_service:
115 node: service#ONOS_CORD
116 relationship: tosca.relationships.BelongsToOne
117 - provider_service:
118 node: service#vtn
119 relationship: tosca.relationships.BelongsToOne
Andy Bavier43cdc662018-05-15 14:50:47 -0700120{{- end -}}
121
122{{- define "base-openstack.testTosca" -}}
123tosca_definitions_version: tosca_simple_yaml_1_0
124
125imports:
126 - custom_types/flavor.yaml
127 - custom_types/image.yaml
128 - custom_types/site.yaml
129 - custom_types/network.yaml
130 - custom_types/networkslice.yaml
131 - custom_types/slice.yaml
132
133description: for testing basic openstack functionality
134
135topology_template:
136 node_templates:
137
138 Ubuntu-14.04:
139 type: tosca.nodes.Image
140 properties:
141 name: "Ubuntu 14.04 64-bit"
142 disk_format: QCOW2
143 container_format: BARE
144 path: https://github.com/opencord/platform-install/releases/download/vms/trusty-server-cloudimg-amd64-disk1.img.20170201
145
146 {{ .Values.cordSiteName }}:
147 type: tosca.nodes.Site
148 properties:
149 name: {{ .Values.cordSiteName }}
150 must-exist: true
151
152# Define a test slice
153 {{ .Values.cordSiteName }}_test:
154 description: Test Slice
155 type: tosca.nodes.Slice
156 properties:
157 # network: noauto
158 name: {{ .Values.cordSiteName }}_test
159 requirements:
160 - site:
161 node: {{ .Values.cordSiteName }}
162 relationship: tosca.relationships.BelongsToOne
163 - default_image:
164 node: Ubuntu-14.04
165 relationship: tosca.relationships.BelongsToOne
166
167 management:
168 type: tosca.nodes.Network
169 properties:
170 name: management
171 must-exist: true
172
173# Connect test slice to management net
174 networkslice#management_to_{{ .Values.cordSiteName }}_test:
175 type: tosca.nodes.NetworkSlice
176 requirements:
177 - network:
178 node: management
179 relationship: tosca.relationships.BelongsToOne
180 - slice:
181 node: {{ .Values.cordSiteName }}_test
182 relationship: tosca.relationships.BelongsToOne
Andy Bavier6e6191a2018-05-22 14:53:10 -0700183{{- end -}}
184
185{{- define "base-openstack.computeNodeTosca" -}}
186tosca_definitions_version: tosca_simple_yaml_1_0
187
188imports:
189 - custom_types/deployment.yaml
190 - custom_types/node.yaml
191 - custom_types/site.yaml
192 - custom_types/sitedeployment.yaml
193
194description: Adds OpenStack compute nodes
195
196topology_template:
197 node_templates:
198
199# Site/Deployment, fully defined in deployment.yaml
200 site:
201 type: tosca.nodes.Site
202 properties:
203 name: {{ .Values.cordSiteName }}
204 must-exist: true
205
206 deployment:
207 type: tosca.nodes.Deployment
208 properties:
209 name: {{ .Values.cordDeploymentName }}
210 must-exist: true
211
212 site_deployment:
213 type: tosca.nodes.SiteDeployment
214 requirements:
215 - site:
216 node: site
217 relationship: tosca.relationships.BelongsToOne
218 - deployment:
219 node: deployment
220 relationship: tosca.relationships.BelongsToOne
221
222# OpenStack compute nodes
223
224 {{- range .Values.computeNodes }}
225 {{ .name }}:
226 type: tosca.nodes.Node
227 properties:
228 name: {{ .name }}
229 bridgeId: {{ .bridgeId }}
230 dataPlaneIntf: {{ .dataPlaneIntf }}
231 dataPlaneIp: {{ .dataPlaneIp }}
232 requirements:
233 - site_deployment:
234 node: site_deployment
235 relationship: tosca.relationships.BelongsToOne
236 {{- end }}
237{{- end -}}