Commit Graph

56537 Commits

Author SHA1 Message Date
Zuul e0dd08c4ea Merge "Fix os-attach-interfaces policy to be admin_or_owner" 2020-03-02 19:33:24 +00:00
Zuul e1d61f6bf4 Merge "Define Cyborg ARQ binding notification event." 2020-03-02 17:25:54 +00:00
Zuul 0296e43a13 Merge "Add test coverage of existing os-agents policies" 2020-03-02 16:29:49 +00:00
Zuul ded3209058 Merge "Introduce scope_types in os-evacuate" 2020-03-02 15:40:08 +00:00
Zuul c8fb3f9612 Merge "Add test coverage of existing evacuate policies" 2020-03-02 14:28:02 +00:00
Zuul de22af97ab Merge "Add new default roles in os-availability-zone policies" 2020-03-02 14:27:49 +00:00
Zuul 2c91fccc0d Merge "Introduce scope_types in os-availability-zone" 2020-03-02 13:49:30 +00:00
Zuul f5f05516a2 Merge "Add test coverage of existing availability-zone policies" 2020-03-02 13:49:23 +00:00
Zuul 9460515205 Merge "Correct os-availability-zone policy check_str" 2020-03-02 13:49:16 +00:00
Zuul 7218e4a313 Merge "Add test coverage of existing admin_password policies" 2020-03-02 11:59:17 +00:00
Zuul 840defaaba Merge "libvirt: Provide the backing file format when creating qcow2 disks" 2020-03-02 11:28:54 +00:00
Ghanshyam 728f2b215e Fix os-attach-interfaces policy to be admin_or_owner
os-attach-interfaces APi policy is default to admin_or_owner[1] but API
is allowed for everyone.

We can see the test trying with other project context can access the API
- https://review.opendev.org/#/c/705126/1

This is because API does not pass the server project_id in policy target[2]
and if no target is passed then, policy.py add the default targets which is
nothing but context.project_id (allow for everyone who try to access)[3]

This commit fix this policy by passing the server's project_id in policy
target.

[1] https://github.com/openstack/nova/blob/c16315165ce307c605cf4b608b2df3aa06f46982/nova/policies/attach_interfaces.py#L28
[2] https://github.com/openstack/nova/blob/c16315165ce307c605cf4b608b2df3aa06f46982/nova/api/openstack/compute/attach_interfaces.py#L70
[3] https://github.com/openstack/nova/blob/c16315165ce307c605cf4b608b2df3aa06f46982/nova/policy.py#L191
Closes-bug: #1861464

Change-Id: I1e2247884169e6ba3e5302be4323428c67ce7a10
2020-03-02 10:49:31 +00:00
Ghanshyam Mann 0068bee2d7 Add test coverage of existing os-agents policies
Current tests do not have good test coverage of existing policies.
Either tests for policies do not exist or if they exist then they
do not cover the actual negative and positive testing.

For Example, if any policy with default rule as admin only then
test should verify:
- policy check pass with context having admin role
- policy check fail with context having any other role than admin

As discussed in policy-defaults-refresh [1], to change the policies
with new default roles and scope_type, we need to have the enough
testing coverage of existing policy behavior.
When we will add the scope_type in policies or new default roles,
then these test coverage will be extended to adopt the new changes
and also make sure we do not break the existing behavior.

This commit covers the testing coverage of existing os-agents
policies.

Partial implement blueprint policy-defaults-refresh

[1] https://specs.openstack.org/openstack/nova-specs/specs/ussuri/approved/policy-defaults-refresh.html#testing

Change-Id: I073900e0d39d3924e82d173ae7cd5a6f24789d5e
2020-03-02 10:26:48 +00:00
Sundar Nadathur c6365f1b55 Define Cyborg ARQ binding notification event.
APIImpact: Adds 2.82 microversion for /os-server-external-events API.
DocImpact: Adds new version to doc/api_samples/versions/.

Change-Id: I7a626544d8221dc0eeb5672986ca897ce4718be8
Blueprint: nova-cyborg-interaction
2020-03-01 13:52:51 -08:00
Zuul 9dbba6915c Merge "Fix H702 pep8 error with latest hacking" 2020-02-28 21:13:44 +00:00
Ghanshyam Mann 320429efb5 Fix H702 pep8 error with latest hacking
nova test job on hacking master is failing
with

