Index: /branches/rel_apv_10_7_0_21_pre_sight/usr/click/bin/backend/sys_cmd.c
===================================================================
--- /branches/rel_apv_10_7_0_21_pre_sight/usr/click/bin/backend/sys_cmd.c	(revision 38531)
+++ /branches/rel_apv_10_7_0_21_pre_sight/usr/click/bin/backend/sys_cmd.c	(working copy)
@@ -3548,19 +3548,27 @@
 	char path[1035];
 	char cmd[1024];
 
-	snprintf(cmd, 1024, "python3 /ca/bin/azure/ConfigManager.py -mode set -sub_id %s -res_grp_name %s -src_nic_name %s -dest_nic_name %s", 
-			subscription_id, resource_group_name, from_nic_name, to_nic_name);
-	// system(cmd);
-
+	snprintf(cmd, 1024, "ps aux | grep -v grep | grep 'python3 /ca/bin/azure/AZFailoverPoller.py -mode 1' | wc -l");
 	fp = popen(cmd, "r");
-	if (fp == NULL) {
-        printf("Failed to run command\n" );
-        exit(1);
-    }
-    while (fgets(path, sizeof(path)-1, fp) != NULL) {
-        printf("%s", path);
-    }
-    pclose(fp);
+	if (fp != NULL) {
+		fgets(path, sizeof(path)-1, fp);
+		if (path[0] == '0') {
+			snprintf(cmd, 1024, "python3 /ca/bin/azure/ConfigManager.py -mode set -sub_id %s -res_grp_name %s -src_nic_name %s -dest_nic_name %s", 
+				subscription_id, resource_group_name, from_nic_name, to_nic_name);
+			
+			fp = popen(cmd, "r");
+			if (fp == NULL) {
+				printf("Failed to run command\n" );
+				exit(1);
+			}
+			while (fgets(path, sizeof(path)-1, fp) != NULL) {
+				printf("%s", path);
+			}
+			pclose(fp);
+		} else {
+			printf("Please execute \"cloud az ha disable\" first.");
+		}
+	}
 }
 
 void 
@@ -3570,56 +3578,67 @@
 	char path[1035];
 	char cmd[1024];
 
-	snprintf(cmd, 1024, "python3 /ca/bin/azure/RouteConfigManager.py -mode set -sub_id %s -res_grp_name %s -vm_name %s -ip_running %s -ip_deallocating %s", 
-			subscription_id, resource_group_name, vm_name, ip_running, ip_deallocating);
-	// system(cmd);
-
+	snprintf(cmd, 1024, "ps aux | grep -v grep | grep 'python3 /ca/bin/azure/UDRPoller.py -mode 1' | wc -l");
 	fp = popen(cmd, "r");
-	if (fp == NULL) {
-        printf("Failed to run command\n" );
-        exit(1);
-    }
-    while (fgets(path, sizeof(path)-1, fp) != NULL) {
-        printf("%s", path);
-    }
-    pclose(fp);
+	if (fp != NULL) {
+		fgets(path, sizeof(path)-1, fp);
+		if (path[0] == '0') {
+			snprintf(cmd, 1024, "python3 /ca/bin/azure/RouteConfigManager.py -mode set -sub_id %s -res_grp_name %s -vm_name %s -ip_running %s -ip_deallocating %s", 
+				subscription_id, resource_group_name, vm_name, ip_running, ip_deallocating);
+			
+			fp = popen(cmd, "r");
+			if (fp == NULL) {
+				printf("Failed to run command\n" );
+				exit(1);
+			}
+			while (fgets(path, sizeof(path)-1, fp) != NULL) {
+				printf("%s", path);
+			}
+			pclose(fp);
+		} else {
+			printf("Please execute \"cloud az udr disable\" first.");
+		}
+	}
 }
 
 void 
