yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #83462
[Bug 1876301] Re: block_device_mapping_v2.disk_bus allows invalid values
Reviewed: https://review.opendev.org/724842
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=5913bd889f9d3dfc8d154415e666c821054c229d
Submitter: Zuul
Branch: master
commit 5913bd889f9d3dfc8d154415e666c821054c229d
Author: Lee Yarwood <lyarwood@xxxxxxxxxx>
Date: Fri May 1 14:20:04 2020 +0100
compute: Validate a BDMs disk_bus when provided
Previously disk_bus values were never validated and could easily end up
being ignored by the underlying virt driver and hypervisor.
For example, a common mistake made by users is to request a virtio-scsi
disk_bus when using the libvirt virt driver. This however isn't a valid
bus and is ignored, defaulting back to the virtio (virtio-blk) bus.
This change adds a simple validation in the compute API using the
potential disk_bus values provided by the DiskBus field class as used
when validating the hw_*_bus image properties.
Closes-Bug: #1876301
Change-Id: I77b28b9cc8f99b159f628f4655d85ff305a71db8
** Changed in: nova
Status: In Progress => Fix Released
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1876301
Title:
block_device_mapping_v2.disk_bus allows invalid values
Status in OpenStack Compute (nova):
Fix Released
Bug description:
Description
===========
There is no validation of the provided disk_bus in the API, with
libvirt this eventually leads to the driver and hypervisor eventually
ignoring the requested disk_bus and defaulting to virtio.
Steps to reproduce
==================
A common mistake for users to make is to request a virtio-scsi
disk_bus:
$ nova boot --flavor 2 --block-device id=a37d4630-fbc0-4b8e-
91a0-18346f907830,source=image,dest=volume,size=1,bus=virtio-
scsi,bootindex=0 --nic net-name=private test
Expected result
===============
This should be rejected as this is not a supported disk_bus, instead
scsi should be used.
Actual result
=============
The value is ignored and the instance defaults to a virtio bus.
Environment
===========
1. Exact version of OpenStack you are running. See the following
list for all releases: http://docs.openstack.org/releases/
master
2. Which hypervisor did you use?
(For example: Libvirt + KVM, Libvirt + XEN, Hyper-V, PowerKVM, ...)
What's the version of that?
Libvirt + KVM
2. Which storage type did you use?
(For example: Ceph, LVM, GPFS, ...)
What's the version of that?
N/A
3. Which networking type did you use?
(For example: nova-network, Neutron with OpenVSwitch, ...)
N/A
Logs & Configs
==============
$ nova boot --flavor 2 --block-device id=a37d4630-fbc0-4b8e-91a0-18346f907830,source=image,dest=volume,size=1,bus=virtio-scsi,bootindex=0 --nic net-name=private test
[..]
$ sudo virsh domblklist 45bee4d4-1092-4829-9d98-d32337eb6caf
Target Source
-----------------------------------------------------------------------------------------------------------------
vda /opt/stack/data/nova/mnt/896fb15da6036b68a917322e72ebfe57/volume-f866cbb6-b793-4c89-a7e2-b3e0c6f4c2e7
To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1876301/+subscriptions
References