diff --git a/barbican_tempest_plugin/tests/scenario/test_volume_encryption.py b/barbican_tempest_plugin/tests/scenario/test_volume_encryption.py
index c2033fb..c7d2577 100644
--- a/barbican_tempest_plugin/tests/scenario/test_volume_encryption.py
+++ b/barbican_tempest_plugin/tests/scenario/test_volume_encryption.py
@@ -12,10 +12,14 @@
 # License for the specific language governing permissions and limitations
 # under the License.
 
+import time
+
 from oslo_log import log as logging
 from tempest.common import utils
+from tempest.common import waiters
 from tempest import config
 from tempest.lib import decorators
+from tempest.lib import exceptions as lib_exc
 
 from barbican_tempest_plugin.tests.scenario import barbican_manager
 
@@ -54,12 +58,36 @@
                                     control_location='front-end')
         return self.create_volume(volume_type=volume_type['name'])
 
+    def wait_for_disk(self, server_ip, keypair, device_name, wait_interval=1,
+                      wait_timeout=15):
+        start = int(time.time())
+        ssh_client = self.get_remote_client(
+            server_ip, private_key=keypair['private_key'])
+        disks = ssh_client.get_disks()
+        while True:
+            time.sleep(wait_interval)
+            if device_name in disks:
+                return
+            if int(time.time()) - start >= wait_timeout:
+                message = ('Device %s did not appear in %d sec' % (
+                    device_name, wait_timeout))
+                raise lib_exc.TimeoutException(message)
+
     def attach_detach_volume(self, server, volume, keypair):
         # Attach volume
-        self.nova_volume_attach(server, volume)
+        attached_volume = self.nova_volume_attach(server, volume)
 
         # Write a timestamp to volume
         server_ip = self.get_server_ip(server)
+        self.servers_client.stop_server(server['id'])
+        waiters.wait_for_server_status(self.servers_client, server['id'],
+                                       'SHUTOFF')
+
+        self.servers_client.start_server(server['id'])
+        waiters.wait_for_server_status(self.servers_client, server['id'],
+                                       'ACTIVE')
+        self.wait_for_disk(server_ip, keypair,
+                           CONF.compute.volume_device_name)
         timestamp = self.create_timestamp(
             server_ip,
             dev_name=CONF.compute.volume_device_name,
@@ -72,6 +100,9 @@
         )
         self.assertEqual(timestamp, timestamp2)
 
+        # Detach volume
+        self.nova_volume_detach(server, attached_volume)
+
     @decorators.idempotent_id('89165fb4-5534-4b9d-8429-97ccffb8f86f')
     @utils.services('compute', 'volume', 'image')
     def test_encrypted_cinder_volumes_luks(self):
