Support multiple customer instantiation

Issue-ID: INT-509
Change-Id: I64a934b516f2290812f39c0df2a0d35027a5d553
Signed-off-by: Kang Xi <kang.xi@huawei.com>
diff --git a/test/vcpe/preload_templates/template.vcpe_brgemu_vfmodule.json b/test/vcpe/preload_templates/template.vcpe_brgemu_vfmodule.json
index 12303f4..9a9ecc3 100644
--- a/test/vcpe/preload_templates/template.vcpe_brgemu_vfmodule.json
+++ b/test/vcpe/preload_templates/template.vcpe_brgemu_vfmodule.json
@@ -1,145 +1,138 @@
 {
-   "VNF-API:input": {
-     "VNF-API:request-information": {
-       "VNF-API:request-id": "robot12",
-       "VNF-API:notification-url": "https://so.onap.org",
-       "VNF-API:order-number": "robot12",
-       "VNF-API:request-sub-action": "SUPP",
-       "VNF-API:request-action": "PreloadVNFRequest",
-       "VNF-API:source": "VID",
-       "VNF-API:order-version": "1.0"
-     },
-     "VNF-API:sdnc-request-header": {
-       "VNF-API:svc-action": "reserve",
-       "VNF-API:svc-notification-url": "https://son.onap.org",
-       "VNF-API:svc-request-id": "robot12"
-     },
-     "VNF-API:vnf-topology-information": {
-             "vnf-topology-identifier": {
-               "service-type": "${service_type}",
-               "vnf-type": "${vnf_type}",
-               "generic-vnf-name": "${generic_vnf_name}",
-               "generic-vnf-type": "${generic_vnf_type}",
-               "vnf-name": "${vnf_name}"
-       },
-       "VNF-API:vnf-parameters": [
-
-
-		{
-		"vnf-parameter-name": "vcpe_image_name",
-		"vnf-parameter-value": "vbrg-base-ubuntu-16-04-new"
-		},
-		{
-		"vnf-parameter-name": "vcpe_flavor_name",
-		"vnf-parameter-value": "m1.medium"
-		},
-
-		{
-		"vnf-parameter-name": "public_net_id",
-		"vnf-parameter-value": "${public_net_id}"
-		},
-		{
-		"vnf-parameter-name": "vbrgemu_bng_private_net_id",
-		"vnf-parameter-value": "${brg_bng_net}"
-		},
-		{
-		"vnf-parameter-name": "vbrgemu_bng_private_subnet_id",
-		"vnf-parameter-value": "${brg_bng_subnet}"
-		},
-		{
-		"vnf-parameter-name": "onap_private_net_id",
-		"vnf-parameter-value": "${oam_onap_net}"
-		},
-		{
-		"vnf-parameter-name": "onap_private_subnet_id",
-		"vnf-parameter-value": "${oam_onap_subnet}"
-		},
-		{
-		"vnf-parameter-name": "onap_private_net_cidr",
-		"vnf-parameter-value": "10.0.0.0/16"
-		},
-
-		{
-		"vnf-parameter-name": "compile_state",
-		"vnf-parameter-value": "done"
-		},
-		{
-		"vnf-parameter-name": "vbrgemu_bng_private_net_cidr",
-		"vnf-parameter-value": "10.3.0.0/24"
-		},
-		{
-		"vnf-parameter-name": "vbrgemu_private_ip_0",
-		"vnf-parameter-value": "10.3.0.14"
-		},
-		{
-		"vnf-parameter-name": "sdnc_ip",
-		"vnf-parameter-value": "10.0.7.1"
-		},
-		{
-		"vnf-parameter-name": "vbrgemu_name_0",
-		"vnf-parameter-value": "zdcpe1cpe01brgemu01_${suffix}"
-		},
-		{
-		"vnf-parameter-name": "vnf_id",
-		"vnf-parameter-value": "vCPE_Infrastructure_BGREMU_demo_app"
-		},
-		{
-		"vnf-parameter-name": "vf_module_id",
-		"vnf-parameter-value": "vCPE_Customer_BRGEMU"
-		},
-		{
-		"vnf-parameter-name": "repo_url_blob",
-		"vnf-parameter-value": "https://nexus.onap.org/content/sites/raw"
-		},
-		{
-		"vnf-parameter-name": "repo_url_artifacts",
-		"vnf-parameter-value": "https://nexus.onap.org/content/groups/staging"
-		},
-		{
-		"vnf-parameter-name": "demo_artifacts_version",
-		"vnf-parameter-value": "1.1.1"
-		},
-		{
-		"vnf-parameter-name": "install_script_version",
-		"vnf-parameter-value": "1.1.1"
-		},
-		{
-		"vnf-parameter-name": "key_name",
-		"vnf-parameter-value": "vbrgemu_key"
-		},
-		{
-		"vnf-parameter-name": "pub_key",
-		"vnf-parameter-value": "${pub_key}"
-		},
-		{
-		"vnf-parameter-name": "cloud_env",
-		"vnf-parameter-value": "openstack"
-		},
-		{
-		"vnf-parameter-name": "vpp_source_repo_url",
-		"vnf-parameter-value": "https://gerrit.fd.io/r/vpp"
-		},
-		{
-		"vnf-parameter-name": "vpp_source_repo_branch",
-		"vnf-parameter-value": "stable/1704"
-		},
-		{
-		"vnf-parameter-name": "hc2vpp_source_repo_url",
-		"vnf-parameter-value": "https://gerrit.fd.io/r/hc2vpp"
-		},
-		{
-		"vnf-parameter-name": "hc2vpp_source_repo_branch",
-		"vnf-parameter-value": "stable/1704"
-		},
-		{
-		"vnf-parameter-name": "vpp_patch_url",
-		"vnf-parameter-value": "https://git.onap.org/demo/plain/vnfs/vCPE/vpp-option-82-for-vbrg/src/patches/VPP-Add-Option82-Nat-Filter-For-vBRG.patch"
-		}
-
-       ],
-       "VNF-API:vnf-assignments": {
-         }
-       }
-     }
-}
-
+    "VNF-API:input": {
+        "VNF-API:request-information": {
+            "VNF-API:notification-url": "https://so.onap.org", 
+            "VNF-API:order-number": "robot12", 
+            "VNF-API:order-version": "1.0", 
+            "VNF-API:request-action": "PreloadVNFRequest", 
+            "VNF-API:request-id": "robot12", 
+            "VNF-API:request-sub-action": "SUPP", 
+            "VNF-API:source": "VID"
+        }, 
+        "VNF-API:sdnc-request-header": {
+            "VNF-API:svc-action": "reserve", 
+            "VNF-API:svc-notification-url": "https://son.onap.org", 
+            "VNF-API:svc-request-id": "robot12"
+        }, 
+        "VNF-API:vnf-topology-information": {
+            "VNF-API:vnf-assignments": {}, 
+            "VNF-API:vnf-parameters": [
+                {
+                    "vnf-parameter-name": "vcpe_image_name", 
+                    "vnf-parameter-value": "vbrg-base-ubuntu-16-04-new"
+                }, 
+                {
+                    "vnf-parameter-name": "vcpe_flavor_name", 
+                    "vnf-parameter-value": "m1.medium"
+                }, 
+                {
+                    "vnf-parameter-name": "public_net_id", 
+                    "vnf-parameter-value": "${public_net_id}"
+                }, 
+                {
+                    "vnf-parameter-name": "vbrgemu_bng_private_net_id", 
+                    "vnf-parameter-value": "${brg_bng_net}"
+                }, 
+                {
+                    "vnf-parameter-name": "vbrgemu_bng_private_subnet_id", 
+                    "vnf-parameter-value": "${brg_bng_subnet}"
+                }, 
+                {
+                    "vnf-parameter-name": "onap_private_net_id", 
+                    "vnf-parameter-value": "${oam_onap_net}"
+                }, 
+                {
+                    "vnf-parameter-name": "onap_private_subnet_id", 
+                    "vnf-parameter-value": "${oam_onap_subnet}"
+                }, 
+                {
+                    "vnf-parameter-name": "onap_private_net_cidr", 
+                    "vnf-parameter-value": "10.0.0.0/16"
+                }, 
+                {
+                    "vnf-parameter-name": "compile_state", 
+                    "vnf-parameter-value": "done"
+                }, 
+                {
+                    "vnf-parameter-name": "vbrgemu_bng_private_net_cidr", 
+                    "vnf-parameter-value": "10.3.0.0/24"
+                }, 
+                {
+                    "vnf-parameter-name": "vbrgemu_private_ip_0", 
+                    "vnf-parameter-value": "10.3.0.21"
+                }, 
+                {
+                    "vnf-parameter-name": "sdnc_ip", 
+                    "vnf-parameter-value": "10.0.7.1"
+                }, 
+                {
+                    "vnf-parameter-name": "vbrgemu_name_0", 
+                    "vnf-parameter-value": "zdcpe1cpe01brgemu01_${suffix}"
+                }, 
+                {
+                    "vnf-parameter-name": "vnf_id", 
+                    "vnf-parameter-value": "vCPE_Infrastructure_BGREMU_demo_app_${suffix}"
+                }, 
+                {
+                    "vnf-parameter-name": "vf_module_id", 
+                    "vnf-parameter-value": "vCPE_Customer_BRGEMU_${suffix}"
+                }, 
+                {
+                    "vnf-parameter-name": "repo_url_blob", 
+                    "vnf-parameter-value": "https://nexus.onap.org/content/sites/raw"
+                }, 
+                {
+                    "vnf-parameter-name": "repo_url_artifacts", 
+                    "vnf-parameter-value": "https://nexus.onap.org/content/groups/staging"
+                }, 
+                {
+                    "vnf-parameter-name": "demo_artifacts_version", 
+                    "vnf-parameter-value": "1.1.1"
+                }, 
+                {
+                    "vnf-parameter-name": "install_script_version", 
+                    "vnf-parameter-value": "1.1.1"
+                }, 
+                {
+                    "vnf-parameter-name": "key_name", 
+                    "vnf-parameter-value": "vbrgemu_key"
+                }, 
+                {
+                    "vnf-parameter-name": "pub_key", 
+                    "vnf-parameter-value": "${pub_key}"
+                }, 
+                {
+                    "vnf-parameter-name": "cloud_env", 
+                    "vnf-parameter-value": "openstack"
+                }, 
+                {
+                    "vnf-parameter-name": "vpp_source_repo_url", 
+                    "vnf-parameter-value": "https://gerrit.fd.io/r/vpp"
+                }, 
+                {
+                    "vnf-parameter-name": "vpp_source_repo_branch", 
+                    "vnf-parameter-value": "stable/1704"
+                }, 
+                {
+                    "vnf-parameter-name": "hc2vpp_source_repo_url", 
+                    "vnf-parameter-value": "https://gerrit.fd.io/r/hc2vpp"
+                }, 
+                {
+                    "vnf-parameter-name": "hc2vpp_source_repo_branch", 
+                    "vnf-parameter-value": "stable/1704"
+                }, 
+                {
+                    "vnf-parameter-name": "vpp_patch_url", 
+                    "vnf-parameter-value": "https://git.onap.org/demo/plain/vnfs/vCPE/vpp-option-82-for-vbrg/src/patches/VPP-Add-Option82-Nat-Filter-For-vBRG.patch"
+                }
+            ], 
+            "vnf-topology-identifier": {
+                "generic-vnf-name": "${generic_vnf_name}", 
+                "generic-vnf-type": "${generic_vnf_type}", 
+                "service-type": "${service_type}", 
+                "vnf-name": "${vnf_name}", 
+                "vnf-type": "${vnf_type}"
+            }
+        }
+    }
+}
\ No newline at end of file
diff --git a/test/vcpe/preload_templates/template.vcpe_vgw_vfmodule.json b/test/vcpe/preload_templates/template.vcpe_vgw_vfmodule.json
index 8b33482..d955a1d 100644
--- a/test/vcpe/preload_templates/template.vcpe_vgw_vfmodule.json
+++ b/test/vcpe/preload_templates/template.vcpe_vgw_vfmodule.json
@@ -1,121 +1,118 @@
 {
-   "VNF-API:input": {
-     "VNF-API:request-information": {
-       "VNF-API:request-id": "robot12",
-       "VNF-API:notification-url": "https://so.onap.org",
-       "VNF-API:order-number": "robot12",
-       "VNF-API:request-sub-action": "SUPP",
-       "VNF-API:request-action": "PreloadVNFRequest",
-       "VNF-API:source": "VID",
-       "VNF-API:order-version": "1.0"
-     },
-     "VNF-API:sdnc-request-header": {
-       "VNF-API:svc-action": "reserve",
-       "VNF-API:svc-notification-url": "https://son.onap.org",
-       "VNF-API:svc-request-id": "robot12"
-     },
-     "VNF-API:vnf-topology-information": {
-             "vnf-topology-identifier": {
-               "service-type": "VGW-SERVICE-TYPE",
-               "vnf-type": "VGW-VNF-TYPE",
-               "generic-vnf-name": "GENERIC-VGW-VNF-NAME0",
-               "generic-vnf-type": "GENERIC-VGW-VNF-TYPE",
-               "vnf-name": "VGW2BRG-${brg_mac}"
-       },
-       "VNF-API:vnf-parameters": [
-
-		{
-		"vnf-parameter-name": "public_net_id",
-		"vnf-parameter-value": "${public_net_id}"
-		},
-		{
-		"vnf-parameter-name": "mux_gw_private_net_id",
-		"vnf-parameter-value": "${mux_gw_net}"
-		},
-		{
-		"vnf-parameter-name": "mux_gw_private_subnet_id",
-		"vnf-parameter-value": "${mux_gw_subnet}"
-		},
-		{
-		"vnf-parameter-name": "mux_gw_private_net_cidr",
-		"vnf-parameter-value": "10.5.0.0/24"
-		},
-		{
-		"vnf-parameter-name": "cpe_public_net_id",
-		"vnf-parameter-value": "${cpe_public_net}"
-		},
-		{
-		"vnf-parameter-name": "cpe_public_subnet_id",
-		"vnf-parameter-value": "${cpe_public_subnet}"
-		},
-		{
-		"vnf-parameter-name": "cpe_public_net_cidr",
-		"vnf-parameter-value": "10.2.0.0/24"
-		},
-		{
-		"vnf-parameter-name": "vgw_private_ip_0",
-		"vnf-parameter-value": "10.5.0.22"
-		},
-		{
-		"vnf-parameter-name": "vgw_private_ip_1",
-		"vnf-parameter-value": "10.0.101.30"
-		},
-		{
-		"vnf-parameter-name": "vgw_name_0",
-		"vnf-parameter-value": "zdcpe1cpe01gw01_${suffix}"
-		},
-		{
-		"vnf-parameter-name": "mux_ip_addr",
-		"vnf-parameter-value": "10.5.0.21"
-		},
-		{
-		"vnf-parameter-name": "vg_vgmux_tunnel_vni",
-		"vnf-parameter-value": "100"
-		},
-		{
-		"vnf-parameter-name": "onap_private_net_id",
-		"vnf-parameter-value": "${oam_onap_net}"
-		},
-		{
-		"vnf-parameter-name": "onap_private_subnet_id",
-		"vnf-parameter-value": "${oam_onap_subnet}"
-		},
-		{
-		"vnf-parameter-name": "onap_private_net_cidr",
-		"vnf-parameter-value": "10.0.0.0/16"
-		},
-		{
-		"vnf-parameter-name": "repo_url_blob",
-		"vnf-parameter-value": "https://nexus.onap.org/content/sites/raw"
-		},
-		{
-		"vnf-parameter-name": "repo_url_artifacts",
-		"vnf-parameter-value": "https://nexus.onap.org/content/groups/staging"
-		},
-		{
-		"vnf-parameter-name": "demo_artifacts_version",
-		"vnf-parameter-value": "1.1.1"
-		},
-		{
-		"vnf-parameter-name": "install_script_version",
-		"vnf-parameter-value": "1.1.1"
-		},
-		{
-		"vnf-parameter-name": "key_name",
-		"vnf-parameter-value": "vgw_key"
-		},
-		{
-		"vnf-parameter-name": "pub_key",
-		"vnf-parameter-value": "${pub_key}"
-		},
-		{
-		"vnf-parameter-name": "cloud_env",
-		"vnf-parameter-value": "openstack"
-		}
-       ],
-       "VNF-API:vnf-assignments": {
-         }
-       }
-     }
-}
-
+    "VNF-API:input": {
+        "VNF-API:request-information": {
+            "VNF-API:notification-url": "https://so.onap.org", 
+            "VNF-API:order-number": "robot12", 
+            "VNF-API:order-version": "1.0", 
+            "VNF-API:request-action": "PreloadVNFRequest", 
+            "VNF-API:request-id": "robot12", 
+            "VNF-API:request-sub-action": "SUPP", 
+            "VNF-API:source": "VID"
+        }, 
+        "VNF-API:sdnc-request-header": {
+            "VNF-API:svc-action": "reserve", 
+            "VNF-API:svc-notification-url": "https://son.onap.org", 
+            "VNF-API:svc-request-id": "robot12"
+        }, 
+        "VNF-API:vnf-topology-information": {
+            "VNF-API:vnf-assignments": {}, 
+            "VNF-API:vnf-parameters": [
+                {
+                    "vnf-parameter-name": "public_net_id", 
+                    "vnf-parameter-value": "${public_net_id}"
+                }, 
+                {
+                    "vnf-parameter-name": "mux_gw_private_net_id", 
+                    "vnf-parameter-value": "${mux_gw_net}"
+                }, 
+                {
+                    "vnf-parameter-name": "mux_gw_private_subnet_id", 
+                    "vnf-parameter-value": "${mux_gw_subnet}"
+                }, 
+                {
+                    "vnf-parameter-name": "mux_gw_private_net_cidr", 
+                    "vnf-parameter-value": "10.5.0.0/24"
+                }, 
+                {
+                    "vnf-parameter-name": "cpe_public_net_id", 
+                    "vnf-parameter-value": "${cpe_public_net}"
+                }, 
+                {
+                    "vnf-parameter-name": "cpe_public_subnet_id", 
+                    "vnf-parameter-value": "${cpe_public_subnet}"
+                }, 
+                {
+                    "vnf-parameter-name": "cpe_public_net_cidr", 
+                    "vnf-parameter-value": "10.2.0.0/24"
+                }, 
+                {
+                    "vnf-parameter-name": "vgw_private_ip_0", 
+                    "vnf-parameter-value": "10.5.0.45"
+                }, 
+                {
+                    "vnf-parameter-name": "vgw_private_ip_1", 
+                    "vnf-parameter-value": "10.0.101.45"
+                }, 
+                {
+                    "vnf-parameter-name": "vgw_name_0", 
+                    "vnf-parameter-value": "zdcpe1cpe01gw01_${suffix}"
+                }, 
+                {
+                    "vnf-parameter-name": "mux_ip_addr", 
+                    "vnf-parameter-value": "10.5.0.21"
+                }, 
+                {
+                    "vnf-parameter-name": "vg_vgmux_tunnel_vni", 
+                    "vnf-parameter-value": "45"
+                }, 
+                {
+                    "vnf-parameter-name": "onap_private_net_id", 
+                    "vnf-parameter-value": "${oam_onap_net}"
+                }, 
+                {
+                    "vnf-parameter-name": "onap_private_subnet_id", 
+                    "vnf-parameter-value": "${oam_onap_subnet}"
+                }, 
+                {
+                    "vnf-parameter-name": "onap_private_net_cidr", 
+                    "vnf-parameter-value": "10.0.0.0/16"
+                }, 
+                {
+                    "vnf-parameter-name": "repo_url_blob", 
+                    "vnf-parameter-value": "https://nexus.onap.org/content/sites/raw"
+                }, 
+                {
+                    "vnf-parameter-name": "repo_url_artifacts", 
+                    "vnf-parameter-value": "https://nexus.onap.org/content/groups/staging"
+                }, 
+                {
+                    "vnf-parameter-name": "demo_artifacts_version", 
+                    "vnf-parameter-value": "1.1.1"
+                }, 
+                {
+                    "vnf-parameter-name": "install_script_version", 
+                    "vnf-parameter-value": "1.1.1"
+                }, 
+                {
+                    "vnf-parameter-name": "key_name", 
+                    "vnf-parameter-value": "vgw_key"
+                }, 
+                {
+                    "vnf-parameter-name": "pub_key", 
+                    "vnf-parameter-value": "${pub_key}"
+                }, 
+                {
+                    "vnf-parameter-name": "cloud_env", 
+                    "vnf-parameter-value": "openstack"
+                }
+            ], 
+            "vnf-topology-identifier": {
+                "generic-vnf-name": "GENERIC-VGW-VNF-NAME0", 
+                "generic-vnf-type": "GENERIC-VGW-VNF-TYPE", 
+                "service-type": "VGW-SERVICE-TYPE", 
+                "vnf-name": "VGW2BRG-${brg_mac}", 
+                "vnf-type": "VGW-VNF-TYPE"
+            }
+        }
+    }
+}
\ No newline at end of file
diff --git a/test/vcpe/preload_templates/template_sniro_data.json b/test/vcpe/preload_templates/template_sniro_data.json
index 6fa2003..92c9cc7 100644
--- a/test/vcpe/preload_templates/template_sniro_data.json
+++ b/test/vcpe/preload_templates/template_sniro_data.json
@@ -7,6 +7,7 @@
             "resourceModuleName" : "${tunnelxconn_ar_name}",
             "serviceInstanceId" : "${vgmux_svc_instance_uuid}",
             "serviceResourceId" : "TUNNEL-RESOURCE-ID-REPLACE",
+            "isRehome" : "False",
 			"assignmentInfo": [ { "variableName": "cloudOwner", "variableValue": "CloudOwner"}, {"variableName": "vnfHostName", "variableValue": "vnfHostName" }] 
          },
          {
@@ -15,6 +16,7 @@
             "resourceModuleName" : "${vgw_name}",
             "serviceInstanceId" : "vG-service-instance-id",
             "serviceResourceId" : "VGW-RESOURCE-ID-REPLACE",
+            "isRehome" : "False",
 			"assignmentInfo": [ { "variableName": "cloudOwner", "variableValue": "CloudOwner"}, {"variableName": "vnfHostName", "variableValue": "vnfHostName" }] 
          },
          {
@@ -23,6 +25,7 @@
             "resourceModuleName" : "${brg_ar_name}",
             "serviceInstanceId" : "${vbrg_svc_instance_uuid}",
             "serviceResourceId" : "BRG-RESOURCE-ID-REPLACE",
+            "isRehome" : "False",
 			"assignmentInfo": [ { "variableName": "cloudOwner", "variableValue": "CloudOwner"}, {"variableName": "vnfHostName", "variableValue": "vnfHostName" }] 
          }
       ]