blob: 77b855dcc140b6746fd5bde868b9ec092a193818 [file] [log] [blame]
Scott Baker50421662016-06-27 22:09:48 -07001FN=$SETUPDIR/vtn-network-cfg.json
2
3echo "Writing to $FN"
4
5rm -f $FN
6
7cat >> $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" : [
25EOF
26
27NODES=$( 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
34NODECOUNT=0
35for NODE in $NODES; do
36 ((NODECOUNT++))
37done
38
39I=0
40for 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"
58EOF
59 if [[ "$I" -lt "$NODECOUNT" ]]; then
60 echo " }," >> $FN
61 else
62 echo " }" >> $FN
63 fi
64done
65
66# get the openstack admin password and username
67source $SETUPDIR/admin-openrc.sh
68
69HOSTNAME=`hostname`
70NEUTRONIP=`getent hosts $HOSTNAME | awk '{ print $1 }'`
71KEYSTONEIP=`getent hosts $HOSTNAME | awk '{ print $1 }'`
72
73cat >> $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}
88EOF