diff options
author | Dan Timoney <dtimoney@att.com> | 2017-11-01 15:31:08 -0400 |
---|---|---|
committer | Dan Timoney <dtimoney@att.com> | 2017-11-01 15:31:08 -0400 |
commit | 9a1267e79c232b949f666cc130ebb9837f594090 (patch) | |
tree | 4a2445a07ae87d9b58c83ed55185725795c933de /installation | |
parent | 817f1f33ddffb9ae86a77613439c50ff2059859f (diff) |
Updates to tunnelxconn assignment
Update tunnelxconn assignment logic to assign IP address and VNI
from local inventory
Change-Id: I1aae9162d1eb7a61d641b620488d52abdfe32357
Issue-ID: SDNC-160
Signed-off-by: Dan Timoney <dtimoney@att.com>
Former-commit-id: a7e7279c379e470c1cf7446099fbc11b66fd2ac8
Diffstat (limited to 'installation')
-rwxr-xr-x | installation/sdnc/src/main/scripts/addIpAddresses.sh | 33 | ||||
-rwxr-xr-x | installation/sdnc/src/main/scripts/addVnis.sh | 31 |
2 files changed, 64 insertions, 0 deletions
diff --git a/installation/sdnc/src/main/scripts/addIpAddresses.sh b/installation/sdnc/src/main/scripts/addIpAddresses.sh new file mode 100755 index 00000000..7c088a91 --- /dev/null +++ b/installation/sdnc/src/main/scripts/addIpAddresses.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +MYSQL_USER=${MYSQL_USER:-sdnctl} +MYSQL_PWD=${MYSQL_PWD:-gamma} +MYSQL_DB=${MYSQL_DB:-sdnctl} +MYSQL_HOST=${MYSQL_HOST:-dbhost} + +universe=$1 +subnet=$2 +start=$3 + +if [ $# -eq 3 ] +then + mysql --user=${MYSQL_USER} --password=${MYSQL_PWD} --host=${MYSQL_HOST} ${MYSQL_DB} <<EOF +INSERT INTO IPV4_ADDRESS_POOL VALUES('$aicSiteId', '$universe', 'AVAILABLE', '${subnet}.${start}'); +EOF +elif [ $# -eq 4 ] +then + stop=$4 + ip=$start + + while [ $ip -le $stop ] + do + mysql --user=${MYSQL_USER} --password=${MYSQL_PWD} --host=${MYSQL_HOST} ${MYSQL_DB} <<EOF +INSERT INTO IPV4_ADDRESS_POOL VALUES('$aicSiteId', '$universe', 'AVAILABLE','${subnet}.${ip}'); +EOF +ip=$(( ip+1 )) +done +else + echo "Usage: $0 universe subnet start [stop]" + exit 1 +fi + diff --git a/installation/sdnc/src/main/scripts/addVnis.sh b/installation/sdnc/src/main/scripts/addVnis.sh new file mode 100755 index 00000000..a8b50eb6 --- /dev/null +++ b/installation/sdnc/src/main/scripts/addVnis.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +MYSQL_USER=${MYSQL_USER:-sdnctl} +MYSQL_PWD=${MYSQL_PWD:-gamma} +MYSQL_DB=${MYSQL_DB:-sdnctl} +MYSQL_HOST=${MYSQL_HOST:-dbhost} + +start=$1 + +if [ $# -eq 1 ] +then + mysql --user=${MYSQL_USER} --password=${MYSQL_PWD} --host ${MYSQL_HOST} ${MYSQL_DB} <<EOF +INSERT INTO VLAN_ID_POOL (purpose, status, vlan_id) VALUES('VNI', 'AVAILABLE', $start); +EOF +elif [ $# -eq 2 ] +then + stop=$2 + vlanid=$start + + while [ $vlanid -le $stop ] + do + mysql --user=${MYSQL_USER} --password=${MYSQL_PWD} --host ${MYSQL_HOST} ${MYSQL_DB} <<EOF +INSERT INTO VLAN_ID_POOL (purpose, status, vlan_id) VALUES( 'VNI', 'AVAILABLE', $vlanid); +EOF +vlanid=$(( vlanid+1 )) +done +else + echo "Usage: $0 start [stop]" + exit 1 +fi + |