[VOL-3008] Using consistent names in BBSim releases

Change-Id: I46bb23a6c9200eabf545ff91751f3470b569c74a
diff --git a/releases/voltha-2.3 b/releases/voltha-2.3
index e60061b..d8646ec 100644
--- a/releases/voltha-2.3
+++ b/releases/voltha-2.3
@@ -15,3 +15,7 @@
 # Also we need to specify the tag for voltha/voltha-onos image since this is
 # not in the ONOS chart.
 export EXTRA_HELM_FLAGS="--set defaults.image_tag=null,images.onos.tag=4.0.2 "
+
+# In voltha-2.3 multiple BBSim beployment were namend bbsim, bbsim1, bbsim2..
+# In master we made the names consistent bbsim0, bbsim1, ...
+export LEGACY_BBSIM_INDEX=yes
diff --git a/voltha b/voltha
index 53d9559..c88108b 100755
--- a/voltha
+++ b/voltha
@@ -124,6 +124,7 @@
 NUM_OF_OPENONU=${NUM_OF_OPENONU:-1}
 MAX_NUM_OF_BBSIM=10
 MAX_NUM_OF_OPENONU=10
+LEGACY_BBSIM_INDEX=${LEGACY_BBSIM_INDEX:-no}
 
 HOSTOS="$(uname -s | tr "[:upper:]" "[:lower:"])"
 HOSTARCH="$(uname -m | tr "[:upper:]" "[:lower:"])"
@@ -270,6 +271,7 @@
     WAIT_ON_DOWN \
     ONLY_ONE \
     VOLTHA_DOWN_ON_TIMEOUT \
+    LEGACY_BBSIM_INDEX \
     "
 
 OPT_YES_NO="\
@@ -1983,11 +1985,18 @@
     echo -e "Verify BBSIM $PLUG"
     bspin - "Verify BBSIM Installed"
     for instance in $(seq 0 $((NUM_OF_BBSIM-1))); do
-        if [ "$instance" -eq 0 ]; then
-            instance_num=""
+
+        if [ "$LEGACY_BBSIM_INDEX" == "yes" ]; then
+            if [ "$instance" -eq 0 ]; then
+                instance_num=""
+            else
+                instance_num=$instance
+            fi
         else
             instance_num=$instance
         fi
+
+
         if [ "$HELM_USE_UPGRADE" == "yes" ] || [ "$(helm list --deployed --short --namespace "$BBSIM_NS" "^bbsim${instance_num}\$" | wc -l)" -ne 1 ]; then
             espin - "$NOT_VERIFIED"
             S_TAG="$((900+instance))"