diff --git a/test/integration/smoke/test_snapshots.py b/test/integration/smoke/test_snapshots.py index 7b67637a0aa..1da90f9416b 100644 --- a/test/integration/smoke/test_snapshots.py +++ b/test/integration/smoke/test_snapshots.py @@ -245,23 +245,30 @@ class TestSnapshotRootDisk(cloudstackTestCase): PASS, "Invalid response returned for list volumes") vol_uuid = vol_res[0].id - - # Create new Primary Storage clusters = list_clusters( self.apiclient, zoneid=self.zone.id ) assert isinstance(clusters,list) and len(clusters)>0 + self.cleanup.append(self.virtual_machine_with_disk) + + # Attach created volume to vm, then detach it to be able to migrate it + self.virtual_machine_with_disk.stop(self.apiclient) + self.virtual_machine_with_disk.attach_volume( + self.apiclient, + vol + ) + + # Create new Primary Storage storage = StoragePool.create(self.apiclient, self.services["nfs2"], clusterid=clusters[0].id, zoneid=self.zone.id, podid=self.pod.id ) - self.cleanup.append(self.virtual_machine_with_disk) - self.cleanup.append(storage) + self.cleanup.append(storage) self.assertEqual( storage.state, 'Up', @@ -296,12 +303,6 @@ class TestSnapshotRootDisk(cloudstackTestCase): "Check storage pool type " ) - # Attach created volume to vm, then detach it to be able to migrate it - self.virtual_machine_with_disk.stop(self.apiclient) - self.virtual_machine_with_disk.attach_volume( - self.apiclient, - vol - ) self.virtual_machine_with_disk.detach_volume( self.apiclient, vol