libvirt driver needs to use it's own logic for determining the device name that will be persisted in Nova instead of the generic methods in nova.compute.utils, since libvirt cannot really assign the device name to a block device of an instance (it's treated as a ordering hint only), and we need to make sure that information in the Nova DB matches what will be assigned.
We already have this logic in nova.virt.libvirt.blockinfo and is being called for booting instances, however when attaching volumes to an already running instance we rely on nova.compute.utils.get_device_name_for_instance() which will do the wrong thing in a number of cases (for example volumes using different bus (see bug #1379212), instances with an ephemeral disk etc.)
Current master is: 0b23bce359c8c92715695cac7a6eff7c473ad8c2
Fix proposed to branch: master /review. openstack. org/180635
Review: https:/