nova/nova/tests/unit/virt/libvirt
Takashi NATSUME be553fb155 Set 'serial' to new volume ID in swap volumes
In swap_volume method of nova/virt/libvirt/driver.py,
before BDM was got by using the instance's UUID and
'serial' of new connection_info as the volume ID,
and driver BDM was updated by using the BDM.
('serial' has the volume ID information.)
But in _init_volume_connection method in ComputeManager class,
'serial' is passed from old connection_info to new connection_info.

It works fine in the case that cinder initiates swapping volumes
because the ID of the attached volume isn't changed after
swapping volumes.
But in the case that nova initiates swapping volumes,
the ID of the attached volume is changed.

So in the case that nova initiated swapping volumes,
after swap volume function was performed once,
BDM was got by wrong old volume id (serial)
when swap volume function was performed for the second time.

So if 'serial' of new connection_info is None,
it is set to new volume ID.
And if cinder 'migrate_volume_completion' API returns
old volume ID (the case that cinder initiates swapping volumes),
the 'serial' of new connection_info is set to old volume ID.
If cinder 'migrate_volume_completion' API returns new volume ID
(the case that nova initiated swapping volumes),
the 'serial' is left as it is (new volume ID).

Change-Id: I86b8fbb09b0f1ed4c667683de3827cd9b63bca7f
Closes-Bug: #1490236
2016-09-12 00:31:20 +00:00
..
storage rbd_utils: wrap blocking calls in tpool.Proxy() 2016-08-01 14:06:02 +03:00
volume Remove hacked test that fails with latest os-brick 2016-09-01 12:42:55 -04:00
__init__.py move all tests to nova/tests/unit 2014-11-12 15:31:08 -05:00
fake_imagebackend.py libvirt: Improve mocking of imagebackend disks 2016-08-16 16:24:47 +01:00
fake_libvirt_utils.py Remove backward compatibility with pre-grizzly releases 2016-08-04 12:37:31 +00:00
fake_os_brick_connector.py Switch to using os-brick 2015-07-27 10:47:22 -07:00
fakelibvirt.py libvirt: update guest time after suspend 2016-07-20 02:19:59 +10:00
test_blockinfo.py Merge "Modify the disk bus and device name for Aarch64" 2016-06-23 11:49:02 +00:00
test_compat.py Workaround for race condition in libvirt 2015-03-14 20:17:41 -03:00
test_config.py libvirt: Modify the interface address object assignment 2016-07-19 23:38:50 +08:00
test_designer.py libvirt: convert over to use os-vif for Linux Bridge & OVS 2016-08-10 10:29:49 -04:00
test_driver.py Set 'serial' to new volume ID in swap volumes 2016-09-12 00:31:20 +00:00
test_fakelibvirt.py Use assertLess(Equal) instead of assertTrue(A > X) 2016-06-03 16:53:14 +01:00
test_firewall.py Fix using filter() to meet python2,3 2016-08-29 19:00:12 +07:00
test_guest.py libvirt: update guest time after suspend 2016-07-20 02:19:59 +10:00
test_host.py libvirt: cleanup baselineCPU return value checking 2016-06-15 17:35:47 +08:00
test_imagebackend.py Fix resizing in imagebackend.cache() 2016-09-09 18:36:23 +00:00
test_imagecache.py Merge "Fix invalid uuid warnings in virt testcases" 2016-06-16 10:29:24 +00:00
test_migration.py Merge "cleanup: some update xml cases in test_migration" 2016-08-05 23:44:00 +00:00
test_utils.py Remove max_size argument to images.fetch and fetch_to_raw 2016-07-21 10:52:30 +01:00
test_vif.py libvirt: convert over to use os-vif for Linux Bridge & OVS 2016-08-10 10:29:49 -04:00