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