diff --git a/tempest/api/compute/admin/test_live_migration.py b/tempest/api/compute/admin/test_live_migration.py
index 34ec78d..12c471e 100644
--- a/tempest/api/compute/admin/test_live_migration.py
+++ b/tempest/api/compute/admin/test_live_migration.py
@@ -14,8 +14,6 @@
 #    under the License.
 
 
-from collections import namedtuple
-
 import testtools
 
 from tempest.api.compute import base
@@ -26,9 +24,6 @@
 CONF = config.CONF
 
 
-CreatedServer = namedtuple('CreatedServer', 'server_id, volume_backed')
-
-
 class LiveBlockMigrationTestJSON(base.BaseV2ComputeAdminTest):
     _host_key = 'OS-EXT-SRV-ATTR:host'
 
@@ -43,10 +38,6 @@
     def resource_setup(cls):
         super(LiveBlockMigrationTestJSON, cls).resource_setup()
 
-        # list of CreatedServer namedtuples
-        # TODO(mriedem): Remove the instance variable and shared server re-use
-        cls.created_servers = []
-
     def _get_compute_hostnames(self):
         body = self.admin_hosts_client.list_hosts()['hosts']
         return [
@@ -62,18 +53,12 @@
     def _get_host_for_server(self, server_id):
         return self._get_server_details(server_id)[self._host_key]
 
-    def _migrate_server_to(self, server_id, dest_host):
-        # volume backed instances shouldn't be block migrated
-        for id, volume_backed in self.created_servers:
-            if server_id == id:
-                use_block_migration = not volume_backed
-                break
-        else:
-            raise ValueError('Server with id %s not found.' % server_id)
-        bmflm = (CONF.compute_feature_enabled.
-                 block_migration_for_live_migration and use_block_migration)
+    def _migrate_server_to(self, server_id, dest_host, volume_backed):
+        block_migration = (CONF.compute_feature_enabled.
+                           block_migration_for_live_migration and
+                           not volume_backed)
         body = self.admin_servers_client.live_migrate_server(
-            server_id, host=dest_host, block_migration=bmflm,
+            server_id, host=dest_host, block_migration=block_migration,
             disk_over_commit=False)
         return body
 
@@ -85,19 +70,10 @@
     def _get_server_status(self, server_id):
         return self._get_server_details(server_id)['status']
 
-    def _get_an_active_server(self, volume_backed=False):
-        for server_id, vol_backed in self.created_servers:
-            if ('ACTIVE' == self._get_server_status(server_id) and
-                    volume_backed == vol_backed):
-                return server_id
-        else:
+    def _create_server(self, volume_backed=False):
             server = self.create_test_server(wait_until="ACTIVE",
                                              volume_backed=volume_backed)
-            server_id = server['id']
-            new_server = CreatedServer(server_id=server_id,
-                                       volume_backed=volume_backed)
-            self.created_servers.append(new_server)
-            return server_id
+            return server['id']
 
     def _volume_clean_up(self, server_id, volume_id):
         body = self.volumes_client.show_volume(volume_id)['volume']
@@ -117,11 +93,11 @@
         :param volume_backed: If the instance is volume backed or not. If
                               volume_backed, *block* migration is not used.
         """
-        # Live block migrate an instance to another host
+        # Live migrate an instance to another host
         if len(self._get_compute_hostnames()) < 2:
             raise self.skipTest(
                 "Less than 2 compute nodes, skipping migration test.")
-        server_id = self._get_an_active_server(volume_backed=volume_backed)
+        server_id = self._create_server(volume_backed=volume_backed)
         actual_host = self._get_host_for_server(server_id)
         target_host = self._get_host_other_than(actual_host)
 
@@ -130,7 +106,7 @@
             waiters.wait_for_server_status(self.admin_servers_client,
                                            server_id, state)
 
-        self._migrate_server_to(server_id, target_host)
+        self._migrate_server_to(server_id, target_host, volume_backed)
         waiters.wait_for_server_status(self.servers_client, server_id, state)
         migration_list = (self.admin_migration_client.list_migrations()
                           ['migrations'])
@@ -178,11 +154,10 @@
                       block_migrate_cinder_iscsi,
                       'Block Live migration not configured for iSCSI')
     def test_iscsi_volume(self):
-        # Live block migrate an instance to another host
         if len(self._get_compute_hostnames()) < 2:
             raise self.skipTest(
                 "Less than 2 compute nodes, skipping migration test.")
-        server_id = self._get_an_active_server()
+        server_id = self._create_server()
         actual_host = self._get_host_for_server(server_id)
         target_host = self._get_host_other_than(actual_host)
 
