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 |
Scott Baker | 2739d52 | 2016-06-29 07:34:08 -0700 | [diff] [blame] | 25 | rest_onos/v1/network/configuration/: { get_artifact: [ SELF, fabric_network_cfg_json, LOCAL_FILE ] } |
| 26 | artifacts: |
Andy Bavier | 000fd92 | 2016-06-30 14:55:37 -0400 | [diff] [blame] | 27 | fabric_network_cfg_json: /root/setup/base-config-2x2 |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 28 | |
| 29 | service#fabric: |
| 30 | type: tosca.nodes.FabricService |
| 31 | properties: |
| 32 | view_url: /admin/fabric/fabricservice/\$id\$/ |
| 33 | replaces: service_fabric |
| 34 | |
| 35 | |
| 36 | EOF |
| 37 | |
| 38 | NODES=$( bash -c "source $SETUPDIR/admin-openrc.sh ; nova host-list" |grep compute|awk '{print $2}' ) |
| 39 | I=0 |
| 40 | for 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 |
| 59 | EOF |
| 60 | done |
| 61 | |
| 62 | cat >> $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: |
Scott Baker | 2739d52 | 2016-06-29 07:34:08 -0700 | [diff] [blame] | 73 | dependencies: org.onosproject.drivers, org.onosproject.openflow-base, org.onosproject.netcfghostprovider, org.onosproject.netcfglinksprovider, org.onosproject.segmentrouting, org.onosproject.vrouter, org.onosproject.hostprovider |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 74 | EOF |