diff --git a/tests/test_vm2vm.py b/tests/test_vm2vm.py
index 51dccdd..d6a4242 100644
--- a/tests/test_vm2vm.py
+++ b/tests/test_vm2vm.py
@@ -1,3 +1,4 @@
+from concurrent.futures import ThreadPoolExecutor
 import logging
 import sys
 import time
@@ -83,7 +84,7 @@
 
         # Associate FIPs and check VMs are Active
         logger.info("Creating Floating IPs and associating them...")
-        for i in range(4):
+        for i in range(len(vms)):
             fip = os_actions.create_floating_ip(os_resources['ext_net']['id'])
             fips.append(fip['id'])
             os_actions.check_vm_is_active(vms[i].id, timeout=timeout)
@@ -91,7 +92,8 @@
             private_address = vms[i].addresses[
                 list(vms[i].addresses.keys())[0]][0]['addr']
             vm_info.append({'vm': vms[i], 'fip': fip['floating_ip_address'],
-                            'private_address': private_address})
+                            'private_address': private_address,
+                            'private_key': private_key})
         # Set custom MTU if required
         if os_actions.is_cloud_tf() and (custom_mtu != "default"):
             logger.info("Setting up custom MTU at network ports...")
@@ -102,19 +104,17 @@
         # Check VMs are reachable and prepare iperf3
         transport1 = ssh.SSHTransport(vm_info[0]['fip'], 'ubuntu',
                                       password='dd', private_key=private_key)
-        logger.info("Checking VMs are reachable via SSH, getting MTU...")
-        mtus = []
-        for i in range(4):
-            if transport1.check_vm_is_reachable_ssh(
-                    floating_ip=vm_info[i]['fip'], timeout=ssh_timeout):
-                ssh.IperfAtVM(
-                    vm_info[i]['fip'], private_key=private_key)
-                mtus.append(transport1.get_mtu_from_vm(
-                    vm_info[i]['fip'], private_key=private_key))
+        logger.info("Checking VMs are reachable via SSH...")
+        for i in range(len(vms)):
+            transport1.check_vm_is_reachable_ssh(
+                floating_ip=vm_info[i]['fip'], timeout=ssh_timeout)
+        with ThreadPoolExecutor() as executor:
+            futures = [
+                executor.submit(ssh.install_iperf_at_vms_and_get_mtu, vm_info)
+                for vm_info in vm_info]
+            mtus = [future.result() for future in futures]
         logger.info("MTU at networks: {}, {}".format(
             os_resources['net1']['mtu'], os_resources['net2']['mtu']))
-        logger.info("MTU at VMs: {}".format(", ".join(mtus)))
-
         # Prepare the result table and run iperf3
         table_rows = [[
             'Test Case', 'Host 1', 'Host 2', 'MTU at VMs', 'Result'
diff --git a/tests/test_vm2vm_different_routers.py b/tests/test_vm2vm_different_routers.py
index 612e5be..8b38a4b 100644
--- a/tests/test_vm2vm_different_routers.py
+++ b/tests/test_vm2vm_different_routers.py
@@ -1,3 +1,4 @@
+from concurrent.futures import ThreadPoolExecutor
 import logging
 import sys
 import time
@@ -107,7 +108,8 @@
         vms[2].add_floating_ip(fip2['floating_ip_address'])
         for i in range(len(vms)):
             vm_info.append({'vm': vms[i],
-                            'fip': fips[i]['floating_ip_address']})
+                            'fip': fips[i]['floating_ip_address'],
+                            'private_key': private_key})
 
         # Set custom MTU if required
         if os_actions.is_cloud_tf() and (custom_mtu != "default"):
@@ -117,24 +119,21 @@
                                                                custom_mtu)
 
         # Check VMs are reachable and prepare iperf3
-        logger.info("Checking VMs are reachable via SSH, getting MTU...")
-        mtus = []
+        logger.info("Checking VMs are reachable via SSH...")
         transport1 = ssh.SSHTransport(vm_info[0]['fip'], 'ubuntu',
                                       password='dd', private_key=private_key)
-        logger.info("Checking VMs are reachable via SSH...")
         for i in range(len(vms)):
-            if transport1.check_vm_is_reachable_ssh(
-                    floating_ip=vm_info[i]['fip'], timeout=ssh_timeout):
-                ssh.IperfAtVM(
-                    vm_info[i]['fip'], private_key=private_key)
-                mtus.append(transport1.get_mtu_from_vm(
-                    vm_info[i]['fip'], private_key=private_key))
+            transport1.check_vm_is_reachable_ssh(
+                floating_ip=vm_info[i]['fip'], timeout=ssh_timeout)
+        with ThreadPoolExecutor() as executor:
+            futures = [
+                executor.submit(ssh.install_iperf_at_vms_and_get_mtu, vm_info)
+                for vm_info in vm_info]
+            mtus = [future.result() for future in futures]
         logger.info(
             "MTU at networks: {}, {}".format(
                 os_resources['net1']['mtu'],
                 os_resources_alt_project['net1']['mtu']))
-        logger.info("MTU at VMs: {}".format(", ".join(mtus)))
-
         # Prepare the result table and run iperf3
         table_rows = []
         table_rows.append(['Test Case', 'Host 1', 'Host 2',
diff --git a/utils/ssh.py b/utils/ssh.py
index caca30e..20313d0 100644
--- a/utils/ssh.py
+++ b/utils/ssh.py
@@ -14,6 +14,21 @@
 logging.getLogger("paramiko").setLevel(logging.WARNING)
 
 
+def install_iperf_at_vms_and_get_mtu(vm_info):
+    transport1 = SSHTransport(vm_info['fip'], 'ubuntu', password='dd',
+                              private_key=vm_info['private_key'])
+    try:
+        IperfAtVM(vm_info['fip'], private_key=vm_info['private_key'])
+        logger.info("Getting MTU values from VMs...")
+        mtu = transport1.get_mtu_from_vm(
+            vm_info['fip'], private_key=vm_info['private_key'])
+        logger.info(f"MTU at VM {vm_info['fip']} is {mtu}")
+        return mtu
+    except Exception as e:
+        print(f"Error on VM {vm_info['fip']}: {e}")
+        return None
+
+
 class SSHTransport(object):
     def __init__(self, address, username, password=None,
                  private_key=None, look_for_keys=False, *args, **kwargs):
