VOL-3135 - parameterized bbsim based service name

Change-Id: Ie884c13b4d34c5c088ab8e123cbcb83e5462f0c9
diff --git a/voltha b/voltha
index 76f73f9..7201b40 100755
--- a/voltha
+++ b/voltha
@@ -90,8 +90,6 @@
 ONLY_ONE=${ONLY_ONE:-yes}
 SCHEDULE_ON_CONTROL_NODES=${SCHEDULE_ON_CONTROL_NODES:-no}
 CONFIG_SADIS=${CONFIG_SADIS:-no} # yes | no | file | bbsim | external | URL
-SADIS_SUBSCRIBERS=${SADIS_SUBSCRIBERS:-http://bbsim0.$VOLTHA_NS.svc:50074/v2/subscribers/%s}
-SADIS_BANDWIDTH_PROFILES=${SADIS_BANDWIDTH_PROFILES:-http://bbsim0.$VOLTHA_NS.svc:50074/v2/bandwidthprofiles/%s}
 SADIS_CFG=${SADIS_CFG:-onos-files/onos-sadis-sample.json}
 INSTALL_ONOS_APPS=${INSTALL_ONOS_APPS:-no}
 JUST_K8S=${JUST_K8S:-no}
@@ -377,6 +375,15 @@
     EXTRA_TOOLS+=" yq"
 fi
 
+if [ "$LEGACY_BBSIM_INDEX" == "no" ]; then
+    BBSIM_SADIS_SVC="bbsim0"
+else
+    BBSIM_SADIS_SVC="bbsim"
+fi
+
+SADIS_SUBSCRIBERS=${SADIS_SUBSCRIBERS:-http://$BBSIM_SADIS_SVC.$VOLTHA_NS.svc:50074/v2/subscribers/%s}
+SADIS_BANDWIDTH_PROFILES=${SADIS_BANDWIDTH_PROFILES:-http://$BBSIM_SADIS_SVC.$VOLTHA_NS.svc:50074/v2/bandwidthprofiles/%s}
+
 if [ "$HELM_USE_UPGRADE" == "yes" ]; then
     _HELM_DESC="Upgrade/Install"
 else
@@ -1767,7 +1774,7 @@
 {
     "sadis": {
         "integration": {
-            "url": "http://bbsim0.$BBSIM_NS.svc.cluster.local:50074/v2/subscribers/%s",
+            "url": "http://$BBSIM_SADIS_SVC.$BBSIM_NS.svc.cluster.local:50074/v2/subscribers/%s",
             "cache": {
                 "enabled": true,
                 "maxsize": 50,
@@ -1777,7 +1784,7 @@
     },
     "bandwidthprofile": {
         "integration": {
-            "url": "http://bbsim0.$BBSIM_NS.svc.cluster.local:50074/v2/bandwidthprofiles/%s",
+            "url": "http://$BBSIM_SADIS_SVC.$BBSIM_NS.svc.cluster.local:50074/v2/bandwidthprofiles/%s",
             "cache": {
                 "enabled": true,
                 "maxsize": 50,