nova/nova/tests/unit/virt/libvirt
melanie witt 7500c1910c 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

Change-Id: Iefab05e84ccc0bf8f15bdbbf515a290d282dbc5d
(cherry picked from commit 48fd81648a)
2019-04-17 18:57:07 +00:00
..
storage Use uuidsentinel from oslo.utils 2018-09-05 09:08:54 -05:00
volume libvirt: set device address tag only if setting disk unit 2019-04-17 18:57:07 +00:00
__init__.py
fake_imagebackend.py Pass disk_info dict to libvirt_info 2018-11-02 13:54:13 +00:00
fake_libvirt_utils.py Move libvirt calculation of machine type to utils.py 2019-03-19 22:28:33 +00:00
fake_os_brick_connector.py Switch to using os-brick 2015-07-27 10:47:22 -07:00
fakelibvirt.py fakelibvirt: Add ability to generate fake PCI devices 2019-03-06 11:05:22 +00:00
test_blockinfo.py libvirt: fix disk_bus handling for root disk 2018-09-21 17:46:13 +01:00
test_compat.py Workaround for race condition in libvirt 2015-03-14 20:17:41 -03:00
test_config.py Use assertXmlEqual() helper for all XML comparison tests 2019-03-08 11:40:41 +00:00
test_designer.py add mtu to libvirt xml for ethernet and bridge types 2018-06-06 09:39:40 -04:00
test_driver.py libvirt: disconnect volume when encryption fails 2019-04-08 15:36:02 +00:00
test_fakelibvirt.py Use assertXmlEqual() helper for all XML comparison tests 2019-03-08 11:40:41 +00:00
test_firewall.py Use uuidsentinel from oslo.utils 2018-09-05 09:08:54 -05:00
test_guest.py Add missing libvirt exception during device detach 2019-03-07 00:04:48 +00:00
test_host.py Use uuidsentinel from oslo.utils 2018-09-05 09:08:54 -05:00
test_imagebackend.py libvirt: set device address tag only if setting disk unit 2019-04-17 18:57:07 +00:00
test_imagecache.py Use uuidsentinel from oslo.utils 2018-09-05 09:08:54 -05:00
test_migration.py Use assertXmlEqual() helper for all XML comparison tests 2019-03-08 11:40:41 +00:00
test_utils.py Move libvirt calculation of machine type to utils.py 2019-03-19 22:28:33 +00:00
test_vif.py Use assertXmlEqual() helper for all XML comparison tests 2019-03-08 11:40:41 +00:00