-cloud_az_clear_nicconfig() 
+cloud_az_clear_nicconfig(uint32_t idx) 
 {
 	FILE *fp;
 	char path[1035];
 	char cmd[1024];
 
-	// snprintf(cmd, 1024, "python3 /ca/bin/azure/ConfigManager.py -mode clear");
-	// system(cmd);
-
-//
-	fp = popen("python3 /ca/bin/azure/ConfigManager.py -mode clear", "r");
-	if (fp == NULL) {
-        printf("Failed to run command\n" );
-        exit(1);
-    }
-    while (fgets(path, sizeof(path)-1, fp) != NULL) {
-        printf("%s", path);
-    }
-    pclose(fp);
-//
+	snprintf(cmd, 1024, "ps aux | grep -v grep | grep 'python3 /ca/bin/azure/AZFailoverPoller.py -mode 1' | wc -l");
+	fp = popen(cmd, "r");
+	if (fp != NULL) {
+		fgets(path, sizeof(path)-1, fp);
+		if (path[0] == '0') {
+			snprintf(cmd, 1024, "python3 /ca/bin/azure/ConfigManager.py -mode clear -index %d", idx);
+			
+			fp = popen(cmd, "r");
+			if (fp == NULL) {
+				printf("Failed to run command\n" );
+				exit(1);
+			}
+			while (fgets(path, sizeof(path)-1, fp) != NULL) {
+				printf("%s", path);
+			}
+			pclose(fp);
+		} else {
+			printf("Please execute \"cloud az ha disable\" first.");
+		}
+	}
 }
 
 void 
-cloud_az_show_nicconfig() 
+cloud_az_show_nicconfig(uint32_t idx) 
 {
 	FILE *fp;
 	char path[1035];
 	char cmd[1024];
 
-	// snprintf(cmd, 1024, "python3 /ca/bin/azure/ConfigManager.py -mode show");
-	// system(cmd);
-
-//
-	fp = popen("python3 /ca/bin/azure/ConfigManager.py -mode show", "r");
+	snprintf(cmd, 1024, "python3 /ca/bin/azure/ConfigManager.py -mode show -index %d", idx);
+	fp = popen(cmd, "r");
 	if (fp == NULL) {
         printf("Failed to run command\n" );
         exit(1);
@@ -3628,44 +3647,46 @@
         printf("%s", path);
     }
     pclose(fp);
-//
 }
 
 void 
-cloud_az_clear_udrconfig() 
+cloud_az_clear_udrconfig(uint32_t idx) 
 {
 	FILE *fp;
 	char path[1035];
 	char cmd[1024];
 
-	// snprintf(cmd, 1024, "python3 /ca/bin/azure/ConfigManager.py -mode clear");
-	// system(cmd);
-
-//
-	fp = popen("python3 /ca/bin/azure/RouteConfigManager.py -mode clear", "r");
-	if (fp == NULL) {
-        printf("Failed to run command\n" );
-        exit(1);
-    }
-    while (fgets(path, sizeof(path)-1, fp) != NULL) {
-        printf("%s", path);
-    }
-    pclose(fp);
-//
+	snprintf(cmd, 1024, "ps aux | grep -v grep | grep 'python3 /ca/bin/azure/UDRPoller.py -mode 1' | wc -l");
+	fp = popen(cmd, "r");
+	if (fp != NULL) {
+		fgets(path, sizeof(path)-1, fp);
+		if (path[0] == '0') {
+			snprintf(cmd, 1024, "python3 /ca/bin/azure/RouteConfigManager.py -mode clear -index %d", idx);
+			
+			fp = popen(cmd, "r");
+			if (fp == NULL) {
+				printf("Failed to run command\n" );
+				exit(1);
+			}
+			while (fgets(path, sizeof(path)-1, fp) != NULL) {
+				printf("%s", path);
+			}
+			pclose(fp);
+		} else {
+			printf("Please execute \"cloud az udr disable\" first.");
+		}
+	}
 }
 
 void 
