This adds the rules column to instance_group_policy table.
The ''Text'' column "rules" which is a dict, it can be
applied to the policy, and represents the rules for
specific policy.
Related to blueprint complex-anti-affinity-policies
Change-Id: I61ffb5ddb2d808bfef4e60088f4524bd98e0474e
We need a way to pass information about networks from the conductor to
the scheduler. These are not really part of the network requests but
rather metadata about these networks, meaning the 'NetworkRequest'
object doesn't really make sense. Instead, we use the recently added
'NetworkMetadata' object like the good citizens we are.
Part of blueprint numa-aware-vswitches
Change-Id: Icb295bbd8c83e2e340a7ac3ecc1f159e0db7c7b1
Modify the 'numa_fit_instance_to_host' function to take networks into
account. We don't yet do anything with this at runtime, given that we're
not populating host NUMA network information, but that can come later.
It also doesn't stop us from unit testing things, which is nice.
Part of blueprint numa-aware-vswitches
Change-Id: If6eb402428f29416ce01dfc32474248c560ae019
We need some way to pass the metadata about requested networks back from
nova-scheduler to nova-compute for using during claiming. This satisfies
that requirement.
Part of blueprint numa-aware-vswitches
Change-Id: I3f62b2770dc2df70636f3cefa9144fde3c97ce42
The instance.rebuild_scheduled notification has been transformed
to the versioned notification framework.
Co-Authored-By: Takashi Natsume <natsume.takashi@lab.ntt.co.jp>
Change-Id: I640562b8dd049ff5b6fea9286dc3082b9d837ed3
Implements: bp versioned-notification-transformation-rocky
For example there are 3 instances in a server group (quota is 5).
When doing multi-creating of 3 more instances in this group
(would have 6 members), current quota checking scheme will fail to
prevent this happening, which is not expected.
This is due to the server_group_members quota check previously
only counting group members that existed as instance records in
cell databases and not accounting for build requests which are
the temporary representation of the instance in the API database
before the instance is scheduled to a cell.
Co-Authored-By: Matt Riedemann <mriedem.os@gmail.com>
Change-Id: If439f4486b8fe157c436c47aa408608e639a3e15
Closes-Bug: #1780373
Since we started counting quotas in Pike, it is possible to bypass
the server_group_members qouta check if either creating multiple
servers in a single request or creating one server each in multiple
concurrent requests. This is because the server_group_members
count is based on existing server group members in the cell database
and those group members (instances) don't get created in a cell until
we get to conductor and after the scheduler picks a host. In other
words, the server_group_members quota check in the API does not account
for build requests.
Change-Id: Icb268ca2f792bfcefd152ba4c6aa13270d9a7900
Related-Bug: #1780373
We can't use assertJsonEqual here even if that function deserializes
the nested connection_info_json. When deserializing the "bdms" entry
in the migrate_data object, it creates a random order on the list
which can still cause mismatch errors.
So rather than rely on assertJsonEqual handling this, that change
is reverted and we simply deserialize the connection_info_json
in the test in question before comparing to our expected data.
This reverts commit ac9acce283.
Change-Id: I7bba91e490a9ac5d0bbffa90e9cbefe60bb31f27
Closes-Bug: #1779711
There are a few places in the resource_provider.py placement
API handler module that need to be updated to return custom
error codes.
Change-Id: I7efdf7f82d581cf5dc9a3decc063b69c8cef22ff
Closes-Bug: #1778929
Replace mox with mock
in nova/tests/unit/network/test_neutronv2.py.
This patch moves the following methods in the TestNeutronv2 class
to the TestNeutronv2WithMock class.
* test_get_instance_nw_info_with_nets_add_interface
* test_get_instance_nw_info_remove_ports_from_neutron
* test_get_instance_nw_info_ignores_neutron_ports
* test_get_instance_nw_info_ignores_neutron_ports_empty_cache
* _fake_get_instance_nw_info_helper
The TestNeutronv2Base class will be removed and
the _TestNeutronv2Common class will be renamed to 'TestNeutronv2Base'
when replacing mox is completed in the file.
Subsequent patches will replace mox in other test cases.
Change-Id: Ibb6f70ebc9b7c169f493ebf693e98e65fa9881d0
Implements: blueprint mox-removal
It seems gabbi does not resolve yaml refs in the URL part of a REST
call. This causes that the tests in ensure-consumer.yaml uses invalid
consumer id '*consumer_id'
This patches replace the *consumer_id with a fixture ref that works.
Change-Id: I0576f282b1801340db6827fb4c9520a0d48ad7f0
Related-Bug: #1780238
The instance.live_migration_post.start and
instance.live_migration_post.end notifications have been transformed to
the versioned notification framework.
Co-Authored-By: Alex Szarka <szarka@inf.u-szeged.hu>
Co-Authored-By: Takashi Natsume <natsume.takashi@lab.ntt.co.jp>
Change-Id: If9993d5edab5a2f141387a8eb294a9645667ee6b
Implements: bp versioned-notification-transformation-rocky
The instance.live_migration_rollback_dest.start and
instance.live_migration_rollback_dest.end notifications has been
transformed to the versioned notification framework.
Co-Authored-By: Takashi Natsume <natsume.takashi@lab.ntt.co.jp>
Change-Id: I8129cbd1785133d4cc1b70bbba6bd7fcc1d21f4a
Implements: bp versioned-notification-transformation-rocky
Following patches will be heavily modifying the allocation handler's
_new_allocations() helper function, so this patch pulls part of that
function's purpose -- checking that resource provider UUIDs in the
allocation payload refer to existing resource providers -- out into a
separate helper function, thus reducing the size of the coming patches.
Change-Id: I2875a431726c5248b1522d28542b627d07856a39
Now that we have the long_rpc_timeout setting for
pre_live_migration rpc calls from the source to
destination host, timing that operation is a bit more
interesting so this adds a timer and log message
for how long that round-trip takes.
Change-Id: I88d1a5fb2576ff7ac81981798d300a27030f74f7
The instance action notifications contain the user id and the
project id of the owner of the instance. However an instance
action might be initiated by another user. It could be another
user from the same project or can be an admin from the admin project.
To be able to distinguish between the user who initiated the instance
action from the user owning the instance we need to add two new
fields to the instance action notifications, action_initiator_user
and action_initiator_project
Change-Id: I649d8a27baa8840bc1bb567fef027c749c663432
Closes-bug: #1744658
Blueprint: add-action-initiator-to-instance-action-notifications
Before we stored flavors in instance_extra, certain fields, defined
in nova.compute.flavors.system_metadata_flavor_props, were stored
in the instance.system_metadata for the embedded instance.flavor.
The "disabled" field wasn't one of those keys, however, so really
old instances that had their embedded flavor converted to the
serialized instance_extra form won't have the disabled attribute
set and we need to default those here so callers, like the
versioned notfication FlavorPayload, don't explode trying to load
instance.flavor.disabled.
Change-Id: I72f8c11b8b2df1416dec8e2d9250eac0693a30e9
Closes-Bug: #1739325
This will be used to keep track of the physical networks and potential
tunneled network that are affined with this given NUMA cell. It's
implemented by way of the recently added 'NetworkMetadata' object. We
don't currently populate this - that will come at the end of the series.
Part of blueprint numa-aware-vswitches
Change-Id: I9140ddae666f9c994c7954bc2e690ac1064a89de
This determines whether the network is an L3 tunnel provider network and
allows us to populate the appropriate attribute on the 'NetworkMetadata'
object returned by the function. This requires renaming the function to
represent its new purpose.
Part of blueprint numa-aware-vswitches
Change-Id: I535a64ab16abc9a7d34220fcc3dba36a4d663bfe
We're going to need to consume information about the physnet and tunnel
status of networks. While we don't currently retrieve the latter, we do
retrieve the former but only for SR-IOV ports. Modify this so physnet
information is retrieved for any non-auto and non-null network requests.
This is stored in a new object, 'NetworkMetadata', which defines fields
for both physnets and tunneled networks. The latter attribute of this
object is unset for now, but this is not an issue as the value returned
from this function is not yet used.
Part of blueprint numa-aware-vswitches
Change-Id: I3dde6074d69e299f2844675ef968c8f949722395
As we found multiple bugs in the server moving cases this patch adds
test to cover the migrate confirm and migrate revert cases as well.
It seems that these two cases work as expected.
Change-Id: I40a244601e1612a87bd41cd6ad652202035a1ce4
RequestSpec._get_update_primitives() tried to return the unitialized
db_updates field when the object has no changes. This patch initalizes
that local to None and handles that None in create() and save() where
the RequestSpec._get_update_primitives() is called.
Change-Id: Iad256079945bf8b5745ebdcc393c55115dbcab75
Closes-Bug: #1775863