Commit Graph

51569 Commits

Author SHA1 Message Date
Yikun Jiang 5cdb1ce26b Microversion 2.64 - Use new format policy in server group
Enable users to define the policy rules on server group policy
to meet more advanced policy requirement. This microversion
brings the following changes in server group APIs:

* Add  ``policy`` and ``rules`` fields in the request of POST
  ``/os-server-groups``.
* The ``policy`` and ``rules`` fields will be
  returned in response body of POST, GET ``/os-server-groups``
  API and GET ``/os-server-groups/{server_group_id}`` API.
* The ``policies`` and ``metadata`` fields have been removed
  from the response body of POST, GET ``/os-server-groups`` API
  and GET ``/os-server-groups/{server_group_id}`` API.

Part of blueprint: complex-anti-affinity-policies

Change-Id: I6911e97bd7f8df92511e90518dba21c127e106a5
2018-07-13 10:43:42 +08:00
Yikun Jiang 09f67d7789 Adapt _validate_instance_group_policy to new policy model
To solve the race condition problem, we do anti-affinity policy
sanity check in the instance build code of compute manager, but
this check is only valid in original policy.

Specifically, this change adds validation of the new
max_server_per_host policy rule which can be used to allow >1
anti-affinity group member on the same host.

blueprint: complex-anti-affinity-policies

Change-Id: I755b6fdddc9d754326cd9c81b6880581641f73e8
2018-07-12 10:32:14 +08:00
Yikun Jiang a77f57acf7 Change the ServerGroupAntiAffinityFilter to adapt to new policy
In this patch, the anti-affinity filter will get the
max_server_per_host limit from policy rules, and compare it
against the number of servers within the same group on a given
host. If the filter finds the number is not satisfied with the
limit, it will filter out this host.

The default ``max_server_per_host`` for the anti-affinity filter
is 1 for backward compatibility.

Change-Id: I4b67ec9dd4ce846a704d0f75ad64c41e693de0fb
blueprint: complex-anti-affinity-policies
2018-07-12 10:30:10 +08:00
Yikun Jiang c67ab38ea0 Add policy field to ServerGroup notification object
In this patch, the ServerGroupPayload is updated to include
the new ``policy`` field; the ``policies`` field is deprecated
for removal but still put into the notification payload for
backward compatibility.

Related to blueprint complex-anti-affinity-policies

Change-Id: Ie739ee8dec4685cd70e735ff83f7f30bc7e95a57
2018-07-12 10:00:05 +08:00
Yikun Jiang 8fa70e5dfc Add policy to InstanceGroup object
The change items in this patch as below:
1. Add policy and rules to InstanceGroup, deprecate
the policies field.
2. Also, make _from_db_object and _create_in_db method to
support new "policy" field.

The internal usage of InstanceGroup.policies is converted to
use the new model in the REST API and RequestSpec compat code.

Related to blueprint complex-anti-affinity-policies

Change-Id: Ib33719a4b9599d86848c618a6e142c71ece79ca5
2018-07-12 09:30:41 +08:00
Yikun Jiang afc7650e64 Refactor policies to policy in InstanceGroup DB model
A group can only have 1 policy associated it, but now we have
ONE to MANY model in group model, this patch change it to ONE
to ONE Model.

We also adapt create method to new model, and remove policy
update support in group.save because now we don't support to
update a policy of the group.

Related to blueprint complex-anti-affinity-policies

Change-Id: I95eb1c8470a567408696132ae656305be53dc5bb
2018-07-09 10:15:48 -07:00
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 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
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
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
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
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
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
Zuul ea06a3138e Merge "Merge server create schema for keypair extension" 2018-07-03 08:31:27 +00:00
Balazs Gibizer 00b13a2e2f Prevent updating an RP's parent to form a loop
Placement had RP loop detection for RP creation but if an RP is created
without a parent (e.g. root RP) then the parent can be set later with a
PUT /resource_providers/{uuid} request by providing the UUID of the
parent. In this code path the loop detection was missing from the
validation. Moreover there are different loop cases for create than for
set. For create the only possible loop is when the RP being created is
points to itself as a parent. However when the parent is provided later
in a PUT the RP being updated can have descendant RPs. Setting a parent
to a descendant also creates a loop.

This patch adds the missing check and returns HTTP 400 if loop is detected.

Closes-Bug: #1779635
Change-Id: I42c91f5f752f0a4fba8b1d95489fc3f87a1c5b6e
2018-07-03 10:08:04 +02:00
Zuul 9382b78542 Merge "Remove mox in unit/network/test_neutronv2.py (1)" 2018-07-02 23:11:09 +00:00
Zuul 499ec02cda Merge "Regression test for bug 1779635" 2018-07-02 21:28:43 +00:00
Zuul 84ebc21ea7 Merge "Request only instance_uuid in ironic node list" 2018-07-02 20:04:07 +00:00
Zuul d34543eb10 Merge "Remove unnecessary execute permissions of a file" 2018-07-02 18:00:31 +00:00
Zuul 90c0982a0b Merge "Fix missing versioned notification examples" 2018-07-02 16:53:51 +00:00
Matt Riedemann ac9acce283 Handle nested serialized json entries in assertJsonEqual
test_pre_live_migration_volume_backed* tests are comparing
primitive versions of LibvirtLiveMigrateData objects which
nest primitive LibvirtLiveMigrateBDMInfo which have
serialized connection_info_json fields in them, which can
have a random key order when comparing which makes the tests
fail. This changes assertJsonEqual to try and deserialize
nested json strings like it does for the top level expected
and observed variables, and updates the test to use
assertJsonEqual.

Change-Id: Ief1634f7e31c473b226e9f19240ecd21840ebdb3
Closes-Bug: #1779711
2018-07-02 12:28:39 -04:00
Sahid Orentino Ferdjaoui e2d7189f4f libvirt: add qemu version check when configuring mtu for network
This adds a QEMU check when configuring MTU for ethernet and bridge
interface types. When creating and configuring tap devices, libvirt is
setting MTU but also configures the virtio-net devices to let it
discovers the MTU used. This QEMU 'host_mtu' option is supported by
QEMU version 2.9 and more.

Closes-Bug: 1779626
Change-Id: I55cf259c715ba129fa8479d1e8a0d11ec15aaa43
Signed-off-by: Sahid Orentino Ferdjaoui <sahid.ferdjaoui@redhat.com>
2018-07-02 17:47:16 +02:00
Zuul 0ef62de888 Merge "Simplify instance name generation" 2018-07-02 13:18:04 +00:00
Stephen Finucane e2b790e8e8 conf: Resolve Sphinx errors
This resolves all the warnings currently emitted by oslo.config for nova
and makes the output nicer looking to boot. There are still some issues
but these lie without other projects (osprofiler, oslo.db) and will be
resolved in a future update of those packages.

Change-Id: Ie4eddda36439e6746cb2d97e43b91f63d835877b
2018-07-02 14:00:12 +01:00
Zuul 1f91390c52 Merge "Update admin/flavors document" 2018-07-02 12:34:48 +00:00
Zuul 9fa29058c4 Merge "Fix regression when listing build_requests with marker and ip filter" 2018-07-02 12:34:36 +00:00
Zuul 503025873c Merge "Resource tracker: improve resource tracker periodic task" 2018-07-02 12:34:28 +00:00
Zuul c7197ce679 Merge "Clarify log in RT._update_usage_from_migration" 2018-07-02 11:05:25 +00:00
Zuul ccd254acd8 Merge "More config drive docs updates" 2018-07-02 11:04:51 +00:00