-cloud_az_show_udrconfig() 
+cloud_az_show_udrconfig(uint32_t idx) 
 {
 	FILE *fp;
 	char path[1035];
 	char cmd[1024];
 
-	// snprintf(cmd, 1024, "python3 /ca/bin/azure/ConfigManager.py -mode show");
-	// system(cmd);
-
-//
-	fp = popen("python3 /ca/bin/azure/RouteConfigManager.py -mode show", "r");
+	snprintf(cmd, 1024, "python3 /ca/bin/azure/RouteConfigManager.py -mode show -index %d", idx);
+	fp = popen(cmd, "r");
 	if (fp == NULL) {
         printf("Failed to run command\n" );
         exit(1);
@@ -3674,7 +3695,6 @@
         printf("%s", path);
     }
     pclose(fp);
-//
 }
 
 // AZURE CLOUD FUNCTION END
Index: /branches/rel_apv_10_7_0_21_pre_sight/usr/click/lib/libparser/commands.pm
===================================================================
--- /branches/rel_apv_10_7_0_21_pre_sight/usr/click/lib/libparser/commands.pm	(revision 38531)
+++ /branches/rel_apv_10_7_0_21_pre_sight/usr/click/lib/libparser/commands.pm	(working copy)
@@ -348,7 +348,14 @@
 		user_level => "CLI_LEVEL_CONFIG",
 		help_string => "Clear the configuration of NIC",
 		function_name => "cloud_az_clear_nicconfig",
-		function_args => [],
+		function_args => [
+			{
+				type => "U32",
+				help_string => "Index of the NIC configuration to delete (default: 0, to delete all)",
+				optional => "YES",
+				default_value => "0",
+			}
+		],
 	},
 
 	# cloud az show nicconfig
@@ -361,7 +368,14 @@
 		user_level => "CLI_LEVEL_CONFIG",
 		help_string => "Show the configuration of NIC",
 		function_name => "cloud_az_show_nicconfig",
-		function_args => [],
+		function_args => [
+			{
+				type => "U32",
+				help_string => "Index of the NIC configuration to display (default: 0, to display all)",
+				optional => "YES",
+				default_value => "0",
+			}
+		],
 	},
 
 	# # cloud az show ha_enable
@@ -387,7 +401,14 @@
 		user_level => "CLI_LEVEL_CONFIG",
 		help_string => "Clear the configuration of UDR",
 		function_name => "cloud_az_clear_udrconfig",
-		function_args => [],
+		function_args => [
+			{
+				type => "U32",
+				help_string => "Index of the UDR configuration to delete (default: 0, to delete all)",
+				optional => "YES",
+				default_value => "0",
+			}
+		],
 	},
 
 	# cloud az show udrconfig
@@ -400,7 +421,14 @@
 		user_level => "CLI_LEVEL_CONFIG",
 		help_string => "Show the configuration of UDR",
 		function_name => "cloud_az_show_udrconfig",
-		function_args => [],
+		function_args => [
+			{
+				type => "U32",
+				help_string => "Index of the UDR configuration to display (default: 0, to display all)",
+				optional => "YES",
+				default_value => "0",
+			}
+		],
 	},
 
 	# # cloud az show udr_enable
Index: /branches/rel_apv_10_7_0_21_pre_sight/usr/click/tools/azure/AZFailoverManager.py
===================================================================
--- /branches/rel_apv_10_7_0_21_pre_sight/usr/click/tools/azure/AZFailoverManager.py	(revision 38531)
+++ /branches/rel_apv_10_7_0_21_pre_sight/usr/click/tools/azure/AZFailoverManager.py	(working copy)
@@ -37,14 +37,19 @@
     config_dir = '/ca/conf/'
     ip_config_setting_file_name = 'ip_config_setting.json'
     setting_file_location = os.path.join(config_dir, ip_config_setting_file_name)