2020-02-24 01:14:53.698965 | ubuntu-bionic | ./nova/api/metadata/handler.py:251:55:
H702: Formatting operation should be outside of localization method call

- https://review.opendev.org/#/c/705514/

This is H702 error for localization formatting.

Change-Id: I9eaa90c273327a3ca0ca1722a45017e59e9f0f0c
2020-02-27 21:22:09 -06:00
Zuul 392bfe8670 Merge "Avoid allocation leak when deleting instance stuck in BUILD" 2020-02-28 01:02:52 +00:00
Lee Yarwood 0cfe9c81e3 libvirt: Provide the backing file format when creating qcow2 disks
Libvirt v6.0.0 [1] will now fail to launch a domain when using qcow2
disks where the backing file format is not recorded in the qcow2
metadata.

There are some discussions upstream around relaxing this slightly [2]
but for now any attempt to launch an instance using qcow2 disks will
fail as Nova does not populate this value when creating the disk.

Nova needs to at a minimum start populating this field and depending on
the outcome of the thread upstream in Libvirt also potentially handle
the upgrade case where we may need to rebase existing disks in order to
update the metadata.

For now this change simply adds the backing_fmt option to the qemu-img
command line used to create these disks.

[1] https://github.com/libvirt/libvirt/commit/3615e8b39badf2a526996a69dc91a92b04cf262e
[2] https://www.redhat.com/archives/libvir-list/2020-February/msg00616.html

Partial-Bug: #1864020
Change-Id: I77ebada015f6522a300be4fa043fb8676458402b
2020-02-26 18:26:47 +00:00
Zuul 4ba79539c8 Merge "trivial: Use recognized extra specs in tests" 2020-02-26 12:08:11 +00:00
Zuul 4cf008135f Merge "docs: Improve documentation on writing custom scheduler filters" 2020-02-26 12:08:01 +00:00
Zuul 238994b001 Merge "conf: Deprecate '[scheduler] driver'" 2020-02-26 12:07:52 +00:00
Zuul 916c542b4b Merge "trivial: Remove FakeScheduler" 2020-02-26 12:07:45 +00:00
Zuul a83d853610 Merge "Use reasonable name for provider mapping" 2020-02-25 19:29:18 +00:00
Zuul 50dd642950 Merge "Functional test for UnexpectedDeletingTaskStateError" 2020-02-25 19:29:02 +00:00
Zuul 685faa0def Merge "Remove unnecessary parentheses" 2020-02-25 19:28:48 +00:00
wangjiajing f3731b3e15 Remove unnecessary parentheses
The @wsgi.expected_errors decorator can take a list or a single int
as parameter. For some reason there are calls in a form of
@wsgi.expected_errors((<error code>)).



Change-Id: Ief196bb588e53f503c54b2ef0c51bc9a937b4b15
2020-02-25 09:00:01 +00:00
Zuul 270a61e749 Merge "Deprecate base rules in favor of new rules" 2020-02-25 03:18:08 +00:00
Zuul bfe681cd29 Merge "Allow TLS ciphers/protocols to be configurable for console proxies" 2020-02-24 17:27:02 +00:00
Matthew Booth 10434bd229 Functional test for UnexpectedDeletingTaskStateError
Adds a regression-style test for two cleanup bugs when
'UnexpectedDeletingTaskStateError' is raised during build.

Change-Id: Ief1dfbb6cc9d67b73dfab4c7b63358e76e12866b
Related-Bug: #1848666
Related-Bug: #1831771
2020-02-24 14:34:29 +00:00
Alexandre Arents f35930eef8 Avoid allocation leak when deleting instance stuck in BUILD
During instance build, conductor claim resources to scheduler
and create instance DB entry in cell.

If for any reason conductor is not able to complete a build after
instance claim (ex: AMQP issues, conductor restart before build completes)
and in the mean time user requests deletion of its stuck instance in BUILD,
nova api will delete build_request but let allocation in place resulting
in a leak.

