nova/nova/objects
Lee Yarwood bbc562c572 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.

Conflicts:
    nova/tests/unit/compute/test_compute_api.py

NOTE(lyarwood): Conflict as If9c459a9a0aa752c478949e4240286cbdb146494 is
not present in stable/train. test_validate_bdm_disk_bus is also updated
as Ib31ba2cbff0ebb22503172d8801b6e0c3d2aa68a is not present in
stable/train.

Closes-Bug: #1876301
Change-Id: I77b28b9cc8f99b159f628f4655d85ff305a71db8
(cherry picked from commit 5913bd889f)
(cherry picked from commit fb31ae430a)
2020-09-03 15:24:37 +01:00
..
__init__.py object: Introduce Resource and ResourceList objs 2019-09-13 08:50:35 +00:00
agent.py Use nova.db.api directly 2018-07-10 14:56:27 +00:00
aggregate.py DB API changes to get non-matching aggregates from metadata 2019-09-12 16:56:32 -05:00
bandwidth_usage.py Stop handling 'update_cells' on 'BandwidthUsage.create' 2019-05-20 10:29:16 +01:00
base.py object: Introduce Resource and ResourceList objs 2019-09-13 08:50:35 +00:00
block_device.py Remove 'bdm_(update_or_create|destroy)_at_top' 2019-04-16 18:26:17 +01:00
build_request.py Fix listing deleted servers with a marker 2019-10-23 14:50:06 -04:00
cell_mapping.py Fix using template cell urls with nova-manage 2019-01-17 14:18:14 -08:00
compute_node.py hacking: Resolve W503 (line break occurred before a binary operator) 2019-06-24 14:24:06 -05:00
console_auth_token.py Reduce scope of 'path' query parameter to noVNC consoles 2019-10-01 22:16:42 +00:00
diagnostics.py Added nova objects for intance diagnostics 2017-05-30 00:39:44 +04:00
dns_domain.py Use nova.db.api directly 2018-07-10 14:56:27 +00:00
ec2.py objects: Remove unused ec2 objects 2019-07-10 16:15:20 +01:00
external_event.py API microversion 2.76: Add 'power-update' external event 2019-08-15 13:19:44 -04:00
fields.py compute: Validate a BDMs disk_bus when provided 2020-09-03 15:24:37 +01:00
fixed_ip.py Use nova.db.api directly 2018-07-10 14:56:27 +00:00
flavor.py Merge "Remove old flavor_create db api method" 2018-03-20 18:11:06 +00:00
floating_ip.py Use nova.db.api directly 2018-07-10 14:56:27 +00:00
host_mapping.py Warn for duplicate host mappings during discover_hosts 2019-06-13 17:18:16 +00:00
hv_spec.py objects: Move 'hv_type' to 'fields.HVType' 2016-11-25 16:19:43 +00:00
image_meta.py Add extra spec parameter and image property for memory encryption 2019-09-01 15:17:31 +01:00
instance.py objects: Update keypairs when saving an instance 2020-07-23 17:45:46 +01:00
instance_action.py Add InstanceAction/Event create() method 2019-08-07 17:56:01 -04:00
instance_fault.py Remove 'instance_fault_create_at_top' 2019-04-29 17:54:17 +01:00
instance_group.py Avoid unnecessary joins in InstanceGroup.get_hosts 2019-05-23 11:14:55 -04:00
instance_info_cache.py Remove 'instance_info_cache_update_at_top' 2019-04-29 17:55:41 +01:00
instance_mapping.py hacking: Resolve W503 (line break occurred before a binary operator) 2019-06-24 14:24:06 -05:00
instance_numa.py objects: Add 'InstanceNUMATopology.cpu_pinning' property 2019-09-18 00:19:33 +01:00
instance_pci_requests.py Remove stale nested backport from InstancePCIRequests 2020-06-26 12:58:38 +00:00
keypair.py Drop migrate_keypairs_to_api_db data migration 2019-04-03 11:42:48 -04:00
migrate_data.py New objects for NUMA live migration 2019-09-12 17:34:34 -04:00
migration.py Join migration_context and flavor in Migration.instance 2019-11-14 22:06:53 +00:00
migration_context.py object: Introduce Resource and ResourceList objs 2019-09-13 08:50:35 +00:00
monitor_metric.py Fix MonitorMetric obj_make_compatible 2016-09-12 14:10:41 +00:00
network.py Use nova.db.api directly 2018-07-10 14:56:27 +00:00
network_metadata.py Assorted cleanups from numa-aware-vswitches series 2018-07-27 09:49:12 -07:00
network_request.py Merge "Remove DictCompat from NetworkRequest" 2016-06-30 10:23:36 +00:00
numa.py Merge "objects: use all_things_equal from objects.base" 2019-09-24 16:51:11 +00:00
pci_device.py Use nova.db.api directly 2018-07-10 14:56:27 +00:00
pci_device_pool.py [2/3]Replace six.iteritems() with .items() 2017-01-09 09:11:00 +00:00
quotas.py Use nova.db.api directly 2018-07-10 14:56:27 +00:00
request_spec.py Note about Destination.forbidden_aggregates 2019-09-12 20:18:01 +00:00
resource.py libvirt: Enable driver discovering PMEM namespaces 2019-09-13 08:50:35 +00:00
security_group.py Use nova.db.api directly 2018-07-10 14:56:27 +00:00
security_group_rule.py Use nova.db.api directly 2018-07-10 14:56:27 +00:00
selection.py Move the to_dict() method to the Selection object 2017-12-07 15:01:09 +00:00
service.py NUMA live migration support 2019-09-12 17:34:34 -04:00
tag.py Use nova.db.api directly 2018-07-10 14:56:27 +00:00
task_log.py Use nova.db.api directly 2018-07-10 14:56:27 +00:00
trusted_certs.py Use nova.db.api directly 2018-07-10 14:56:27 +00:00
vcpu_model.py Use nova.db.api directly 2018-07-10 14:56:27 +00:00
virt_cpu_topology.py cleanup NovaObjectDictCompat from virt_cpu_topology 2015-08-05 08:56:30 +05:30
virt_device_metadata.py Use nova.db.api directly 2018-07-10 14:56:27 +00:00
virtual_interface.py Populate InstanceMapping.user_id during migrations and schedules 2019-03-08 19:01:25 -05:00
volume_usage.py Transform volume.usage notification 2018-10-09 06:28:11 +00:00