forked from openstack/nova
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes bug 1040332. Xapi VM.migrate_send and VM.assert_can_migrate calls require that vdi_map parameter is a (source_vdi_ref -> target_sr_ref) mapping, for block live migration to work, as of XenServer 6.0 RC1. On the destination side: This fix modifies the check_can_live_migrate_destination call, so that the value returned contains the "destination_sr_ref" (XenAPI specific data is stored under the "migrate_send_data key"). On the source side: check_can_live_migrate_source and live_migrate calls assemble the vdi_map by mapping all the local sr contained vdis of the VM to destination_sr_ref, and passing this parameter to the VM.migrate_send and VM.assert_can_migrate Xapi calls. Change-Id: I95f3dca651d2e72fc727646580092a25f558d6ba
- Loading branch information
John Garbutt
authored and
Mate Lakat
committed
Sep 10, 2012
1 parent
28a5b31
commit 4c72bfc
Showing
5 changed files
with
200 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
from nova.tests.xenapi import stubs | ||
from nova.virt.xenapi import driver as xenapi_conn | ||
from nova.virt.xenapi import fake | ||
from nova.virt.xenapi import vm_utils | ||
|
||
|
||
class GetInstanceForVdisForSrTestCase(stubs.XenAPITestBase): | ||
def setUp(self): | ||
super(GetInstanceForVdisForSrTestCase, self).setUp() | ||
self.flags(disable_process_locking=True, | ||
instance_name_template='%d', | ||
firewall_driver='nova.virt.xenapi.firewall.' | ||
'Dom0IptablesFirewallDriver', | ||
xenapi_connection_url='test_url', | ||
xenapi_connection_password='test_pass',) | ||
|
||
def tearDown(self): | ||
super(GetInstanceForVdisForSrTestCase, self).tearDown() | ||
|
||
def test_get_instance_vdis_for_sr(self): | ||
vm_ref = fake.create_vm("foo", "Running") | ||
sr_ref = fake.create_sr() | ||
|
||
vdi_1 = fake.create_vdi('vdiname1', sr_ref) | ||
vdi_2 = fake.create_vdi('vdiname2', sr_ref) | ||
|
||
for vdi_ref in [vdi_1, vdi_2]: | ||
fake.create_vbd(vm_ref, vdi_ref) | ||
|
||
stubs.stubout_session(self.stubs, fake.SessionBase) | ||
driver = xenapi_conn.XenAPIDriver(False) | ||
|
||
result = list(vm_utils.get_instance_vdis_for_sr( | ||
driver._session, vm_ref, sr_ref)) | ||
|
||
self.assertEquals([vdi_1, vdi_2], result) | ||
|
||
def test_get_instance_vdis_for_sr_no_vbd(self): | ||
vm_ref = fake.create_vm("foo", "Running") | ||
sr_ref = fake.create_sr() | ||
|
||
stubs.stubout_session(self.stubs, fake.SessionBase) | ||
driver = xenapi_conn.XenAPIDriver(False) | ||
|
||
result = list(vm_utils.get_instance_vdis_for_sr( | ||
driver._session, vm_ref, sr_ref)) | ||
|
||
self.assertEquals([], result) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters