This patch changes v3 shelve API to v2.1 and makes v2
unit tests share between v2 and v2.1.
The differences between v2 and v3 are described on the wiki page
https://wiki.openstack.org/wiki/NovaAPIv2tov3 .
Partially implements blueprint v2-on-v3-api
Change-Id: Ie4cd72d23592fe2bd1a66137b12bb84400ccfc18
This change fixes a bug in Nova's
GET /v2/{tenant_id}/os-networks
The doc
http://docs.openstack.org/api/openstack-compute/2/content/GET_os-networks-v2_ListNetworks__v2__tenant_id__os-networks_ext-os-networks.html
says that "Lists networks that are available to the tenant".
When invoked by a non-admin user it was returning only networks
assigned to the user's tenant. But in flat and flat DHCP nova
networking, networks CAN NOT be assigned to tenants --- thus a
non-admin user would get zero networks from this operation.
The fix was to make this operation conditionally use an option already
present in the lower-level code to "allow_none" when fetching the list
of networks, meaning to include networks whose project_id field in the
DB held "none" (meaning the network is not assigned to a tenant). The
condition under which this is done is that the Nova configuration
option named network_manager contains the string
"'nova.network.manager.Flat" --- which is true for flat and flat DHCP
nova networking and false for VLAN nova networking.
Change-Id: I64c5a3f31c912cca6b5b9987152ba7a9b3f5987d
Closes-Bug: #1327406
Dict of aggregate metadata sometimes contains a lot of items,
so while adding of metadata current implementation make a lot
of inserts in database.
Using multirow INSERT instead of INSERT statement allows to
decrease amount of queries to one single query per operation.
Change-Id: I6b842459cf198f8577b615aeba091723dcb18429
test_suspend() was passing an instance object, but test_suspend_error and
test_suspend_not_implemented were passing a dict. This change makes them all
pass an object.
In updating test_suspend_error and test_suspend_not_implemented, we also
convert both to use mock.
Change-Id: I97e28d50a99e920f7aa4f3586446e3fefe807658
We can get this information from the libvirt capabilities XML now, so we
add a method that returns it in the form of
virt.hardware.VirtNUMATopology objects. We will exclude any CPUs not
found in the CONF.vcpu_pin_set.
Change-Id: Ibfc60bc71e49579bc5ab4996b752ed7a49830b6a
Blueprint: virt-driver-numa-placement
This patch adds the table for storing the instance NUMA topology, as
adding it on the model itself as a text field is thought to be bad for
perfomance.
We need to add it as scheduling based on it and tracking resources
proves to be impossible otherwise as we would have to rely on
re-calculating it from data stashed in system_metadata table, which is
deemed even more inefficient if it needs to be done in a periodic task.
We add the objects so that we can make sure that data is versioned, and
the relevant database models methods and the migration for adding the
table.
Blueprint: virt-driver-numa-placement
Change-Id: I724ed7089044177ec4fecdf4fdcefad96a2466b6
It would be nice use decorator `serialize_args` as general-use
decorator. Note that this single-purpose decorator was covering
up our ability to drill down to the actual method implementation
for hash calculation in the TestObjectVersions test. This patch
also enhances the decorator to be transparent, and makes the
test able to drill down through multiple layers of decorators
to find the actual implementation.
Co-Authored-By: Dan Smith <dansmith@redhat.com>
Change-Id: Ie454bffba113d7b3a863e975b2fb0ee6fb1dd552
This patch changes v3 certificate API to v2.1 and makes v2
unit tests share between v2 and v2.1.
The differences between v2 and v3 are described on the wiki page
https://wiki.openstack.org/wiki/NovaAPIv2tov3.
Partially implements blueprint v2-on-v3-api
Change-Id: I8e6556dffbc14334f7ec1b9db38fbbfe2387bef0
In the beginning v3 didn't support legacy block_device_mapping request.
For v2.1, we want to keep back-compatibility with v2 api, so we need
add legacy block_device_mapping.
This patch add new extension block_device_mapping_v1 for v2.1. Also
share legacy block_device_mapping related unittests between v2 and v2.1.
Partially implements blueprint v2-on-v3-api
Change-Id: I841833d8fd0995ddf49febd9c1611cf711742f5a
For v2.1 api, we should catch exception explicitly. There are some
BDM related InvalidBDM* exceptions missing catch. This patch fix this.
Also move the related unittests into block_device_mapping unittests.
Change-Id: Id1bef4adc71ffedd52eb9278b5d09954fc1b1193
This patch changes v3 block_device_mapping API to v2.1 and make
unittest share between v2 and v2.1
The differences between v2 and v3 are described on the wiki page
https://wiki.openstack.org/wiki/NovaAPIv2tov3.
Partially implements blueprint v2-on-v3-api
Change-Id: I935b336523241a32dbd2bb8b154ce72afefd3aa9