diff --git a/tempest/api/compute/admin/test_quotas_negative.py b/tempest/api/compute/admin/test_quotas_negative.py
index 20aa440..798bd30 100644
--- a/tempest/api/compute/admin/test_quotas_negative.py
+++ b/tempest/api/compute/admin/test_quotas_negative.py
@@ -109,7 +109,10 @@
 
         quota_set = self.adm_client.show_quota_set(self.demo_tenant_id)
         default_sg_quota = quota_set['security_groups']
-        sg_quota = 0  # Set the quota to zero to conserve resources
+
+        # Set the quota to number of used security groups
+        sg_quota = self.limits_client.show_limits()['absolute'][
+            'totalSecurityGroupsUsed']
 
         quota_set =\
             self.adm_client.update_quota_set(self.demo_tenant_id,
diff --git a/tempest/api/compute/base.py b/tempest/api/compute/base.py
index 37c1e0a..759bb8c 100644
--- a/tempest/api/compute/base.py
+++ b/tempest/api/compute/base.py
@@ -266,8 +266,8 @@
 
     @classmethod
     def prepare_instance_network(cls):
-        if (CONF.compute.ssh_auth_method != 'disabled' and
-                CONF.compute.ssh_connect_method == 'floating'):
+        if (CONF.validation.auth_method != 'disabled' and
+                CONF.validation.connect_method == 'floating'):
             cls.set_network_resources(network=True, subnet=True, router=True,
                                       dhcp=True)
 
@@ -294,7 +294,7 @@
         return image
 
     @classmethod
-    def rebuild_server(cls, server_id, **kwargs):
+    def rebuild_server(cls, server_id, validatable=False, **kwargs):
         # Destroy an existing server and creates a new one
         if server_id:
             try:
@@ -302,7 +302,11 @@
                 cls.servers_client.wait_for_server_termination(server_id)
             except Exception:
                 LOG.exception('Failed to delete server %s' % server_id)
-        server = cls.create_test_server(wait_until='ACTIVE', **kwargs)
+
+        server = cls.create_test_server(
+            validatable,
+            wait_until='ACTIVE',
+            **kwargs)
         cls.password = server['adminPass']
         return server['id']
 
@@ -320,6 +324,21 @@
         """Deletes the given volume and waits for it to be gone."""
         cls._delete_volume(cls.volumes_extensions_client, volume_id)
 
+    @classmethod
+    def get_server_ip(cls, server):
+        """Get the server fixed or floating IP.
+
+        For the floating IP, the address created by the validation resources
+        is returned.
+        For the fixed IP, the server is returned and the current mechanism of
+        address extraction in the remote_client is followed.
+        """
+        if CONF.validation.connect_method == 'floating':
+            ip_or_server = cls.validation_resources['floating_ip']['ip']
+        elif CONF.validation.connect_method == 'fixed':
+            ip_or_server = server
+        return ip_or_server
+
 
 class BaseV2ComputeTest(BaseComputeTest):
     _api_version = 2
diff --git a/tempest/api/compute/images/test_images_oneserver_negative.py b/tempest/api/compute/images/test_images_oneserver_negative.py
index 2f78e9d..1a74e52 100644
--- a/tempest/api/compute/images/test_images_oneserver_negative.py
+++ b/tempest/api/compute/images/test_images_oneserver_negative.py
@@ -69,6 +69,11 @@
             raise cls.skipException(skip_msg)
 
     @classmethod
+    def setup_credentials(cls):
+        cls.prepare_instance_network()
+        super(ImagesOneServerNegativeTestJSON, cls).setup_credentials()
+
+    @classmethod
     def setup_clients(cls):
         super(ImagesOneServerNegativeTestJSON, cls).setup_clients()
         cls.client = cls.images_client
diff --git a/tempest/api/compute/servers/test_create_server.py b/tempest/api/compute/servers/test_create_server.py
index 94b6cf0..39447b8 100644
--- a/tempest/api/compute/servers/test_create_server.py
+++ b/tempest/api/compute/servers/test_create_server.py
@@ -103,8 +103,11 @@
         # Verify that the number of vcpus reported by the instance matches
         # the amount stated by the flavor
         flavor = self.flavors_client.show_flavor(self.flavor_ref)
-        linux_client = remote_client.RemoteClient(self.server, self.ssh_user,
-                                                  self.password)
+        linux_client = remote_client.RemoteClient(
+            self.get_server_ip(self.server),
+            self.ssh_user,
+            self.password,
+            self.validation_resources['keypair']['private_key'])
         self.assertEqual(flavor['vcpus'], linux_client.get_number_of_vcpus())
 
     @test.idempotent_id('ac1ad47f-984b-4441-9274-c9079b7a0666')
@@ -112,8 +115,11 @@
                           'Instance validation tests are disabled.')
     def test_host_name_is_same_as_server_name(self):
         # Verify the instance host name is the same as the server name
