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