Generate necessary info
Change-Id: I9432bbeb12976dcd1a914fdc8671c3a41583f793
(cherry picked from commit ed7687ab89fd92dfcb69f7e36cd7c1e0fb9a5ded)
diff --git a/cord-pod/make-vtn-external-yaml.sh b/cord-pod/make-vtn-external-yaml.sh
index 46c86cd..d52c862 100644
--- a/cord-pod/make-vtn-external-yaml.sh
+++ b/cord-pod/make-vtn-external-yaml.sh
@@ -42,8 +42,18 @@
NODES=$( bash -c "source $SETUPDIR/admin-openrc.sh ; nova host-list" |grep compute|awk '{print $2}' )
I=0
+BRIDGE_IDX=1
for NODE in $NODES; do
echo $NODE
+ BRIDGE_ID=$(printf "of:%016d" $BRIDGE_IDX )
+ BRIDGE_IDX=$(expr $BRIDGE_IDX + 1)
+ FIP=$(ssh -o StrictHostKeyChecking=no $NODE ip -4 addr show fabric 2> /dev/null | grep inet | awk '{print $2}')
+ if [ -z "$FIP" ]
+ then
+ # Single-node POD case
+ FIP="10.168.0.253/24"
+ fi
+
cat >> $FN <<EOF
$NODE:
type: tosca.nodes.Node
@@ -53,7 +63,7 @@
type: tosca.nodes.Tag
properties:
name: bridgeId
- value: of:0000000000000001
+ value: $BRIDGE_ID
requirements:
- target:
node: $NODE
@@ -81,7 +91,7 @@
type: tosca.nodes.Tag
properties:
name: dataPlaneIp
- value: 10.168.0.253/24
+ value: $FIP
requirements:
- target:
node: $NODE