Currently it is not possible to override an existing image block device
by supplying the device with the same name at boot (see also
Ib1ba130042aabbbe7bb8d60fc212c66e446c1d73). Even though we want to
discourage usage of device names as much as possible in the Nova API (as
not all hypervisors can honour them), EC2 API requires that this is possible.
While we want to make sure we document that supplying device names at
boot is only really desirable if you want to override some of the ones
contained in the image, introducing a different labeling system just so
that we don't use the device names seems like an overkill for a feature
that does not seem to be very used.
This patch adds a method that will do this deterministically when
compiling all the block device information for the request.
It is also worth noting that The EC2 API allows only subset of block
device attributes to be overridden in this way (see [1]). This limitation
did not exist previously in Nova, and there seems to be no reason why we
would need that complexity, so it would be up to the EC2 compatibility
code to deal with this.
[1] https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concepts.html#Using_OverridingAMIBDM
Doc-Impact
Closes-bug: #1370250
Change-Id: I60ecdcae81ff5dec34f0fa0a39e0739759a6fa59