blob: a8296902c09e7b4af74b8d538b9713f3045edf0a [file] [log] [blame]
Scott Baker50421662016-06-27 22:09:48 -07001FN=$SETUPDIR/fabric.yaml
2
3rm -f $FN
4
5cat >> $FN <<EOF
6tosca_definitions_version: tosca_simple_yaml_1_0
7
8imports:
9 - custom_types/xos.yaml
10
11description: generate fabric configuration
12
13topology_template:
14 node_templates:
15
16 service#ONOS_Fabric:
17 type: tosca.nodes.ONOSService
18 requirements:
19 properties:
20 kind: onos
21 view_url: /admin/onos/onosservice/\$id$/
22 no_container: true
23 rest_hostname: onos-fabric
24 replaces: service_ONOS_Fabric
25
26 service#fabric:
27 type: tosca.nodes.FabricService
28 properties:
29 view_url: /admin/fabric/fabricservice/\$id\$/
30 replaces: service_fabric
31
32
33EOF
34
35NODES=$( bash -c "source $SETUPDIR/admin-openrc.sh ; nova host-list" |grep compute|awk '{print $2}' )
36I=0
37for NODE in $NODES; do
38 echo $NODE
39 cat >> $FN <<EOF
40 $NODE:
41 type: tosca.nodes.Node
42
43 # Fabric location field for node $NODE
44 ${NODE}_location_tag:
45 type: tosca.nodes.Tag
46 properties:
47 name: location
48 value: of:0000000000000001/1
49 requirements:
50 - target:
51 node: $NODE
52 relationship: tosca.relationships.TagsObject
53 - service:
54 node: service#ONOS_Fabric
55 relationship: tosca.relationships.MemberOfService
56EOF
57done
58
59cat >> $FN <<EOF
60 Fabric_ONOS_app:
61 type: tosca.nodes.ONOSApp
62 requirements:
63 - onos_tenant:
64 node: service#ONOS_Fabric
65 relationship: tosca.relationships.TenantOfService
66 - fabric_service:
67 node: service#fabric
68 relationship: tosca.relationships.UsedByService
69 properties:
70 dependencies: org.onosproject.lldpprovider, org.onosproject.hostprovider, org.onosproject.openflow-base, org.onosproject.openflow, org.onosproject.drivers, org.onosproject.segmentrouting
71EOF