-        linux_client = remote_client.RemoteClient(self.server, self.ssh_user,
-                                                  self.password)
+        linux_client = remote_client.RemoteClient(
+            self.get_server_ip(self.server),
+            self.ssh_user,
+            self.password,
+            self.validation_resources['keypair']['private_key'])
         self.assertTrue(linux_client.hostname_equals_servername(self.name))
 
     @test.idempotent_id('ed20d3fb-9d1f-4329-b160-543fbd5d9811')
@@ -202,12 +208,22 @@
     disk_config = 'AUTO'
 
     @classmethod
-    def setup_clients(cls):
+    def setup_credentials(cls):
         cls.prepare_instance_network()
+        super(ServersWithSpecificFlavorTestJSON, cls).setup_credentials()
+
+    @classmethod
+    def setup_clients(cls):
         super(ServersWithSpecificFlavorTestJSON, cls).setup_clients()
         cls.flavor_client = cls.os_adm.flavors_client
         cls.client = cls.servers_client
 
+    @classmethod
+    def resource_setup(cls):
+        cls.set_validation_resources()
+
+        super(ServersWithSpecificFlavorTestJSON, cls).resource_setup()
+
     @test.idempotent_id('b3c7bcfc-bb5b-4e22-b517-c7f686b802ca')
     @testtools.skipUnless(CONF.validation.run_validation,
                           'Instance validation tests are disabled.')
@@ -258,24 +274,37 @@
         admin_pass = self.image_ssh_password
 
         server_no_eph_disk = (self.create_test_server(
+                              validatable=True,
                               wait_until='ACTIVE',
                               adminPass=admin_pass,
                               flavor=flavor_no_eph_disk_id))
-        server_with_eph_disk = (self.create_test_server(
-                                wait_until='ACTIVE',
-                                adminPass=admin_pass,
-                                flavor=flavor_with_eph_disk_id))
+
         # Get partition number of server without extra specs.
         server_no_eph_disk = self.client.show_server(
             server_no_eph_disk['id'])
-        linux_client = remote_client.RemoteClient(server_no_eph_disk,
-                                                  self.ssh_user, admin_pass)
+        linux_client = remote_client.RemoteClient(
+            self.get_server_ip(server_no_eph_disk),
+            self.ssh_user,
+            admin_pass,
+            self.validation_resources['keypair']['private_key'])
         partition_num = len(linux_client.get_partitions().split('\n'))
 
+        # Explicit server deletion necessary for Juno compatibility
+        self.client.delete_server(server_no_eph_disk['id'])
+
+        server_with_eph_disk = (self.create_test_server(
+                                validatable=True,
+                                wait_until='ACTIVE',
+                                adminPass=admin_pass,
+                                flavor=flavor_with_eph_disk_id))
+
         server_with_eph_disk = self.client.show_server(
             server_with_eph_disk['id'])
-        linux_client = remote_client.RemoteClient(server_with_eph_disk,
-                                                  self.ssh_user, admin_pass)
+        linux_client = remote_client.RemoteClient(
+            self.get_server_ip(server_with_eph_disk),
+            self.ssh_user,
+            admin_pass,
+            self.validation_resources['keypair']['private_key'])
         partition_num_emph = len(linux_client.get_partitions().split('\n'))
         self.assertEqual(partition_num + 1, partition_num_emph)
 
diff --git a/tempest/api/compute/servers/test_server_actions.py b/tempest/api/compute/servers/test_server_actions.py
index b95250a..f0f6b8c 100644
--- a/tempest/api/compute/servers/test_server_actions.py
+++ b/tempest/api/compute/servers/test_server_actions.py
@@ -46,26 +46,35 @@
                                            self.server_id, 'ACTIVE')
         except lib_exc.NotFound:
             # The server was deleted by previous test, create a new one
-            server = self.create_test_server(wait_until='ACTIVE')
+            server = self.create_test_server(
+                validatable=True,
+                wait_until='ACTIVE')
             self.__class__.server_id = server['id']
         except Exception:
             # Rebuild server if something happened to it during a test
-            self.__class__.server_id = self.rebuild_server(self.server_id)
+            self.__class__.server_id = self.rebuild_server(self.server_id,
+                                                           validatable=True)
 
     def tearDown(self):
         self.server_check_teardown()
         super(ServerActionsTestJSON, self).tearDown()
 
     @classmethod
+    def setup_credentials(cls):
+        cls.prepare_instance_network()
+        super(ServerActionsTestJSON, cls).setup_credentials()
+
+    @classmethod
     def setup_clients(cls):
         super(ServerActionsTestJSON, cls).setup_clients()
         cls.client = cls.servers_client
 
     @classmethod
     def resource_setup(cls):
-        cls.prepare_instance_network()
+        cls.set_validation_resources()
+
         super(ServerActionsTestJSON, cls).resource_setup()
