summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nova/tests/unit/virt/hyperv/test_volumeops.py9
-rw-r--r--nova/virt/hyperv/volumeops.py4
2 files changed, 9 insertions, 4 deletions
diff --git a/nova/tests/unit/virt/hyperv/test_volumeops.py b/nova/tests/unit/virt/hyperv/test_volumeops.py
index 78bdf2329e..186094bfbc 100644
--- a/nova/tests/unit/virt/hyperv/test_volumeops.py
+++ b/nova/tests/unit/virt/hyperv/test_volumeops.py
@@ -44,7 +44,8 @@ def get_fake_block_dev_info():
def get_fake_connection_info(**kwargs):
- return {'data': dict(connection_data, **kwargs)}
+ return {'data': dict(connection_data, **kwargs),
+ 'serial': mock.sentinel.serial}
class VolumeOpsTestCase(test_base.HyperVBaseTestCase):
@@ -274,13 +275,15 @@ class ISCSIVolumeDriverTestCase(test_base.HyperVBaseTestCase):
mock.sentinel.instance_name, 0)
attach_vol.assert_called_once_with(mock.sentinel.instance_name,
fake_ide_path, 0,
- fake_mounted_disk_path)
+ fake_mounted_disk_path,
+ serial=mock.sentinel.serial)
else:
get_scsi_path.assert_called_once_with(mock.sentinel.instance_name)
get_free_slot.assert_called_once_with(fake_scsi_path)
attach_vol.assert_called_once_with(mock.sentinel.instance_name,
fake_scsi_path, 1,
- fake_mounted_disk_path)
+ fake_mounted_disk_path,
+ serial=mock.sentinel.serial)
def test_attach_volume_ebs(self):
self._check_attach_volume(ebs_root=True)
diff --git a/nova/virt/hyperv/volumeops.py b/nova/virt/hyperv/volumeops.py
index d2a8e55660..3dbbd57906 100644
--- a/nova/virt/hyperv/volumeops.py
+++ b/nova/virt/hyperv/volumeops.py
@@ -234,6 +234,7 @@ class ISCSIVolumeDriver(object):
data = connection_info['data']
target_lun = data['target_lun']
target_iqn = data['target_iqn']
+ serial = connection_info['serial']
# Getting the mounted disk
mounted_disk_path = self._get_mounted_disk_from_lun(target_iqn,
@@ -254,7 +255,8 @@ class ISCSIVolumeDriver(object):
self._vmutils.attach_volume_to_controller(instance_name,
ctrller_path,
slot,
- mounted_disk_path)
+ mounted_disk_path,
+ serial=serial)
except Exception:
with excutils.save_and_reraise_exception():
LOG.error(_LE('Unable to attach volume to instance %s'),