-    with open(setting_file_location, 'r') as file:
-        ip_config_setting = json.load(file)
-    az_failover_manager = AZFailoverManager(ip_config_setting)
-    if args.mode=='1':
-        # print("mode 1")
-        az_failover_manager.failover_happen()
-    elif  args.mode=='2':
-        # print("mode 2")
-        az_failover_manager.failover_recover()
+
+    if args.mode=='1' or args.mode=='2':
+        ip_config_manager = IPConfigManager(setting_file_location)
+        ip_config_setting_json = ip_config_manager.get_ip_config()
+        for i in ip_config_setting_json:
+            data = ip_config_setting_json[i]
+            az_failover_manager = AZFailoverManager(data)
+
+            if args.mode=='1':
+                # print("mode 1")
+                az_failover_manager.failover_happen()
+            elif  args.mode=='2':
+                # print("mode 2")
+                az_failover_manager.failover_recover()
     else:
         print(f"Error: mode must arugment must be 1 or 2. mode:[{args.mode}]")
\ No newline at end of file
Index: /branches/rel_apv_10_7_0_21_pre_sight/usr/click/tools/azure/AZFailoverPoller.py
===================================================================
--- /branches/rel_apv_10_7_0_21_pre_sight/usr/click/tools/azure/AZFailoverPoller.py	(revision 38531)
+++ /branches/rel_apv_10_7_0_21_pre_sight/usr/click/tools/azure/AZFailoverPoller.py	(working copy)
@@ -8,11 +8,13 @@
 import os
 from apv_controller.APVController import APVController
 from AZFailoverManager import AZFailoverManager
+from ConfigManager import IPConfigManager
+
 # todo put it in APV enviroment, parse heartbeat
 class AZFailoverPoller():
     def __init__(self) -> None:
         pass
-    def start(self, setting_file_location):
+    def start(self, ip_config_setting_json):
         
         in_failover = False
         polling_period = 2 #seconds
@@ -34,8 +36,11 @@
                     # failover happen
                     current_time = datetime.now().strftime("%Y-%m-%d %H %M %S")
                     print(f"Failover happen on {current_time}")
-                    az_failover_manager = AZFailoverManager(setting_file_location)
-                    az_failover_manager.failover_happen()
+                    for idx in ip_config_setting_json:
+                        data = ip_config_setting_json[idx]
+                        az_failover_manager = AZFailoverManager(data)
+                        az_failover_manager.failover_happen()
+                    
                     #todo need to verify that all setting are set, and then set is_failover=True
                     print("Succeessfully handle failover transition")
 
@@ -46,8 +51,10 @@
                 # failover happended before and now the primary APV is ON
                 current_time = datetime.now().strftime("%Y-%m-%d %H %M %S")
                 print(f"Failover recover on {current_time}")
-                az_failover_manager = AZFailoverManager(setting_file_location)
-                az_failover_manager.failover_recover()
+                for idx in ip_config_setting_json:
+                    data = ip_config_setting_json[idx]
+                    az_failover_manager = AZFailoverManager(data)
+                    az_failover_manager.failover_recover()
 
                 # reset
                 in_failover = False
@@ -84,9 +91,8 @@
     config_dir = '/ca/conf/'
     ip_config_setting_file_name = 'ip_config_setting.json'
     setting_file_location = os.path.join(config_dir, ip_config_setting_file_name)
-    with open(setting_file_location, 'r') as f:
-        data = f.read()
-    ip_config_setting_json = json.loads(data)
+    ip_config_manager = IPConfigManager(setting_file_location)
+    ip_config_setting_json = ip_config_manager.get_ip_config()
 
     if args.mode=='1':
         print("mode 1")    
Index: /branches/rel_apv_10_7_0_21_pre_sight/usr/click/tools/azure/ConfigManager.py
===================================================================
--- /branches/rel_apv_10_7_0_21_pre_sight/usr/click/tools/azure/ConfigManager.py	(revision 38531)
+++ /branches/rel_apv_10_7_0_21_pre_sight/usr/click/tools/azure/ConfigManager.py	(working copy)
@@ -6,23 +6,65 @@
     '''set needed configuration for transferring routing table and network interface'''
     def __init__(self, ip_config_file_path) -> None:
         self.ip_config_file_path = ip_config_file_path
