Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 1 | FN=$SETUPDIR/fabric.yaml |
| 2 | |
| 3 | rm -f $FN |
| 4 | |
| 5 | cat >> $FN <<EOF |
| 6 | tosca_definitions_version: tosca_simple_yaml_1_0 |
| 7 | |
| 8 | imports: |
| 9 | - custom_types/xos.yaml |
| 10 | |
| 11 | description: generate fabric configuration |
| 12 | |
| 13 | topology_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 | |
| 33 | EOF |
| 34 | |
| 35 | NODES=$( bash -c "source $SETUPDIR/admin-openrc.sh ; nova host-list" |grep compute|awk '{print $2}' ) |
| 36 | I=0 |
| 37 | for 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 |
| 56 | EOF |
| 57 | done |
| 58 | |
| 59 | cat >> $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 |
| 71 | EOF |