SEBA-686 Enable multiple Ponsim OLTs

Change-Id: Ia8cc47492010bcd98f0a8800f70386cd5ca5342b
diff --git a/configs/seba-ponsim-latest.yaml b/configs/seba-ponsim-latest.yaml
index a55c2e9..22310bb 100644
--- a/configs/seba-ponsim-latest.yaml
+++ b/configs/seba-ponsim-latest.yaml
@@ -35,7 +35,6 @@
     tag: 'master'
 # ONOS
   onos:
-    repository: 'matteoscandolo/onos'
     tag: '1.13.9-rc4'
 # VOLTHA
   vcore:
@@ -82,7 +81,7 @@
 sadis-server:
   image:
     tag: 'latest'
-olt-service:
+volt:
   image:
     tag: 'master'
 rcord:
@@ -116,6 +115,7 @@
 
 # in ponsim-pod chart
 bandwidthProfiles: True
+legacyPonsim: False
 
 # ONOS applications
 aaaAppUrl: "https://oss.sonatype.org/service/local/artifact/maven/redirect?r=snapshots&g=org.opencord&a=aaa-app&v=1.9.0-SNAPSHOT&e=oar"
diff --git a/configs/seba-ponsim-voltha-1.7.yaml b/configs/seba-ponsim-voltha-1.7.yaml
index 525239f..6794a94 100644
--- a/configs/seba-ponsim-voltha-1.7.yaml
+++ b/configs/seba-ponsim-voltha-1.7.yaml
@@ -36,7 +36,6 @@
 
 # ONOS
   onos:
-    repository: 'matteoscandolo/onos'
     tag: '1.13.9-rc4'
 
 # VOLTHA
@@ -84,7 +83,7 @@
 sadis-server:
   image:
     tag: 'latest'
-olt-service:
+volt:
   image:
     tag: '2.2.1'
 rcord:
@@ -118,6 +117,7 @@
 
 # in ponsim-pod chart
 bandwidthProfiles: True
+legacyPonsim: False
 
 # ONOS applications
 aaaAppUrl: "https://oss.sonatype.org/service/local/artifact/maven/redirect?r=snapshots&g=org.opencord&a=aaa-app&v=1.9.0-SNAPSHOT&e=oar"
diff --git a/mininet/Chart.yaml b/mininet/Chart.yaml
index b06bc8c..fdc6e9b 100644
--- a/mininet/Chart.yaml
+++ b/mininet/Chart.yaml
@@ -17,4 +17,4 @@
 appVersion: "1.0"
 description: A Helm chart for Mininet
 name: mininet