-    def show_ip_config(self):
-        try:
+    
+    def save_ip_config(self, ip_config_setting_json):
+        ip_config_setting_json = dict(sorted(ip_config_setting_json.items()))
+
+        with open(self.ip_config_file_path, 'w') as json_file:
+            json.dump(ip_config_setting_json, json_file, indent=4)
+
+    def get_ip_config(self):
+        ip_config_setting_json = {}
+        if os.path.exists(self.ip_config_file_path):
             with open(self.ip_config_file_path, 'r') as f:
                 data = f.read()
-            ip_config_setting_json = json.loads(data)
+            
+            try:
+                ip_config_setting_json = json.loads(data)
+            except Exception:
+                print(f"load data to json error.")
+            
+        return ip_config_setting_json
+
+    def print_ip_config(self, idx, single_data):
+        print(f"{idx}:")
+        print(f"    Subscription ID:     {single_data['subscription_id']}")
+        print(f"    Resource group name: {single_data['resource_group_name']}")
+        print(f"    Primary NIC name:    {single_data['from_nic_name']}")
+        # print(f"The name of ip configuration: {single_data['from_ip_config_name']}")
+        print(f"    Secondary NIC name:  {single_data['to_nic_name']}")
 
-            print(f"Subscription ID: {ip_config_setting_json['subscription_id']}")
-            print(f"Resource group name: {ip_config_setting_json['resource_group_name']}")
-            print(f"Primary NIC name: {ip_config_setting_json['from_nic_name']}")
-            # print(f"The name of ip configuration: {ip_config_setting_json['from_ip_config_name']}")
-            print(f"Secondary NIC name: {ip_config_setting_json['to_nic_name']}")
+    def show_ip_config(self, idx=0):
+        ip_config_setting_json = self.get_ip_config()
+        try:
+            if idx == 0:
+                for idx in ip_config_setting_json:
+                    data = ip_config_setting_json[idx]
+                    self.print_ip_config(idx, data)
+            else:
+                if f"{idx}" in ip_config_setting_json:
+                    data = ip_config_setting_json[f"{idx}"]
+                    self.print_ip_config(idx, data)
         except Exception:
             print("Error: No ip configuration found. Set it before examine it.")
-    def clear_ip_config(self):
+
+    def clear_ip_config(self, idx=0):
         if os.path.exists(self.ip_config_file_path):
-            os.remove(self.ip_config_file_path)
-            print('clear ip configuration')
+            if idx == 0:
+                os.remove(self.ip_config_file_path)
+                print('clear all ip configuration')
+            else:
+                ip_config_setting_json = self.get_ip_config()
+                if f"{idx}" in ip_config_setting_json:
+                    del ip_config_setting_json[f"{idx}"]
+                    print(f'clear {idx} ip configuration')
+
+                if len(ip_config_setting_json) == 0:
+                    os.remove(self.ip_config_file_path)
+                    print('clear all ip configuration')
+                else:
+                    self.save_ip_config(ip_config_setting_json)
+
 
     def set_ip_config(self, subscription_id, resource_group_name, from_nic_name, to_nic_name):
         # subscription_id = input("Enter subscription ID: ")
@@ -38,9 +80,15 @@
             "to_nic_name": to_nic_name,
             # "to_ip_config_name": from_ip_config_name,
         }
+
+        ip_config_setting_json = self.get_ip_config()
+        for idx in range(1, 200+1):
+            if not f"{idx}" in ip_config_setting_json:
+                ip_config_setting_json[f"{idx}"] = data
+                break
+
         # Write the dictionary of setting to a JSON file
-        with open(self.ip_config_file_path, 'w') as json_file:
-            json.dump(data, json_file, indent=4)
+        self.save_ip_config(ip_config_setting_json)
 
 if __name__=="__main__":
     parser = argparse.ArgumentParser(description='Process optional name argument.')
