Skip to content

Commit 3b3adbf

Browse files
author
Girish Shilamkar
committed
CLOUDSTACK-5637: Detach volume before migrating
1 parent 57cb023 commit 3b3adbf

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

‎test/integration/component/test_stopped_vm.py‎

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -891,6 +891,8 @@ def test_09_stop_vm_migrate_vol(self):
891891
"Running",
892892
"VM should be in Running state after deployment"
893893
)
894+
895+
894896
self.debug("Stopping instance: %s" % self.virtual_machine.name)
895897
self.virtual_machine.stop(self.apiclient)
896898
self.debug("Instance is stopped!")
@@ -939,6 +941,11 @@ def test_09_stop_vm_migrate_vol(self):
939941
self.storage_id = spool.id
940942
self.storage_name = spool.name
941943
break
944+
945+
self.debug("Detaching volume %s from vm %s" % (vol_response.id, self.virtual_machine.id))
946+
947+
self.virtual_machine.detach_volume(self.apiclient, vol_response)
948+
942949
self.debug("Migrating volume to storage pool: %s" % self.storage_name)
943950
Volume.migrate(
944951
self.apiclient,
@@ -947,14 +954,14 @@ def test_09_stop_vm_migrate_vol(self):
947954
)
948955
volume = Volume.list(
949956
self.apiclient,
950-
virtualmachineid=self.virtual_machine.id,
951-
type='ROOT',
952-
listall=True
957+
virtualmachineid=self.virtual_machine.id,
958+
type="ROOT",
959+
listall=True,
953960
)
954961
self.assertEqual(
955962
volume[0].storage,
956963
self.storage_name,
957-
"Check volume migration response")
964+
"Check volume migration response vol.storage %s self.storage_name %s" % (volume[0].storage, self.storage_name))
958965

959966
return
960967

0 commit comments

Comments
 (0)