-version: 0.4.1
+version: 0.5.0
diff --git a/mininet/templates/_helpers.tpl b/mininet/templates/_helpers.tpl
index 31212af..8396f02 100644
--- a/mininet/templates/_helpers.tpl
+++ b/mininet/templates/_helpers.tpl
@@ -46,3 +46,22 @@
 {{- define "mininet.chart" -}}
 {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
 {{- end -}}
+
+{{/*
+Generate the CNI annotations depending on number of OLTs
+*/}}
+{{- define "mininet.cni" -}}
+{{- printf "calico" -}}
+{{- range $i, $junk := until (.Values.numOlts|int) -}}
+{{- printf ",nni%d" $i -}}
+{{- end -}}
+{{- end -}}
+
+{{/*
+Generate the DHCP subnets depending on number of OLTs
+*/}}
+{{- define "mininet.dhcp_range" -}}
+{{- range $i, $junk := until (.Values.numOlts|int) -}}
+{{- printf " --dhcp-range=172.18.%d.50,172.18.%d.150,12h" $i $i -}}
+{{- end -}}
+{{- end -}}
\ No newline at end of file
diff --git a/mininet/templates/deployment.yaml b/mininet/templates/deployment.yaml
index f75041e..571e024 100644
--- a/mininet/templates/deployment.yaml
+++ b/mininet/templates/deployment.yaml
@@ -33,10 +33,8 @@
       labels:
         app: {{ template "mininet.name" . }}
         release: {{ .Release.Name }}
-    {{- with .Values.annotations }}
       annotations:
-{{ toYaml . | indent 8 }}
-    {{- end }}
+        cni: {{ template "mininet.cni" . }}
     spec:
       containers:
         - name: {{ .Chart.Name }}
diff --git a/mininet/toposcripts/topo.py b/mininet/toposcripts/topo.py
index dc87317..8e8b6c4 100644
--- a/mininet/toposcripts/topo.py
+++ b/mininet/toposcripts/topo.py
@@ -59,24 +59,34 @@
     net.addLink( h1, s2 )
     net.addLink( h2, s2 )
 
-    info( '*** Adding hardware interface eth1 to switch %s\n' % s1.name)
-    _intf = Intf( 'eth1', node=s1 )
+{{- range $i, $junk := until (.Values.numOlts|int) -}}
+{{- $intf := printf "eth%d" (add $i 1) }}
 
-    info( '*** Turning off checksum offloading for eth1\n' )
-    print quietRun( 'ethtool -K eth1 tx off rx off' )
+    info( '*** Adding hardware interface {{ $intf }} to switch s1\n')
+    _intf = Intf( '{{ $intf }}', node=s1 )
 
-    info( '*** Adding VLAN interface to host %s\n' % h1.name)
-    base = "%s-eth0" % h1.name
-    h1.cmd( 'ifconfig %s-eth1 10.1.0.1/24 up' % h1.name)
-    h1.cmd( 'ip link add link %s name %s.222 type vlan proto 802.1Q id 222' % (base, base))
-    h1.cmd( 'ip link add link %s.222 name %s.222.111 type vlan proto 802.1Q id 111' % (base, base))
-    h1.cmd( 'ifconfig %s.222 up' % base)
-    h1.cmd( 'ifconfig %s.222.111 up' % base)
-    h1.cmd( 'ifconfig %s.222.111 172.18.0.10/24' % base)
-    h1.cmd( 'dnsmasq --dhcp-range=172.18.0.50,172.18.0.150,12h' )
+    info( '*** Turning off checksum offloading for {{ $intf }}\n' )
+    print quietRun( 'ethtool -K {{ $intf }} tx off rx off' )
+{{- end }}
+
+    info( '*** Adding VLAN interface to host h1\n')
+    h1.cmd( 'ifconfig h1-eth1 10.1.0.1/24 up')
+
+{{- range $i, $junk := until (.Values.numOlts|int) -}}
+{{- $stag := add 222 $i }}
+{{- $ctag := 111 }}
+
+    h1.cmd( 'ip link add link h1-eth0 name h1-eth0.{{ $stag }} type vlan proto 802.1Q id {{ $stag }}' )
+    h1.cmd( 'ip link add link h1-eth0.{{ $stag }} name h1-eth0.{{ $stag }}.{{ $ctag }} type vlan proto 802.1Q id {{ $ctag }}' )
+    h1.cmd( 'ifconfig h1-eth0.{{ $stag }} up' )
+    h1.cmd( 'ifconfig h1-eth0.{{ $stag }}.{{ $ctag }} up' )
+    h1.cmd( 'ifconfig h1-eth0.{{ $stag }}.{{ $ctag }} 172.18.{{ $i }}.10/24' )
+{{- end }}
+
+    h1.cmd( 'dnsmasq {{ template "mininet.dhcp_range" . }}' )
 
 {{- if .Values.enableMulticast }}
-    info( '*** Start multicast routing on %s and source on %s\n' % (h1.name, h2.name))
+    info( '*** Start multicast routing on h1 and source on h2\n')
     h1.cmd( 'service pimd start' )
     h2.cmd( 'mcjoin -s -i h2-eth0 -t 2 >& /tmp/mcjoin.log &')
 {{- end }}
diff --git a/mininet/values.yaml b/mininet/values.yaml
index b583914..2a049d4 100644
--- a/mininet/values.yaml
+++ b/mininet/values.yaml
@@ -45,9 +45,7 @@
             - olt
         topologyKey: kubernetes.io/hostname
 
-annotations:
-  cni: "calico,pon1"
-
 onosOpenflowSvc: "onos-openflow.default.svc.cluster.local"
 vlanMatchDepth: 1
 enableMulticast: false
+numOlts: 1
diff --git a/ponnet/Chart.yaml b/ponnet/Chart.yaml
index 607525f..959032f 100644
--- a/ponnet/Chart.yaml
+++ b/ponnet/Chart.yaml
@@ -14,4 +14,4 @@
 # limitations under the License.
 
 name: ponnet
-version: 1.1.0
+version: 1.2.0
diff --git a/ponnet/templates/ponnet-cni.yaml b/ponnet/templates/ponnet-cni.yaml
index 0241df6..a3cf4f8 100644
--- a/ponnet/templates/ponnet-cni.yaml
+++ b/ponnet/templates/ponnet-cni.yaml
@@ -90,11 +90,12 @@
   name: ponnet-config
   namespace: kube-system
 data:
-  pon0.conf: |
+{{- range $i, $junk := until (.Values.numOlts|int) }}
+  pon{{ $i }}.conf: |
     {
-      "name": "pon0",
+      "name": "pon{{ $i }}",
       "type": "bridge",
-      "bridge": "pon0",
+      "bridge": "pon{{ $i }}",
       "isGateway": false,
       "ipMask": false,
       "ipam": {
@@ -102,11 +103,11 @@
         "subnet": "10.22.0.0/16"
       }
     }
-  pon1.conf: |
+  nni{{ $i }}.conf: |
     {
-      "name": "pon1",
+      "name": "nni{{ $i }}",
       "type": "bridge",
-      "bridge": "pon1",
+      "bridge": "nni{{ $i }}",
       "isGateway": false,
       "ipMask": false,
       "ipam": {
@@ -114,6 +115,7 @@
         "subnet": "10.23.0.0/16"
       }
     }
+{{- end }}
 
 ---
 # Install Ponnnet CNI conf on each slave node.
diff --git a/ponnet/values.yaml b/ponnet/values.yaml
index 53e9a8a..759bd95 100644
--- a/ponnet/values.yaml
+++ b/ponnet/values.yaml
@@ -23,3 +23,5 @@
 
 global:
   namespace: voltha
+
+numOlts: 1
diff --git a/ponsimv2/Chart.yaml b/ponsimv2/Chart.yaml
index 296e6a1..45bf595 100644
--- a/ponsimv2/Chart.yaml
+++ b/ponsimv2/Chart.yaml
@@ -17,7 +17,7 @@
 description: PON Simulator
 icon: https://guide.opencord.org/logos/cord.svg
 
-version: 1.0.3
+version: 1.1.0
 
 # VOLTHA version
 appVersion: 1.6.0
diff --git a/ponsimv2/templates/olt.yaml b/ponsimv2/templates/olt.yaml
index 8026068..3f03ed5 100644
--- a/ponsimv2/templates/olt.yaml
+++ b/ponsimv2/templates/olt.yaml
@@ -13,39 +13,41 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+{{- range $i, $junk := until (.Values.numOlts|int) }}
+---
 apiVersion: v1
 kind: Service
 metadata:
-   name: olt
-   namespace: {{ .Values.global.namespace }}
+   name: olt{{ $i }}
+   namespace: {{ $.Values.global.namespace }}
    labels:
-     name: olt
+     name: olt{{ $i }}
 spec:
   ports:
     - name: grpc
       port: 50060
       targetPort: 50060
   selector:
-    app: olt
+    app: olt{{ $i }}
 ---
 apiVersion: apps/v1beta1
 kind: Deployment
 metadata:
-  name: olt
-  namespace: {{ .Values.global.namespace }}
+  name: olt{{ $i }}
+  namespace: {{ $.Values.global.namespace }}
 spec:
    replicas: 1
    template:
      metadata:
        labels:
-         app: olt
+         app: olt{{ $i }}
        annotations:
-         cni: "calico,pon1"
+         cni: "calico,nni{{ $i }}"
      spec:
        containers:
-         - name: olt
-           image: "{{ .Values.global.registry }}{{ .Values.images.olt.repository }}:{{ tpl .Values.images.olt.tag . }}"
-           imagePullPolicy: {{ .Values.images.olt.pullPolicy }}
+         - name: olt{{ $i }}
+           image: "{{ $.Values.global.registry }}{{ $.Values.images.olt.repository }}:{{ tpl $.Values.images.olt.tag $ }}"
+           imagePullPolicy: {{ $.Values.images.olt.pullPolicy }}
            env:
              - name: POD_IP
                valueFrom:
@@ -71,3 +73,4 @@
            ports:
             - containerPort: 50060
               name: grpc-port
+{{- end }}
\ No newline at end of file
diff --git a/ponsimv2/templates/onu.yaml b/ponsimv2/templates/onu.yaml
index 6179fc2..debb013 100644
--- a/ponsimv2/templates/onu.yaml
+++ b/ponsimv2/templates/onu.yaml
@@ -13,34 +13,36 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+{{- range $i, $junk := until (.Values.numOlts|int) }}
+---
 apiVersion: v1
 kind: Service
 metadata:
-   name: onu
-   namespace: {{ .Values.global.namespace }}
+   name: onu{{ $i }}
+   namespace: {{ $.Values.global.namespace }}
    labels:
-     name: onu
+     name: onu{{ $i }}
 spec:
   ports:
     - name: grpc
       port: 50061
       targetPort: 50061
   selector:
-    app: onu
+    app: onu{{ $i }}
 ---
 apiVersion: apps/v1beta1
 kind: Deployment
 metadata:
-  name: onu
-  namespace: {{ .Values.global.namespace }}
+  name: onu{{ $i }}
+  namespace: {{ $.Values.global.namespace }}
 spec:
    replicas: 1
    template:
      metadata:
        labels:
-         app: onu
+         app: onu{{ $i }}
        annotations:
-         cni: "calico,pon0"
+         cni: "calico,pon{{ $i }}"
      spec:
        affinity:
         podAffinity:
@@ -52,12 +54,12 @@
                 - key: app
                   operator: In
                   values:
-                  - rg
+                  - rg{{ $i }}
               topologyKey: kubernetes.io/hostname
        containers:
-         - name: onu
-           image: "{{ .Values.global.registry }}{{ .Values.images.onu.repository }}:{{ tpl .Values.images.onu.tag . }}"
-           imagePullPolicy: {{ .Values.images.onu.pullPolicy }}
+         - name: onu{{ $i }}
+           image: "{{ $.Values.global.registry }}{{ $.Values.images.onu.repository }}:{{ tpl $.Values.images.onu.tag $ }}"
+           imagePullPolicy: {{ $.Values.images.onu.pullPolicy }}
            env:
              - name: POD_IP
                valueFrom:
@@ -72,7 +74,7 @@
              - "-device_type"
              - "ONU"
              - "-parent_addr"
-             - "olt"
+             - "olt{{ $i }}"
              - "-grpc_port"
              - "50061"
              - "-internal_if"
@@ -80,7 +82,12 @@
              - "-external_if"
              - "eth1"
              - "-promiscuous"
+{{- if not $.Values.legacyPonsim }}
+             - "-serial_number"
+             - "PSMO{{ printf "%04d" $i }}0000"
+{{- end }}
 
            ports:
             - containerPort: 50061
               name: grpc-port
+{{- end }}
\ No newline at end of file
diff --git a/ponsimv2/templates/rg.yaml b/ponsimv2/templates/rg.yaml
index e96c59c..ae3203c 100644
--- a/ponsimv2/templates/rg.yaml
+++ b/ponsimv2/templates/rg.yaml
@@ -13,19 +13,21 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+{{- range $i, $junk := until (.Values.numOlts|int) }}
+---
 apiVersion: apps/v1beta1
 kind: Deployment
 metadata:
-  name: rg
-  namespace: {{ .Values.global.namespace }}
+  name: rg{{ $i }}
+  namespace: {{ $.Values.global.namespace }}
 spec:
    replicas: 1
    template:
      metadata:
        labels:
-         app: rg
+         app: rg{{ $i }}
        annotations:
-         cni: "pon0"
+         cni: "pon{{ $i }}"
      spec:
        affinity:
         podAffinity:
@@ -37,12 +39,12 @@
                 - key: app
                   operator: In
                   values:
-                  - onu
+                  - onu{{ $i }}
               topologyKey: kubernetes.io/hostname
        containers:
-         - name: rg
-           image: "{{ .Values.global.registry }}{{ .Values.images.rg.repository }}:{{ tpl .Values.images.rg.tag . }}"
-           imagePullPolicy: {{ .Values.images.rg.pullPolicy }}
+         - name: rg{{ $i }}
+           image: "{{ $.Values.global.registry }}{{ $.Values.images.rg.repository }}:{{ tpl $.Values.images.rg.tag $ }}"
+           imagePullPolicy: {{ $.Values.images.rg.pullPolicy }}
            env:
              - name: POD_IP
                valueFrom:
@@ -55,3 +57,4 @@
            command: [ "/bin/bash", "-c", "trap : TERM INT; sleep infinity & wait" ]
            securityContext:
              privileged: true
+{{- end }}
\ No newline at end of file
diff --git a/ponsimv2/values.yaml b/ponsimv2/values.yaml
index 9fa6c0a..42434b5 100644
--- a/ponsimv2/values.yaml
+++ b/ponsimv2/values.yaml
@@ -34,3 +34,9 @@
 global:
   namespace: voltha
   registry: ''
+
+# numOlts > 1 only works with voltha-1.7 or greater
+numOlts: 1
+
+# legacyPonsim == true means that we are using voltha-1.6
+legacyPonsim: true
diff --git a/workflows/att-workflow/Chart.yaml b/workflows/att-workflow/Chart.yaml
index 2cc4f97..037a1ca 100644
--- a/workflows/att-workflow/Chart.yaml
+++ b/workflows/att-workflow/Chart.yaml
@@ -17,7 +17,7 @@
 name: att-workflow
 description: A Helm chart for XOS's "att-workflow"
 icon: https://guide.opencord.org/logos/cord.svg
-version: 1.2.1
+version: 1.2.2
 
 # xosproject/tosca-loader version
-appVersion: 1.3.0
+appVersion: 1.3.1
diff --git a/workflows/tt-workflow/Chart.yaml b/workflows/tt-workflow/Chart.yaml
index e95c96b..cdd1d7d 100644
--- a/workflows/tt-workflow/Chart.yaml
+++ b/workflows/tt-workflow/Chart.yaml
@@ -17,7 +17,7 @@
 name: tt-workflow
 description: A Helm chart for XOS's "tt-workflow"
 icon: https://guide.opencord.org/logos/cord.svg
-version: 0.1.2-dev
+version: 0.1.3-dev
 
 # xosproject/tosca-loader version
-appVersion: 1.3.0
+appVersion: 1.3.1
diff --git a/xos-profiles/base-kubernetes/Chart.yaml b/xos-profiles/base-kubernetes/Chart.yaml
index af57f5a..76abdd7 100644
--- a/xos-profiles/base-kubernetes/Chart.yaml
+++ b/xos-profiles/base-kubernetes/Chart.yaml
@@ -16,7 +16,7 @@
 name: base-kubernetes
 description: A Helm chart for XOS's "base-kubernetes" profile
 icon: https://guide.opencord.org/logos/cord.svg
-version: 1.0.2
+version: 1.0.3
 
 # xosproject/tosca-loader version
-appVersion: 1.3.0
+appVersion: 1.3.1
diff --git a/xos-profiles/ponsim-pod/Chart.yaml b/xos-profiles/ponsim-pod/Chart.yaml
index 7ef6105..6a714bb 100644
--- a/xos-profiles/ponsim-pod/Chart.yaml
+++ b/xos-profiles/ponsim-pod/Chart.yaml
@@ -17,7 +17,7 @@
 description: A Helm chart for loading the Ponsim pod's TOSCA files into XOS
 icon: https://guide.opencord.org/logos/xos.svg
 
-version: 1.2.1
+version: 1.3.0
 
 # xosproject/tosca-loader version
-appVersion: 1.1.5
+appVersion: 1.3.1
diff --git a/xos-profiles/ponsim-pod/templates/tosca-job.yaml b/xos-profiles/ponsim-pod/templates/tosca-job.yaml
index 92d4cd1..d2c37c7 100644
--- a/xos-profiles/ponsim-pod/templates/tosca-job.yaml
+++ b/xos-profiles/ponsim-pod/templates/tosca-job.yaml
@@ -37,8 +37,8 @@
       restartPolicy: OnFailure
       containers:
         - name: {{ .Chart.Name }}-ponsim-pod
-          image: {{ .Values.global.registry }}{{ .Values.image.repository }}:{{ tpl .Values.image.tag . }}
-          imagePullPolicy: {{ .Values.image.pullPolicy }}
+          image: {{ .Values.global.registry }}{{ .Values.images.tosca_loader.repository }}:{{ tpl .Values.images.tosca_loader.tag . }}
+          imagePullPolicy: {{ .Values.images.tosca_loader.pullPolicy }}
           env:
             - name: XOS_USER
               value: {{ .Values.xosAdminUser }}
diff --git a/xos-profiles/ponsim-pod/tosca/020-pod-olt.yaml b/xos-profiles/ponsim-pod/tosca/020-pod-olt.yaml
index 724d56c..6d40563 100644
--- a/xos-profiles/ponsim-pod/tosca/020-pod-olt.yaml
+++ b/xos-profiles/ponsim-pod/tosca/020-pod-olt.yaml
@@ -29,29 +29,36 @@
         name: volt
         must-exist: true
 
-    olt_device:
+{{- range $i, $junk := until (.Values.numOlts|int) }}
+
+    olt{{ $i }}_device:
       type: tosca.nodes.OLTDevice
       properties:
-        name: PONSIM OLT
+        name: PONSIM OLT {{ $i }}
         device_type: ponsim_olt
-        host: olt.voltha.svc
+        host: olt{{ $i }}.voltha.svc
         port: 50060
         switch_datapath_id: of:0000000000000001
-        switch_port: "2"
+        switch_port: "{{ add 2 $i }}"
         outer_tpid: "0x8100"
+{{- if $.Values.legacyPonsim }}
         dp_id: of:0000aabbccddeeff
+{{- else }}
+        dp_id: {{ index $.Values.oltDpids $i }}
+{{- end }}
         uplink: "2"
       requirements:
         - volt_service:
             node: service#volt
             relationship: tosca.relationships.BelongsToOne
 
-    pon_port:
+    olt{{ $i }}_pon_port:
       type: tosca.nodes.PONPort
       properties:
-        name: pon0
+        name: olt{{ $i }}pon0
         port_no: 1
       requirements:
         - olt_device:
-            node: olt_device
+            node: olt{{ $i }}_device
             relationship: tosca.relationships.BelongsToOne
+{{- end }}
\ No newline at end of file
diff --git a/xos-profiles/ponsim-pod/tosca/030-fabric.yaml b/xos-profiles/ponsim-pod/tosca/030-fabric.yaml
index ce3dda8..950551e 100644
--- a/xos-profiles/ponsim-pod/tosca/030-fabric.yaml
+++ b/xos-profiles/ponsim-pod/tosca/030-fabric.yaml
@@ -38,16 +38,19 @@
         ofId: of:0000000000000001
         routerMac: 00:00:02:01:06:01
 
-    # Setup the OLT switch port
-    port#olt_port:
+    # Setup the OLT switch ports
+{{- range $i, $junk := until (.Values.numOlts|int) }}
+
+    port#olt{{ $i }}_port:
       type: tosca.nodes.SwitchPort
       properties:
-        portId: 2
+        portId: {{ add 2 $i }}
         host_learning: false
       requirements:
         - switch:
             node: switch#leaf_1
             relationship: tosca.relationships.BelongsToOne
+{{- end }}
 
     # Port connected to the BNG
     port#bng_port:
diff --git a/xos-profiles/ponsim-pod/tosca/040-subscriber.yaml b/xos-profiles/ponsim-pod/tosca/040-subscriber.yaml
index c806d2c..1263bd3 100644
--- a/xos-profiles/ponsim-pod/tosca/040-subscriber.yaml
+++ b/xos-profiles/ponsim-pod/tosca/040-subscriber.yaml
@@ -38,16 +38,22 @@
          name: Bronze
 {{- end }}
 
-    # Pre-provision the subscriber the subscriber
-    my_house:
+    # Pre-provision the subscribers
+{{- range $i, $junk := until (.Values.numOlts|int) }}
+
+    house_{{ $i }}:
       type: tosca.nodes.RCORDSubscriber
       properties:
-        name: QQClient
+        name: QQClient{{ $i }}
         status: pre-provisioned
         c_tag: 111
-        s_tag: 222
+        s_tag: {{ add 222 $i }}
+  {{- if $.Values.legacyPonsim }}
         onu_device: PSMO12345678
-{{- if .Values.bandwidthProfiles }}
+  {{- else }}
+        onu_device: PSMO{{ printf "%04d" $i }}0000
+  {{- end }}
+  {{- if $.Values.bandwidthProfiles }}
       requirements:
         - upstream_bps:
             node: bronze_bp
@@ -55,4 +61,5 @@
         - downstream_bps:
             node: bronze_bp
             relationship: tosca.relationships.BelongsToOne
+  {{- end }}
 {{- end }}
\ No newline at end of file
diff --git a/xos-profiles/ponsim-pod/tosca/att-workflow/010-att-workflow.yaml b/xos-profiles/ponsim-pod/tosca/att-workflow/010-att-workflow.yaml
index 1af0eb2..419a51e 100644
--- a/xos-profiles/ponsim-pod/tosca/att-workflow/010-att-workflow.yaml
+++ b/xos-profiles/ponsim-pod/tosca/att-workflow/010-att-workflow.yaml
@@ -31,13 +31,21 @@
         name: att-workflow-driver
         must-exist: true
 
-    whitelist:
+{{- range $i, $junk := until (.Values.numOlts|int) }}
+
+    whitelist{{ $i }}:
       type: tosca.nodes.AttWorkflowDriverWhiteListEntry
       properties:
+{{- if $.Values.legacyPonsim }}
         serial_number: PSMO12345678
         device_id: of:0000aabbccddeeff
+{{- else }}
+        serial_number: PSMO{{ printf "%04d" $i }}0000
+        device_id: {{ index $.Values.oltDpids $i }}
+{{- end }}
         pon_port_id: 1
       requirements:
         - owner:
             node: service#att
             relationship: tosca.relationships.BelongsToOne
+{{- end }}
\ No newline at end of file
diff --git a/xos-profiles/ponsim-pod/values.yaml b/xos-profiles/ponsim-pod/values.yaml
index 7166ee4..bea12fb 100644
--- a/xos-profiles/ponsim-pod/values.yaml
+++ b/xos-profiles/ponsim-pod/values.yaml
@@ -22,10 +22,11 @@
 nameOverride: ""
 fullnameOverride: ""
 
-image:
-  repository: 'xosproject/tosca-loader'
-  tag: '{{ .Chart.AppVersion }}'
-  pullPolicy: 'Always'
+images:
+  tosca_loader:
+    repository: 'xosproject/tosca-loader'
+    tag: '{{ .Chart.AppVersion }}'
+    pullPolicy: 'Always'
 
 global:
   registry: ''
@@ -37,3 +38,20 @@
 workflow: att-workflow
 
 bandwidthProfiles: False
+
+# numOlts > 1 only works with voltha-1.7 or greater
+numOlts: 1
+
+# legacyPonsim == true means that we are using voltha-1.6
+legacyPonsim: true
+
+# For legaacyPonsim == false:
+# List of olt dpids that are generated by Ponsim adapter
+# Entry N is generated for oltN.voltha.svc
+# Generate the last 12 characters as follows:
+# $ echo -ne olt0.voltha.svc:50060 | md5sum | cut -c -12
+oltDpids:
+  - of:0000d0d3e158fede
+  - of:00000da7f2c143c7
+  - of:000032be2d4c2abc
+  - of:0000ae9b8dcd58c7
diff --git a/xos-profiles/seba-services/Chart.yaml b/xos-profiles/seba-services/Chart.yaml
index ff24cfa..299ea43 100644
--- a/xos-profiles/seba-services/Chart.yaml
+++ b/xos-profiles/seba-services/Chart.yaml
@@ -17,7 +17,7 @@
 name: seba-services
 description: A Helm chart for XOS's "SEBA" profile
 icon: https://guide.opencord.org/logos/cord.svg
-version: 1.2.3
+version: 1.2.4
 
 # xosproject/tosca-loader version
-appVersion: 1.3.0
+appVersion: 1.3.1