diff --git a/xos/synchronizer/steps/sync_vspgwctenant.py b/xos/synchronizer/steps/sync_vspgwctenant.py
index 3fecbf4..5fa2c08 100644
--- a/xos/synchronizer/steps/sync_vspgwctenant.py
+++ b/xos/synchronizer/steps/sync_vspgwctenant.py
@@ -35,27 +35,110 @@
     def __init__(self, *args, **kwargs):
         super(SyncVSPGWCTenant, self).__init__(*args, **kwargs)
 
-    # Gets the attributes that are used by the Ansible template but are not
-    # part of the set of default attribtues.
-    #def get_extra_attributes(self, o):
-    #    fields = {}
-    #    shared_net_id = Network.objects.get(name='shared_network').id
+    def get_extra_attributes(self, o):
+        if self.get_scenario() == 'manual':
+            return self.get_extra_attributes_for_manual()
 
-	#try:
-    #        fields['sgwc_shared_ip'] = Port.objects.get(network_id=shared_net_id, instance_id=o.instance_id).ip
-    #    except Exception:
-    #        print '{} does not have an instance'.format(o.name)
+        fields = {}
+        fields['scenario'] = self.get_scenario()
+        # for interface.cfg file
+        fields['zmq_sub_ip'] = self.get_ip_address('sbi_network', SDNControllerServiceInstance, 'zmq_sub_ip')
+        fields['zmq_pub_ip'] = self.get_ip_address('sbi_network', SDNControllerServiceInstance, 'zmq_pub_ip')
+        fields['dp_comm_ip'] = self.get_ip_address('sbi_network', VSPGWUTenant, 'dp_comm_ip')
+        fields['cp_comm_ip'] = self.get_ip_address('nbi_network', VSPGWCTenant, 'cp_comm_ip')
+        fields['fpc_ip'] = self.get_ip_address('nbi_network', SDNControllerServiceInstance, 'fpc_ip')
+        fields['cp_nb_server_ip'] = self.get_ip_address('nbi_network', VSPGWCTenant, 'cp_nb_server_ip')
 
-    #    try:
-    #        mme = TenantWithContainer.objects.get(provider_service_id=Service.objects.get(name='vmme').id, subscriber_tenant_id=o.subscriber_tenant_id)
-    #        fields['mme_shared_ip'] = Port.objects.get(network_id=shared_net_id, instance_id=mme.instance_id).ip
-	#except Exception:
-    #        print '{} does not have a VMME instance'.format(o.subscriber_tenant.name)
+        # for cp_config.cfg file
+        fields['s11_sgw_ip'] = self.get_ip_address('s11_network', VSPGWCTenant, 's11_sgw_ip')
+        fields['s1u_sgw_ip'] = self.get_ip_address('s1u_network', VSPGWUTenant, 's1u_sgw_ip')
 
-    #    try:
-    #        sgwu = TenantWithContainer.objects.get(provider_service_id=Service.objects.get(name='vspgwu').id, subscriber_tenant_id=o.subscriber_tenant_id)
-    #        fields['sgwu_shared_ip'] = Port.objects.get(network_id=shared_net_id, instance_id=sgwu.instance_id).ip
-    #    except Exception:
-    #        print '{} does not have a VSPGWU instance'.format(o.subscriber_tenant.name)
+        # the parameter 's11_mme_ip' depends on scenarios
+        if self.get_scenario() == 'ng4t':
+            fields['s11_mme_ip'] = self.get_ip_address('s11_network', VMMETenant, 's11_mme_ip')
+        elif self.get_scenario() == 'spirent':
+            fields['s11_mme_ip'] = self.get_ip_address('s11_network', VENBServiceInstance, 's11_mme_ip')
+        else:
+            fields['s11_mme_ip'] = "scenario_error"
 
-    #    return fields
+        return fields
+
+    # fields for manual case
+    def get_extra_attributes_for_manual(self):
+        fields = {}
+        fields['scenario'] = self.get_scenario()
+        # for interface.cfg file
+        fields['zmq_sub_ip'] = "manual"
+        fields['zmq_pub_ip'] = "manual"
+        fields['dp_comm_ip'] = "manual"
+        fields['cp_comm_ip'] = "manual"
+        fields['fpc_ip'] = "manual"
+        fields['cp_nb_server_ip'] = "manual"
+
+        # for cp_config.cfg file
+        fields['s11_sgw_ip'] = "manual"
+        fields['s11_mme_ip'] = "manual"
+        fields['s1u_sgw_ip'] = "manual"
+
+        return fields
+
+    def has_venb(self):
+        # try get vMME instance
+        try:
+            instance_id = self.get_instance_id(VENBServiceInstance)
+        except Exception:
+            print 'cannot get VENBServiceInstance'
+            return False
+
+        return True
+
+    def has_vmme(self):
+        # try get vMME instance
+        try:
+            instance_id = self.get_instance_id(VMMETenant)
+        except Exception:
+            print 'cannot get VMMETenant'
+            return False
+
+        return True
+
+
+    # Which scenario does it use among Spirent or NG4T?
+    def get_scenario(self):
+        # try get vENB instance: one of both Spirent and NG4T
+        venb_flag = self.has_venb()
+        vmme_flag = self.has_vmme()
+
+        if vmme_flag:
+            return 'ng4t'
+        else:
+            if venb_flag:
+                return 'spirent'
+            else:
+                return 'manual'
+
+    def get_ip_address(self, network_name, service_instance, parameter):
+
+        if self.get_scenario() == 'manual':
+            return "manual"
+
+        try:
+            net_id = self.get_network_id(network_name)
+            ins_id = self.get_instance_id(service_instance)
+            ip_address = Port.objects.get(network_id=net_id, instance_id=ins_id).ip
+
+        except Exception:
+            ip_address = "error"
+            print "get failed -- %s" % (parameter)
+
+        return ip_address
+
+    # To get each network id
+    def get_network_id(self, network_name):
+        return Network.objects.get(name=network_name).id
+
+    # To get service_instance (assumption: there is a single instance for each service)
+    def get_instance_id(self, serviceinstance):
+        instances = serviceinstance.objects.all()
+        instance_id = instances[0].instance_id
+        return instance_id
