Pingping Lin | 82366d3 | 2016-08-31 00:21:56 +0000 | [diff] [blame] | 1 | FN=$SETUPDIR/vtn-external.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: autogenerated node tags file for VTN configuration |
| 12 | |
| 13 | topology_template: |
| 14 | node_templates: |
| 15 | |
| 16 | service#ONOS_CORD: |
| 17 | type: tosca.nodes.ONOSService |
| 18 | requirements: |
| 19 | properties: |
Gabe Black | 7c5aebc | 2017-01-12 22:30:09 +0000 | [diff] [blame] | 20 | kind: CORD-Platform |
Pingping Lin | 82366d3 | 2016-08-31 00:21:56 +0000 | [diff] [blame] | 21 | view_url: /admin/onos/onosservice/\$id$/ |
| 22 | no_container: true |
| 23 | rest_hostname: onos-cord |
Gabe Black | 86b1afe | 2017-01-12 18:52:51 +0000 | [diff] [blame] | 24 | rest_port: 8182 |
Pingping Lin | 82366d3 | 2016-08-31 00:21:56 +0000 | [diff] [blame] | 25 | replaces: service_ONOS_CORD |
| 26 | |
| 27 | service#vtn: |
| 28 | type: tosca.nodes.VTNService |
| 29 | properties: |
Gabe Black | 7c5aebc | 2017-01-12 22:30:09 +0000 | [diff] [blame] | 30 | kind: CORD-Platform |
Pingping Lin | 82366d3 | 2016-08-31 00:21:56 +0000 | [diff] [blame] | 31 | view_url: /admin/vtn/vtnservice/\$id$/ |
| 32 | privateGatewayMac: 00:00:00:00:00:01 |
Gabe Black | caf7e1c | 2016-11-08 21:49:04 +0000 | [diff] [blame] | 33 | localManagementIp: 172.27.0.1/24 |
Pingping Lin | 82366d3 | 2016-08-31 00:21:56 +0000 | [diff] [blame] | 34 | ovsdbPort: 6641 |
| 35 | sshUser: root |
| 36 | sshKeyFile: /root/node_key |
| 37 | sshPort: 22 |
Gabe Black | 86b1afe | 2017-01-12 18:52:51 +0000 | [diff] [blame] | 38 | xosEndpoint: http://xos:8888/ |
Pingping Lin | 82366d3 | 2016-08-31 00:21:56 +0000 | [diff] [blame] | 39 | xosUser: padmin@vicci.org |
| 40 | xosPassword: letmein |
| 41 | replaces: service_vtn |
Gabe Black | 86b1afe | 2017-01-12 18:52:51 +0000 | [diff] [blame] | 42 | vtnAPIVersion: 2 |
| 43 | controllerPort: onos-cord:6654 |
Pingping Lin | 82366d3 | 2016-08-31 00:21:56 +0000 | [diff] [blame] | 44 | |
| 45 | EOF |
| 46 | |
| 47 | NODES=$( bash -c "source $SETUPDIR/admin-openrc.sh ; nova host-list" |grep compute|awk '{print $2}' ) |
| 48 | I=0 |
| 49 | BRIDGE_IDX=1 |
| 50 | for NODE in $NODES; do |
| 51 | echo $NODE |
| 52 | BRIDGE_ID=$(printf "of:%016d" $BRIDGE_IDX ) |
| 53 | BRIDGE_IDX=$(expr $BRIDGE_IDX + 1) |
| 54 | FIP=$(ssh -i node_key -o StrictHostKeyChecking=no $NODE ip -4 addr show fabric 2> /dev/null | grep inet | awk '{print $2}') |
| 55 | if [ -z "$FIP" ] |
| 56 | then |
| 57 | # Single-node POD case |
| 58 | FIP="10.168.0.253/24" |
| 59 | fi |
| 60 | |
| 61 | cat >> $FN <<EOF |
| 62 | $NODE: |
| 63 | type: tosca.nodes.Node |
| 64 | |
| 65 | # VTN bridgeId field for node $NODE |
| 66 | ${NODE}_bridgeId_tag: |
| 67 | type: tosca.nodes.Tag |
| 68 | properties: |
| 69 | name: bridgeId |
| 70 | value: $BRIDGE_ID |
| 71 | requirements: |
| 72 | - target: |
| 73 | node: $NODE |
| 74 | relationship: tosca.relationships.TagsObject |
| 75 | - service: |
| 76 | node: service#ONOS_CORD |
| 77 | relationship: tosca.relationships.MemberOfService |
| 78 | |
| 79 | # VTN dataPlaneIntf field for node $NODE |
| 80 | ${NODE}_dataPlaneIntf_tag: |
| 81 | type: tosca.nodes.Tag |
| 82 | properties: |
| 83 | name: dataPlaneIntf |
| 84 | value: fabric |
| 85 | requirements: |
| 86 | - target: |
| 87 | node: $NODE |
| 88 | relationship: tosca.relationships.TagsObject |
| 89 | - service: |
| 90 | node: service#ONOS_CORD |
| 91 | relationship: tosca.relationships.MemberOfService |
| 92 | |
| 93 | # VTN dataPlaneIp field for node $NODE |
| 94 | ${NODE}_dataPlaneIp_tag: |
| 95 | type: tosca.nodes.Tag |
| 96 | properties: |
| 97 | name: dataPlaneIp |
| 98 | value: $FIP |
| 99 | requirements: |
| 100 | - target: |
| 101 | node: $NODE |
| 102 | relationship: tosca.relationships.TagsObject |
| 103 | - service: |
| 104 | node: service#ONOS_CORD |
| 105 | relationship: tosca.relationships.MemberOfService |
| 106 | |
Pingping Lin | 2fe8efb | 2017-01-24 05:00:59 +0000 | [diff] [blame] | 107 | # VTN hostManagementIface field for node $NODE |
| 108 | ${NODE}_dataPlaneIp_tag: |
| 109 | type: tosca.nodes.Tag |
| 110 | properties: |
| 111 | name: hostManagementIface |
| 112 | value: veth3 |
| 113 | requirements: |
| 114 | - target: |
| 115 | node: $NODE |
| 116 | relationship: tosca.relationships.TagsObject |
| 117 | - service: |
| 118 | node: service#ONOS_CORD |
| 119 | relationship: tosca.relationships.MemberOfService |
| 120 | |
Pingping Lin | 82366d3 | 2016-08-31 00:21:56 +0000 | [diff] [blame] | 121 | EOF |
| 122 | done |
| 123 | |
| 124 | cat >> $FN <<EOF |
| 125 | VTN_ONOS_app: |
| 126 | type: tosca.nodes.ONOSVTNApp |
| 127 | requirements: |
| 128 | - onos_tenant: |
| 129 | node: service#ONOS_CORD |
| 130 | relationship: tosca.relationships.TenantOfService |
| 131 | - vtn_service: |
| 132 | node: service#vtn |
| 133 | relationship: tosca.relationships.UsedByService |
| 134 | properties: |
| 135 | install_dependencies: http://mavenrepo:8080/repository/org/opencord/cord-config/1.1-SNAPSHOT/cord-config-1.1-SNAPSHOT.oar,http://mavenrepo:8080/repository/org/opencord/vtn/1.1-SNAPSHOT/vtn-1.1-SNAPSHOT.oar |
| 136 | dependencies: org.onosproject.drivers, org.onosproject.drivers.ovsdb, org.onosproject.openflow-base, org.onosproject.ovsdb-base, org.onosproject.dhcp |
| 137 | autogenerate: vtn-network-cfg |
| 138 | EOF |