-        cls.server_id = cls.rebuild_server(None)
+        cls.server_id = cls.rebuild_server(None, validatable=True)
 
     @test.idempotent_id('6158df09-4b82-4ab3-af6d-29cf36af858d')
     @testtools.skipUnless(CONF.compute_feature_enabled.change_password,
@@ -76,28 +85,36 @@
         self.client.change_password(self.server_id, new_password)
         waiters.wait_for_server_status(self.client, self.server_id, 'ACTIVE')
 
-        if self.run_ssh:
+        if CONF.validation.run_validation:
             # Verify that the user can authenticate with the new password
             server = self.client.show_server(self.server_id)
-            linux_client = remote_client.RemoteClient(server, self.ssh_user,
-                                                      new_password)
+            linux_client = remote_client.RemoteClient(
+                self.get_server_ip(server),
+                self.ssh_user,
+                new_password)
             linux_client.validate_authentication()
 
     def _test_reboot_server(self, reboot_type):
-        if self.run_ssh:
+        if CONF.validation.run_validation:
             # Get the time the server was last rebooted,
             server = self.client.show_server(self.server_id)
-            linux_client = remote_client.RemoteClient(server, self.ssh_user,
-                                                      self.password)
+            linux_client = remote_client.RemoteClient(
+                self.get_server_ip(server),
+                self.ssh_user,
+                self.password,
+                self.validation_resources['keypair']['private_key'])
             boot_time = linux_client.get_boot_time()
 
         self.client.reboot(self.server_id, reboot_type)
         waiters.wait_for_server_status(self.client, self.server_id, 'ACTIVE')
 
-        if self.run_ssh:
+        if CONF.validation.run_validation:
             # Log in and verify the boot time has changed
-            linux_client = remote_client.RemoteClient(server, self.ssh_user,
-                                                      self.password)
+            linux_client = remote_client.RemoteClient(
+                self.get_server_ip(server),
+                self.ssh_user,
+                self.password,
+                self.validation_resources['keypair']['private_key'])
             new_boot_time = linux_client.get_boot_time()
             self.assertTrue(new_boot_time > boot_time,
                             '%s > %s' % (new_boot_time, boot_time))
@@ -157,10 +174,13 @@
         self.assertTrue(self.image_ref_alt.endswith(rebuilt_image_id))
         self.assertEqual(new_name, server['name'])
 
-        if self.run_ssh:
-            # Verify that the user can authenticate with the provided password
-            linux_client = remote_client.RemoteClient(server, self.ssh_user,
-                                                      password)
+        if CONF.validation.run_validation:
+            # TODO(jlanoux) add authentication with the provided password
+            linux_client = remote_client.RemoteClient(
+                self.get_server_ip(rebuilt_server),
+                self.ssh_user,
+                self.password,
+                self.validation_resources['keypair']['private_key'])
             linux_client.validate_authentication()
 
     @test.idempotent_id('30449a88-5aff-4f9b-9866-6ee9b17f906d')
diff --git a/tempest/api/compute/volumes/test_attach_volume.py b/tempest/api/compute/volumes/test_attach_volume.py
index 0496063..8e4278a 100644
--- a/tempest/api/compute/volumes/test_attach_volume.py
+++ b/tempest/api/compute/volumes/test_attach_volume.py
@@ -44,6 +44,8 @@
 
     @classmethod
     def resource_setup(cls):
+        cls.set_validation_resources()
+
         super(AttachVolumeTestJSON, cls).resource_setup()
         cls.device = CONF.compute.volume_device_name
 
@@ -62,8 +64,10 @@
     def _create_and_attach(self):
         # Start a server and wait for it to become ready
         admin_pass = self.image_ssh_password
-        self.server = self.create_test_server(wait_until='ACTIVE',
-                                              adminPass=admin_pass)
+        self.server = self.create_test_server(
+            validatable=True,
+            wait_until='ACTIVE',
+            adminPass=admin_pass)
 
         # Record addresses so that we can ssh later
         self.server['addresses'] = (
@@ -101,9 +105,12 @@
         waiters.wait_for_server_status(self.servers_client, self.server['id'],
                                        'ACTIVE')
 
-        linux_client = remote_client.RemoteClient(self.server,
-                                                  self.image_ssh_user,
-                                                  self.server['adminPass'])
+        linux_client = remote_client.RemoteClient(
+            self.get_server_ip(self.server),
+            self.image_ssh_user,
+            self.server['adminPass'],
+            self.validation_resources['keypair']['private_key'])
+
         partitions = linux_client.get_partitions()
         self.assertIn(self.device, partitions)
 
@@ -117,9 +124,12 @@
         waiters.wait_for_server_status(self.servers_client, self.server['id'],
                                        'ACTIVE')
 
-        linux_client = remote_client.RemoteClient(self.server,
-                                                  self.image_ssh_user,
-                                                  self.server['adminPass'])
+        linux_client = remote_client.RemoteClient(
+            self.get_server_ip(self.server),
+            self.image_ssh_user,
+            self.server['adminPass'],
+            self.validation_resources['keypair']['private_key'])
+
         partitions = linux_client.get_partitions()
         self.assertNotIn(self.device, partitions)
 
