nova/nova/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 Merge "Properly quote IPv6 address in RsyncDriver" 2016-08-18 13:17:19 +00:00
__init__.py Remove vi modelines 2014-02-03 14:19:44 +00:00
blockinfo.py Merge "rename libvirt has_default_ephemeral" 2016-07-13 04:24:05 +00:00
compat.py Replace deprecated LOG.warn with LOG.warning 2016-03-15 11:57:56 +00:00
config.py libvirt: Modify the interface address object assignment 2016-07-19 23:38:50 +08:00
designer.py libvirt: convert over to use os-vif for Linux Bridge & OVS 2016-08-10 10:29:49 -04:00
driver.py Set 'serial' to new volume ID in swap volumes 2016-09-12 00:31:20 +00:00
firewall.py Config options: Centralize netconf options 2016-04-24 18:15:05 +00:00
guest.py libvirt: update guest time after suspend 2016-07-20 02:19:59 +10:00
host.py libvirt: cleanup baselineCPU return value checking 2016-06-15 17:35:47 +08:00
imagebackend.py Fix resizing in imagebackend.cache() 2016-09-09 18:36:23 +00:00
imagecache.py Fix imagecache.get_cache_fname() to work in python3 2016-06-07 05:36:08 -04:00
instancejobtracker.py Replace deprecated LOG.warn with LOG.warning 2016-03-15 11:57:56 +00:00
migration.py Merge "libvirt: Add migration support for perf event support" 2016-06-29 19:47:08 +00:00
utils.py Remove backward compatibility with pre-grizzly releases 2016-08-04 12:37:31 +00:00
vif.py libvirt: convert over to use os-vif for Linux Bridge & OVS 2016-08-10 10:29:49 -04:00