Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 1 | FN=$SETUPDIR/vtn-network-cfg.json |
| 2 | |
| 3 | echo "Writing to $FN" |
| 4 | |
| 5 | rm -f $FN |
| 6 | |
| 7 | cat >> $FN <<EOF |
| 8 | { |
| 9 | "apps" : { |
| 10 | "org.onosproject.cordvtn" : { |
| 11 | "cordvtn" : { |
| 12 | "privateGatewayMac" : "00:00:00:00:00:01", |
| 13 | "localManagementIp": "172.27.0.1/24", |
| 14 | "ovsdbPort": "6641", |
| 15 | "sshPort": "22", |
| 16 | "sshUser": "root", |
| 17 | "sshKeyFile": "/root/node_key", |
| 18 | "publicGateways": [ |
| 19 | { |
| 20 | "gatewayIp": "10.123.0.1", |
| 21 | "gatewayMac": "00:8c:fa:5b:09:d8" |
| 22 | } |
| 23 | ], |
| 24 | "nodes" : [ |
| 25 | EOF |
| 26 | |
| 27 | NODES=$( sudo bash -c "source $SETUPDIR/admin-openrc.sh ; nova hypervisor-list" |grep -v ID|grep -v +|awk '{print $4}' ) |
| 28 | |
| 29 | # XXX disabled - we don't need or want the nm node at this time |
| 30 | # also configure ONOS to manage the nm node |
| 31 | # NM=`grep "^nm" /root/setup/fqdn.map | awk '{ print $2 }'` |
| 32 | # NODES="$NODES $NM" |
| 33 | |
| 34 | NODECOUNT=0 |
| 35 | for NODE in $NODES; do |
| 36 | ((NODECOUNT++)) |
| 37 | done |
| 38 | |
| 39 | I=0 |
| 40 | for NODE in $NODES; do |
| 41 | echo $NODE |
| 42 | NODEIP=`getent hosts $NODE | awk '{ print $1 }'` |
| 43 | |
| 44 | # This part is cloudlab-specific. It examines the flat-net-1 network and extracts |
| 45 | # the eth device and ip address that was assigned to flat-net-1. |
| 46 | sudo scp root@$NODE:/root/setup/info.flat-lan-1 $SETUPDIR/flat-lan-$NODE |
| 47 | PHYPORT=`bash -c "source $SETUPDIR/flat-lan-$NODE; echo \\\$DATADEV"` |
| 48 | LOCALIP=`bash -c "source $SETUPDIR/flat-lan-$NODE; echo \\\$DATAIP"` |
| 49 | |
| 50 | ((I++)) |
| 51 | cat >> $FN <<EOF |
| 52 | { |
| 53 | "hostname": "$NODE", |
| 54 | "hostManagementIp": "$NODEIP/24", |
| 55 | "bridgeId": "of:000000000000000$I", |
| 56 | "dataPlaneIntf": "$PHYPORT", |
| 57 | "dataPlaneIp": "$LOCALIP/24" |
| 58 | EOF |
| 59 | if [[ "$I" -lt "$NODECOUNT" ]]; then |
| 60 | echo " }," >> $FN |
| 61 | else |
| 62 | echo " }" >> $FN |
| 63 | fi |
| 64 | done |
| 65 | |
| 66 | # get the openstack admin password and username |
| 67 | source $SETUPDIR/admin-openrc.sh |
| 68 | |
| 69 | HOSTNAME=`hostname` |
| 70 | NEUTRONIP=`getent hosts $HOSTNAME | awk '{ print $1 }'` |
| 71 | KEYSTONEIP=`getent hosts $HOSTNAME | awk '{ print $1 }'` |
| 72 | |
| 73 | cat >> $FN <<EOF |
| 74 | ] |
| 75 | } |
| 76 | }, |
| 77 | "org.onosproject.openstackinterface" : { |
| 78 | "openstackinterface" : { |
| 79 | "do_not_push_flows" : "true", |
| 80 | "neutron_server" : "http://$NEUTRONIP:9696/v2.0/", |
| 81 | "keystone_server" : "http://$KEYSTONEIP:5000/v2.0/", |
| 82 | "user_name" : "$OS_USERNAME", |
| 83 | "password" : "$OS_PASSWORD" |
| 84 | } |
| 85 | } |
| 86 | } |
| 87 | } |
| 88 | EOF |