Commit Graph

51744 Commits

Author SHA1 Message Date
Yikun Jiang 57b0bb3749 Add rules column to instance_group_policy table.
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
2018-07-09 10:15:47 -07:00
Zuul 194e842c30 Merge "move lookup of provider from _new_allocations()" 2018-07-09 16:31:49 +00:00
Stephen Finucane 51248a4c01 objects: Add RequestSpec.network_metadata
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
2018-07-09 17:24:43 +01:00
Takashi NATSUME 3b01a728ce api-ref: Example verification for servers.inc
This patch verifies request and response bodies in servers.inc.

Change-Id: I9266e7513ed6eb00599dc766081ce81014a209bb
Closes-Bug: #1739573
2018-07-09 14:47:46 +00:00
Zuul c0350da4a1 Merge "Merge server create for security group extension" 2018-07-09 12:18:28 +00:00
Zuul 3591cf7927 Merge "Merge server create for user data extension" 2018-07-09 12:18:20 +00:00
Stephen Finucane d985d66261 hardware: Start accounting for networks in NUMA fitting
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
2018-07-09 11:20:39 +01:00
Stephen Finucane 02cea6a46f objects: Add NUMATopologyLimits.network_metadata
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
2018-07-09 10:08:08 +01:00
Gábor Antal ab2279eb09 Transform instance.rebuild_scheduled notification
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
2018-07-09 09:55:40 +09:00
Matthew Booth 6ad24f45b6 Remove irrelevant comment
This comment no longer adds value.

Change-Id: If820b1e8950371237fd96e0b09afc8f3ebfb93e9
2018-07-07 23:20:43 +01:00
Chen bbee9a26a5 Fix server_group_members quota check
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
2018-07-06 16:57:31 -04:00
Matt Riedemann f9874e059d Add functional regressions tests for server_group_members OverQuota
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
2018-07-06 16:57:26 -04:00
Matt Riedemann 2baa223c02 Handle compare in test_pre_live_migration_volume_backed* directly
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
2018-07-06 11:46:20 -04:00
Zuul fcf406003b Merge "Fix whitespace damage" 2018-07-06 15:10:52 +00:00
deepak_mourya a6411afbfa Resource_provider API handler does not return specific error codes
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
2018-07-06 15:38:44 +05:30
Zuul 0e090f31e8 Merge "VMware: save VC reads for information that is static" 2018-07-06 01:17:49 +00:00
Zuul 390123434c Merge "cover migration cases with functional tests" 2018-07-06 00:55:10 +00:00
Zuul ef35e47e40 Merge "Use valid UUID in the placement gabbits" 2018-07-06 00:54:59 +00:00
Zuul 6454a18b12 Merge "Default embedded instance.flavor.disabled attribute" 2018-07-05 23:33:07 +00:00
Takashi NATSUME 9da28e8531 Remove mox in unit/network/test_neutronv2.py (2)
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
2018-07-05 21:58:59 +00:00
Matthew Booth 70236a3e88 Fix whitespace damage
Change-Id: Iae1b2a82f170ad878ab6ca194a14d93e260204e6
2018-07-05 13:48:39 +01:00
Balazs Gibizer 9012a09328 Use valid UUID in the placement gabbits
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
2018-07-05 14:09:04 +02:00
Béla Vancsics 379cf65d82 Transform instance.live_migration_post notification
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
2018-07-05 20:24:46 +09:00
Zuul 187f80a32c Merge "Time how long pre_live_migration() takes" 2018-07-05 09:37:03 +00:00
Zuul d6c677e18e Merge "Merge server create schema for user data extension" 2018-07-05 07:19:03 +00:00
Gábor Antal 8ddbe07e8f Transform instance.live_migration_rollback_dest notification
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
2018-07-05 13:19:32 +09:00
Zuul e019be3724 Merge "Remove remaining legacy DB API instance_group* methods" 2018-07-04 17:36:41 +00:00
Zuul a976a6e2b1 Merge "Fix unbound local when saving an unchanged RequestSpec" 2018-07-04 15:28:12 +00:00
Zuul 07d3844123 Merge "libvirt: add qemu version check when configuring mtu for network" 2018-07-04 14:54:20 +00:00
Zuul 87e1951a1b Merge "Merge server create schema for security group extension" 2018-07-04 06:18:33 +00:00
Zuul ccc3062446 Merge "Remove unused DB API instance_group_member* methods" 2018-07-04 05:37:29 +00:00
Zuul ab4275fb21 Merge "Prevent updating an RP's parent to form a loop" 2018-07-04 05:20:02 +00:00
Zuul 8d994608b8 Merge "Add action initiator attribute to the instance payload" 2018-07-04 05:19:56 +00:00
Jay Pipes 6d9c27e70e move lookup of provider from _new_allocations()
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
2018-07-03 17:19:29 -04:00
Zuul 34956bea4b Merge "conf: Resolve Sphinx errors" 2018-07-03 19:02:52 +00:00
Zuul d7ae3f82df Merge "Remove mox in sec group test and functional tests" 2018-07-03 18:59:39 +00:00
Zuul 6a10534526 Merge "[doc] enhance admin/configuration/api.rst" 2018-07-03 18:59:32 +00:00
Zuul 7a57c472bc Merge "conf: Correct documentation for '[pci] passthrough_whitelist'" 2018-07-03 18:59:26 +00:00
Matt Riedemann 7f81657818 Time how long pre_live_migration() takes
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
2018-07-03 14:53:29 -04:00
shuangyang.qian 2bca6431e6 Add action initiator attribute to the instance payload
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
2018-07-03 18:45:44 +00:00
Zuul df5c253b58 Merge "Merge server create schema for scheduler hint extension" 2018-07-03 18:11:56 +00:00
Zuul f9ef6eb6f4 Merge "Merge server create schema for multiple create extension" 2018-07-03 18:11:49 +00:00
Matt Riedemann 8df21c1e5f Default embedded instance.flavor.disabled attribute
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
2018-07-03 13:03:54 -04:00
Stephen Finucane d34d70c0a1 objects: Add NUMACell.network_metadata
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
2018-07-03 16:50:17 +01:00
Stephen Finucane 70538a5fbc network: Retrieve tunneled status in '_get_physnet_info'
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
2018-07-03 16:50:17 +01:00
Stephen Finucane de72526791 network: Always retrieve network information if available
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
2018-07-03 16:50:06 +01:00
Zuul 5d59bc6337 Merge "Update xenapi_disable_agent config option usage in docs" 2018-07-03 15:36:53 +00:00
Balazs Gibizer 63626a7bb9 cover migration cases with functional tests
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
2018-07-03 15:17:10 +02:00
Balazs Gibizer 08fb09e878 Fix unbound local when saving an unchanged RequestSpec
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
2018-07-03 13:02:54 +00:00
Zuul ee7c39e441 Merge "Handle nested serialized json entries in assertJsonEqual" 2018-07-03 12:54:22 +00:00