@@ -51,6 +99,7 @@
     parser.add_argument('-src_nic_name', type=str, help='NIC name of the primary machine')
     # parser.add_argument('-src_ip_cfg_name', type=str, help='name of ip configuration need to be switch while failover happen')
     parser.add_argument('-dest_nic_name', type=str, help='NIC name of the secondary machine')
+    parser.add_argument('-index', type=int, help='Show or clear the index config')
 
     args = parser.parse_args()
 
@@ -65,9 +114,9 @@
     if args.mode=='set':
         ip_config_manager.set_ip_config(args.sub_id, args.res_grp_name, args.src_nic_name, args.dest_nic_name)
     elif  args.mode=='show':
-        ip_config_manager.show_ip_config()
+        ip_config_manager.show_ip_config(args.index)
     elif  args.mode=='clear':
-        ip_config_manager.clear_ip_config()
+        ip_config_manager.clear_ip_config(args.index)
 
     else:
         print(f"Error: mode must arugment must be set, show, and clear. mode:[{args.mode}]")
Index: /branches/rel_apv_10_7_0_21_pre_sight/usr/click/tools/azure/RouteConfigManager.py
===================================================================
--- /branches/rel_apv_10_7_0_21_pre_sight/usr/click/tools/azure/RouteConfigManager.py	(revision 38531)
+++ /branches/rel_apv_10_7_0_21_pre_sight/usr/click/tools/azure/RouteConfigManager.py	(working copy)
@@ -7,23 +7,64 @@
     '''set needed configuration for transferring routing table and network interface'''
     def __init__(self, ip_config_file_path) -> None:
         self.ip_config_file_path = ip_config_file_path
-    def show_UDR_config(self):
-        try:
+
+    def save_UDR_config(self, ip_config_setting_json):
+        ip_config_setting_json = dict(sorted(ip_config_setting_json.items()))
+
+        with open(self.ip_config_file_path, 'w') as json_file:
+            json.dump(ip_config_setting_json, json_file, indent=4)
+
+    def get_UDR_config(self):
+        ip_config_setting_json = {}
+        if os.path.exists(self.ip_config_file_path):
             with open(self.ip_config_file_path, 'r') as f:
                 data = f.read()
-            ip_config_setting_json = json.loads(data)
+            
+            try:
+                ip_config_setting_json = json.loads(data)
+            except Exception:
+                print(f"load data to json error.")
+            
+        return ip_config_setting_json
+
+    def print_UDR_config(self, idx, single_data):
+        print(f"{idx}:")
+        print(f"    Subscription ID:     {single_data['subscription_id']}")
+        print(f"    Resource group name: {single_data['resource_group_name']}")
+        print(f"    Monitored_vm_name:   {single_data['monitored_vm_name']}")
+        print(f"    The required ip while monitored vm is up:   {single_data['target_ip_when_running']}")
+        print(f"    The required ip while monitored vm is down: {single_data['target_ip_when_deallocated']}")
 
-            print(f"Subscription ID: {ip_config_setting_json['subscription_id']}")
-            print(f"Resource group name: {ip_config_setting_json['resource_group_name']}")
-            print(f"Monitored_vm_name: {ip_config_setting_json['monitored_vm_name']}")
-            print(f"The required ip while monitored vm is up: {ip_config_setting_json['target_ip_when_running']}")
-            print(f"The required ip while monitored vm is down: {ip_config_setting_json['target_ip_when_deallocated']}")
+    def show_UDR_config(self, idx=0):
+        ip_config_setting_json = self.get_UDR_config()
+        try:
+            if idx == 0:
+                for idx in ip_config_setting_json:
+                    data = ip_config_setting_json[idx]
+                    self.print_UDR_config(idx, data)
+            else:
+                if f"{idx}" in ip_config_setting_json:
+                    data = ip_config_setting_json[f"{idx}"]
+                    self.print_UDR_config(idx, data)
         except Exception:
             print("Error: No ip configuration found. Set it before examine it.")
-    def clear_UDR_config(self):
+
+    def clear_UDR_config(self, idx=0):
         if os.path.exists(self.ip_config_file_path):
