blob: 7c4cfd7fb958bb1eac8a5edb8ffa41ecfecc453a [file] [log] [blame]
Scott Bakerf93a06c2016-07-11 17:04:49 -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 rest_onos/v1/network/configuration/: { get_artifact: [ SELF, fabric_network_cfg_json, LOCAL_FILE ] }
26 artifacts:
27 fabric_network_cfg_json: /root/setup/base-config-2x2
28
29 service#fabric:
30 type: tosca.nodes.FabricService
31 properties:
32 view_url: /admin/fabric/fabricservice/\$id\$/
33 replaces: service_fabric
34
35
36EOF
37
38NODES=$( bash -c "source $SETUPDIR/admin-openrc.sh ; nova host-list" |grep compute|awk '{print $2}' )
39I=0
40for NODE in $NODES; do
41 echo $NODE
42 cat >> $FN <<EOF
43 $NODE:
44 type: tosca.nodes.Node
45
46 # Fabric location field for node $NODE
47 ${NODE}_location_tag:
48 type: tosca.nodes.Tag
49 properties:
50 name: location
51 value: of:0000000000000001/1
52 requirements:
53 - target:
54 node: $NODE
55 relationship: tosca.relationships.TagsObject
56 - service:
57 node: service#ONOS_Fabric
58 relationship: tosca.relationships.MemberOfService
59EOF
60done
61
62cat >> $FN <<EOF
63 Fabric_ONOS_app:
64 type: tosca.nodes.ONOSApp
65 requirements:
66 - onos_tenant:
67 node: service#ONOS_Fabric
68 relationship: tosca.relationships.TenantOfService
69 - fabric_service:
70 node: service#fabric
71 relationship: tosca.relationships.UsedByService
72 properties:
73 dependencies: org.onosproject.drivers, org.onosproject.openflow-base, org.onosproject.netcfghostprovider, org.onosproject.netcfglinksprovider, org.onosproject.segmentrouting, org.onosproject.vrouter, org.onosproject.hostprovider
74EOF