nova/nova/virt/libvirt
melanie witt 48fd81648a 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
2019-04-17 18:21:04 +00:00
..
storage Fix string interpolations in logging calls 2019-01-29 15:06:39 +09:00
volume libvirt: set device address tag only if setting disk unit 2019-04-17 18:21:04 +00:00
__init__.py Remove vi modelines 2014-02-03 14:19:44 +00:00
blockinfo.py Add configuration of maximum disk devices to attach 2019-01-30 15:47:10 +00:00
compat.py Remove translation of log messages 2017-06-13 11:20:28 +07:00
config.py Parse <emulator> elements from virConnectGetCapabilities() 2019-03-05 10:07:21 +00:00
designer.py add mtu to libvirt xml for ethernet and bridge types 2018-06-06 09:39:40 -04:00
driver.py Move libvirt calculation of machine type to utils.py 2019-03-19 22:28:33 +00:00
firewall.py Add missing ws seperator between words 2018-11-26 23:42:18 +00:00
guest.py Add missing libvirt exception during device detach 2019-03-07 00:04:48 +00:00
host.py Transform libvirt.error notification 2018-09-18 07:06:09 +00:00
imagebackend.py libvirt: set device address tag only if setting disk unit 2019-04-17 18:21:04 +00:00
imagecache.py Move the dac_admin privsep code to a new location. 2017-09-18 23:14:11 +10:00
instancejobtracker.py Remove translation of log messages 2017-06-13 11:20:28 +07:00
migration.py libvirt: remove live_migration_progress_timeout config 2018-12-14 14:50:38 -05:00
utils.py Move libvirt calculation of machine type to utils.py 2019-03-19 22:28:33 +00:00
vif.py Move set_vf_interface_vlan to be with its only caller. 2019-03-05 22:18:08 +00:00