-            os.remove(self.ip_config_file_path)
-            print('clear ip configuration')
+            if idx == 0:
+                os.remove(self.ip_config_file_path)
+                print('clear all ip configuration')
+            else:
+                ip_config_setting_json = self.get_UDR_config()
+                if f"{idx}" in ip_config_setting_json:
+                    del ip_config_setting_json[f"{idx}"]
+                    print(f'clear {idx} ip configuration')
+
+                if len(ip_config_setting_json) == 0:
+                    os.remove(self.ip_config_file_path)
+                    print('clear all ip configuration')
+                else:
+                    self.save_UDR_config(ip_config_setting_json)
 
     def set_UDR_config(self, subscription_id, resource_group_name, monitored_vm_name, target_ip_when_running, target_ip_when_deallocated):
         # subscription_id = input("Enter subscription ID: ")
@@ -38,9 +79,15 @@
             "target_ip_when_running": target_ip_when_running,
             "target_ip_when_deallocated": target_ip_when_deallocated,
         }
+
+        ip_config_setting_json = self.get_UDR_config()
+        for idx in range(1, 200+1):
+            if not f"{idx}" in ip_config_setting_json:
+                ip_config_setting_json[f"{idx}"] = data
+                break
+
         # Write the dictionary of setting to a JSON file
-        with open(self.ip_config_file_path, 'w') as json_file:
-            json.dump(data, json_file, indent=4)
+        self.save_UDR_config(ip_config_setting_json)
 
     def is_valid_ipv4_address(self, address):
         try:
@@ -58,6 +105,7 @@
     parser.add_argument('-vm_name', type=str, help='the name of vm will be monitored')
     parser.add_argument('-ip_running', type=str, help='the ip of set on UDR while monitored vm is up')
     parser.add_argument('-ip_deallocating', type=str, help='the ip of set on UDR while monitored vm is down')
+    parser.add_argument('-index', type=int, help='Show or clear the index config')
 
     args = parser.parse_args()
 
@@ -83,9 +131,9 @@
         else:
             print("IP4 format is not correct.")
     elif  args.mode=='show':
-        route_config_manager.show_UDR_config()
+        route_config_manager.show_UDR_config(args.index)
     elif  args.mode=='clear':
-        route_config_manager.clear_UDR_config()
+        route_config_manager.clear_UDR_config(args.index)
 
     else:
         print(f"Error: mode must arugment must be set, show, and clear. mode:[{args.mode}]")
Index: /branches/rel_apv_10_7_0_21_pre_sight/usr/click/tools/azure/UDRPoller.py
===================================================================
--- /branches/rel_apv_10_7_0_21_pre_sight/usr/click/tools/azure/UDRPoller.py	(revision 38531)
+++ /branches/rel_apv_10_7_0_21_pre_sight/usr/click/tools/azure/UDRPoller.py	(working copy)
@@ -6,52 +6,78 @@
 from az_vm.VMController import VMController
 from az_route_table.RouteTableController import RouteTableController
 
+from RouteConfigManager import RouteConfigManager
 
 class UDRPoller():
     def __init__(self, rout_table_config_setting_json) -> None:
         self.rout_table_config_setting_json = rout_table_config_setting_json
     def start(self):
         polling_period = 2 #seconds