The change proposes that nova api ensures allocation cleanup is made
in case of ongoing/incomplete build.
Note that because build did not reach a cell, compute is not able to heal
allocation during its periodic update_available_resource task.
Furthermore, it ensures that instance mapping is also queued for deletion.

Change-Id: I4d3193d8401614311010ed0e055fcb3aaeeebaed
Closes-Bug: #1859496
2020-02-24 09:34:02 +00:00
Zuul f4fcc24bd0 Merge "trivial: Remove 'run_once' helper" 2020-02-22 01:53:55 +00:00
Zuul f0eb05a68f Merge "trivial: Merge unnecessary 'NovaProxyRequestHandlerBase' separation" 2020-02-22 00:22:06 +00:00
Zuul f9cdeb8a98 Merge "trivial: Bump minimum version of websockify" 2020-02-21 17:53:26 +00:00
Zuul 2f23f56250 Merge "trivial: Fetch 'Service' objects once when building AZs" 2020-02-21 17:53:18 +00:00
Zuul 07cb3eec4b Merge "trivial: Update '_get_foo_traits' docstrings" 2020-02-20 23:59:07 +00:00
Zuul 2562595099 Merge "Clean up allocation if unshelve fails due to neutron" 2020-02-20 17:06:01 +00:00
Stephen Finucane 298054e640 trivial: Update '_get_foo_traits' docstrings
These stated they could return None but that wasn't true. Correct this.

Change-Id: I3bbeedef70e4b94225e1a042cf4e59fb12bcaa92
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2020-02-20 15:05:31 +00:00
Zuul 89891959d9 Merge "zuul: Add Fedora based jobs to the experimental queue" 2020-02-20 15:03:03 +00:00
Zuul 08b98d75cf Merge "Use tempest-full-py3 as base job" 2020-02-20 14:19:14 +00:00
Zuul 2c981d47eb Merge "Reproduce bug 1862633" 2020-02-20 07:32:51 +00:00
Zuul d40558497d Merge "trivial: Remove unused 'cache_utils' APIs" 2020-02-20 02:31:24 +00:00
Zuul 9a1595c912 Merge "Follow-up: Add delete_on_termination to volume-attach API" 2020-02-20 00:38:42 +00:00
zhangbailin dcac6825c5 Follow-up: Add delete_on_termination to volume-attach API
Some comment mainly from gmann and takashin in [1] PS15.
Add some tests in test_volumes.py, and fix some docs error.

[1]https://review.opendev.org/#/c/673133/15/nova/tests/unit/api/openstack/compute/test_volumes.py@1902

Depends-On: https://review.opendev.org/#/c/673133/
Part of blueprint support-delete-on-termination-in-server-attach-volume

Change-Id: I8dfa61f03ce927a1e86d42f8fb03bf4cb3e48160
2020-02-19 19:12:21 +00:00
Zuul a19cfa5cf6 Merge "Avoid PlacementFixture silently swallowing kwargs" 2020-02-19 17:17:33 +00:00
Zuul 676cfdba27 Merge "Remove universal wheel configuration" 2020-02-19 17:17:26 +00:00
Zuul a3d4ebd3c9 Merge "tests: Validate huge pages" 2020-02-19 13:58:37 +00:00
Zuul a7cc98e997 Merge "Absolutely-non-inheritable image properties" 2020-02-19 13:58:29 +00:00
Balazs Gibizer 42f42a396c Avoid PlacementFixture silently swallowing kwargs
When using PlacementFixture, we can pass some arguments to the CRUD operators.
That said, given the fake methods use kwargs, the fixture won't raise a
TypeError if the parameter name is wrong like the reportclient would do.
Adding a new decorator for verifying it.

Change-Id: Icd3f9e16ac31ea7220052770390aaf4b38e1c469
2020-02-19 11:02:28 +00:00
Stephen Finucane 9009d56d21 trivial: Use recognized extra specs in tests
Tests were previously using arbitrary keys that weren't published
anywhere in the codebase. Switch to using meaningful ones.

Change-Id: I8da84b48e4d630eeb91d92346aa2323e25e28e3b
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2020-02-19 08:24:31 +00:00
Zuul 157daff9e4 Merge "Reject boot request for unsupported images" 2020-02-19 04:15:20 +00:00