diff options
| author | Renuka Apte <renuka.apte@citrix.com> | 2012-09-04 23:02:16 -0700 |
|---|---|---|
| committer | Clay Gerrard <clay.gerrard@gmail.com> | 2012-10-03 20:32:22 -0500 |
| commit | 359527501604ea720b594a2ed1b32cd29fe6adbc (patch) | |
| tree | 2e938a604d06016107f0782d7971a18beb33e936 /nova/tests | |
| parent | 1d4506c16aec9674be6a3685ba585a8bbd9c1559 (diff) | |
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
Diffstat (limited to 'nova/tests')
| -rw-r--r-- | nova/tests/test_xenapi.py | 5 |
1 files changed, 3 insertions, 2 deletions
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 |