-        vm_controller = VMController(
-            self.rout_table_config_setting_json['subscription_id'],
-            self.rout_table_config_setting_json['resource_group_name']
+
+        vm_controller_list = []
+        is_target_vm_down_list = []
+        route_table_update_count_list = []
+        route_table_controller_list = []
+        for idx in self.rout_table_config_setting_json:
+            data = self.rout_table_config_setting_json[idx]
+            
+            vm_controller = VMController(
+                data['subscription_id'],
+                data['resource_group_name']
+            )
+
+            route_table_controller = RouteTableController(
+                subscription_id=data['subscription_id'],
+                resource_group_name=data['resource_group_name']
             )
-        is_target_vm_down = False
 
-        route_table_update_count = 0
-        route_table_controller = RouteTableController(
-            subscription_id=self.rout_table_config_setting_json['subscription_id'],
-            resource_group_name=self.rout_table_config_setting_json['resource_group_name']
-        )
+            vm_controller_list.append(vm_controller)
+            is_target_vm_down_list.append(False)
+            route_table_update_count_list.append(0)
+            route_table_controller_list.append(route_table_controller)
+
         while True:
             time.sleep(polling_period)
-            print("polling...")
-            if not vm_controller.is_VM_alive_by_name(self.rout_table_config_setting_json["monitored_vm_name"]):
-                # target vm is down
-                print("detect target vm is down")
-                route_table_controller.change_all_UDR_routes_by_ip(
-                    ori_next_hop_ip=self.rout_table_config_setting_json["target_ip_when_running"],
-                    modify_next_hop_ip=self.rout_table_config_setting_json["target_ip_when_deallocated"],
-                )
-                # set vm status
-                is_target_vm_down=True
-            else:
-                # target vm is up
-                print("detect target vm is up")
-                route_table_controller.change_all_UDR_routes_by_ip(
-                    ori_next_hop_ip=self.rout_table_config_setting_json["target_ip_when_deallocated"],
-                    modify_next_hop_ip=self.rout_table_config_setting_json["target_ip_when_running"],
-                )
-                # set vm status
-                is_target_vm_down=False
-            
-            route_table_update_count += 1
-            if route_table_update_count >= 60 / polling_period:
-                route_table_controller = RouteTableController(
-                    subscription_id=self.rout_table_config_setting_json['subscription_id'],
-                    resource_group_name=self.rout_table_config_setting_json['resource_group_name']
-                )
-                route_table_update_count = 0
+
+            i = 0
+            for idx in self.rout_table_config_setting_json:
+                data = self.rout_table_config_setting_json[idx]
+
+                print("polling...")
+                if not vm_controller_list[i].is_VM_alive_by_name(data["monitored_vm_name"]):
+                    # target vm is down
+                    print("detect target vm is down")
+                    route_table_controller_list[i].change_all_UDR_routes_by_ip(
+                        ori_next_hop_ip=data["target_ip_when_running"],
+                        modify_next_hop_ip=data["target_ip_when_deallocated"],
+                    )
+                    # set vm status
+                    is_target_vm_down_list[i]=True
+                else:
+                    # target vm is up
+                    print("detect target vm is up")
+                    route_table_controller_list[i].change_all_UDR_routes_by_ip(
+                        ori_next_hop_ip=data["target_ip_when_deallocated"],
+                        modify_next_hop_ip=data["target_ip_when_running"],
+                    )
+                    # set vm status
+                    is_target_vm_down_list[i]=False
+                
+                route_table_update_count_list[i] += 1
+                if route_table_update_count_list[i] >= 60 / polling_period:
+                    vm_controller_list[i] = VMController(
+                        data['subscription_id'],
+                        data['resource_group_name']
+                    )
+
+                    route_table_controller_list[i] = RouteTableController(
+                        subscription_id=data['subscription_id'],
+                        resource_group_name=data['resource_group_name']
+                    )
+                    
+                    route_table_update_count_list[i] = 0
+
+                i += 1
                 
     def stop(self):
         '''kill poller that is another running process by its filename, a.k.a. this file name.'''
@@ -73,9 +99,8 @@
     config_dir = '/ca/conf/'
     route_table_config_setting_file_name = 'route_table_config_setting.json'
     setting_file_location = os.path.join(config_dir, route_table_config_setting_file_name)
-    with open(setting_file_location, 'r') as f:
-        data = f.read()
-    rout_table_config_setting_json = json.loads(data)
+    route_config_manager = RouteConfigManager(setting_file_location)
+    rout_table_config_setting_json = route_config_manager.get_UDR_config()
 
     udr_pooler = UDRPoller(rout_table_config_setting_json)
     if args.mode=='1':
