From 359527501604ea720b594a2ed1b32cd29fe6adbc Mon Sep 17 00:00:00 2001 From: Renuka Apte Date: Tue, 4 Sep 2012 23:02:16 -0700 Subject: xenapi: Refactor snapshots during resize Currently, we use VM.snapshot for resize, which fails if we have a volume attached to the VM, which does not support snapshots. This change uses VDI.snapshot instead, for all VDIs that are not attached by nova. Also needed for xenapi: detaching and reattaching volumes during migrations and reverting of migrations. Fixes Bug #1028092 Change-Id: I3e2973747135a9c33de194e38537620c397bb87e --- nova/tests/test_xenapi.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'nova/tests') diff --git a/nova/tests/test_xenapi.py b/nova/tests/test_xenapi.py index 5f967862b..c016ca1f1 100644 --- a/nova/tests/test_xenapi.py +++ b/nova/tests/test_xenapi.py @@ -358,7 +358,8 @@ class XenAPIVMTestCase(stubs.XenAPITestBase): self.assertDictMatch(fake_diagnostics, expected) def test_instance_snapshot_fails_with_no_primary_vdi(self): - def create_bad_vbd(vm_ref, vdi_ref): + def create_bad_vbd(session, vm_ref, vdi_ref, userdevice, + vbd_type='disk', read_only=False, bootable=False): vbd_rec = {'VM': vm_ref, 'VDI': vdi_ref, 'userdevice': 'fake', @@ -367,7 +368,7 @@ class XenAPIVMTestCase(stubs.XenAPITestBase): xenapi_fake.after_VBD_create(vbd_ref, vbd_rec) return vbd_ref - self.stubs.Set(xenapi_fake, 'create_vbd', create_bad_vbd) + self.stubs.Set(vm_utils, 'create_vbd', create_bad_vbd) stubs.stubout_instance_snapshot(self.stubs) # Stubbing out firewall driver as previous stub sets alters # xml rpc result parsing -- cgit