nova/nova/tests/unit/virt/libvirt/volume
melanie witt 8703282508 libvirt: set device address tag only if setting disk unit
In Pike, we began setting disk unit values manually for the
'virtio-scsi' controller model in order to allow up to 256 devices [1].
We do this by setting the disk unit of the address tag manually for the
guest config. If we do not set the address tag manually, libvirt would
autogenerate it for us.

A problem occurs when a user has a SCSI disk that is a volume or isn't
using the 'virtio-scsi' controller model because we're not guarding our
manual setting of the address tag in the guest config by the disk unit,
in addition to the SCSI bus. This means that for a SCSI volume, we
generate an address tag like '<address type="drive" controller="0"/>'
for any SCSI volume, so a user with more than one device will get the
following error when they try to boot an instance:

  Failed to start libvirt guest: libvirtError: unsupported
    configuration: Found duplicate drive address for disk with target name
    'sda' controller='0' bus='0' target='0' unit='0'

This updates the conditionals to only manually set the address tag if
the bus is SCSI _and_ the disk unit has been specified. Otherwise, let
libvirt autogenerate the address tag and take care of avoiding
collisions.

[1] https://bugs.launchpad.net/nova/+bug/1686116

Closes-Bug: #1792077

NOTE(melwitt): The difference in test_imagebackend.py from the Stein
backport is because change I28c5bc23c0ea60d64153472d8937965f60f907c4
is not in Rocky.

Change-Id: Iefab05e84ccc0bf8f15bdbbf515a290d282dbc5d
(cherry picked from commit 48fd81648a)
(cherry picked from commit 7500c1910c)
2019-04-18 15:56:28 +00:00
..
__init__.py libvirt: move volume/remotefs/quobyte modules under volume subdir 2015-07-28 17:46:05 -07:00
test_aoe.py libvirt: Pass Host instead of Driver to volume drivers 2016-11-01 16:41:08 +00:00
test_disco.py Remove unused argument from LibvirtDriver._disconnect_volume 2017-12-17 07:12:04 +00:00
test_drbd.py Remove unused argument from LibvirtDriver._disconnect_volume 2017-12-17 07:12:04 +00:00
test_fibrechannel.py libvirt: add tests to check multipath in iscsi/fc volume connectors 2018-01-09 12:43:34 -05:00
test_fs.py libvirt: expand checks for SubclassSignatureTestCase 2017-05-15 18:15:55 -04:00
test_gpfs.py libvirt: Pass Host instead of Driver to volume drivers 2016-11-01 16:41:08 +00:00
test_hgst.py Remove unused argument from LibvirtDriver._disconnect_volume 2017-12-17 07:12:04 +00:00
test_iscsi.py libvirt: add tests to check multipath in iscsi/fc volume connectors 2018-01-09 12:43:34 -05:00
test_iser.py libvirt: Pass Host instead of Driver to volume drivers 2016-11-01 16:41:08 +00:00
test_mount.py trivial: Don't use 'Test' prefix for non-TestCase classes 2018-01-30 16:33:45 +00:00
test_net.py Ensure rbd auth fallback uses matching credentials 2018-12-26 00:06:30 +00:00
test_nfs.py Remove unused argument from LibvirtDriver._disconnect_volume 2017-12-17 07:12:04 +00:00
test_nvme.py Adding NVMEoF for libvirt driver 2018-05-29 11:26:01 +00:00
test_quobyte.py Fix issue for pep8 on py3 2018-03-29 15:24:33 +08:00
test_remotefs.py Remove duplicative implementation of temporary directories. 2018-03-28 11:12:31 +11:00
test_scaleio.py Support extending attached ScaleIO volumes 2018-04-05 09:01:16 -04:00
test_smbfs.py Remove unused argument from LibvirtDriver._disconnect_volume 2017-12-17 07:12:04 +00:00
test_storpool.py Add the Nova libvirt StorPool attachment driver. 2018-01-24 00:01:42 +02:00
test_volume.py libvirt: set device address tag only if setting disk unit 2019-04-18 15:56:28 +00:00
test_vrtshyperscale.py Remove unused argument from LibvirtDriver._disconnect_volume 2017-12-17 07:12:04 +00:00
test_vzstorage.py Remove unused argument from LibvirtDriver._disconnect_volume 2017-12-17 07:12:04 +00:00