Commit Graph

56860 Commits

Author SHA1 Message Date
Sundar Nadathur 0a795a3b64 Add release notes for Cyborg-Nova integration.
Change-Id: I4b630d755f99863faf6a432b086608d494ef3cc3
Blueprint: nova-cyborg-interaction
2020-04-03 17:13:04 +08:00
Zuul acc0dc31c3 Merge "Combine the limits policies in single place" 2020-04-02 14:20:18 +00:00
Zuul 43f30e876d Merge "Add new default roles in remote console policies" 2020-04-02 11:03:44 +00:00
Zuul 241cffbeba Merge "Add new default roles in rescue server policies" 2020-04-01 23:29:59 +00:00
Ghanshyam Mann 1c45a2f435 Add new default roles in remote console policies
This adds new defaults roles in remote console  API policies.
- lock/unlock policies are default to system admin or project member.
- unlock server locked by other is system admin.

Also add tests to simulates the future where we drop the deprecation
fall back in the policy by overriding the rules with a version where
there are no deprecated rule options. Operators can do the same by
adding overrides in their policy files that match the default but
stop the rule deprecation fallback from happening.

Partial implement blueprint policy-defaults-refresh

Change-Id: Ic81da0ebc23d6526c5ca2d9d98159e07f3e53822
2020-04-01 20:02:17 +00:00
Ghanshyam Mann c15ffc2ee2 Combine the limits policies in single place
limits and used_limits extensions were megred in
- I76e02214e958a55b6de8033243b46b259949e5ac

But policy were left in separate file. limits policy
is in policies/limits which is general policy to get the
limit of project. used_limit is in polocies/used_limit
which is enforced in view builder for gettting the limit
of other project.

This commit:
- move used_limit in policies/limit file
- move the used_limit policy enforcement from view buidler to limit API controller.
- adjust the tests due to above changes.

Partial implement blueprint policy-defaults-refresh

Change-Id: Iefe41cc95cd967b368588dea5ff195bb4af3eca7
2020-04-01 19:58:22 +00:00
Zuul 9c18a3b9dc Merge "Correct limits policy check_str" 2020-04-01 18:55:05 +00:00
Zuul 24b2464cf2 Merge "Pass the actual target in os-hypervisors policy" 2020-04-01 18:54:59 +00:00
Zuul 3de3ef0660 Merge "libvirt: Remove QEMU_VERSION_REQ_SHARED" 2020-04-01 18:54:53 +00:00
Zuul b9843e80da Merge "images: Remove Libvirt specific configurable use from qemu_img_info" 2020-04-01 18:53:43 +00:00
Zuul af9e4d7812 Merge "libvirt: Always provide the size in bytes when calling virDomainBlockResize" 2020-04-01 18:53:38 +00:00
Zuul 0af8ddd54d Merge "Introduce scope_types in remote consoles policy" 2020-04-01 17:12:15 +00:00
Zuul 67f278ab04 Merge "Add test coverage of existing remote console policies" 2020-04-01 17:12:07 +00:00
Zuul 493bf817dd Merge "Introduce scope_types in rescue server policy" 2020-04-01 17:11:58 +00:00
Zuul 047132976b Merge "Add test coverage of existing rescue policies" 2020-04-01 17:11:48 +00:00
Zuul 38ceecb9b3 Merge "Pass the actual target in unlock override policy" 2020-04-01 17:11:41 +00:00
Zuul 1f6719f5b4 Merge "Add new default roles in lock server policies" 2020-04-01 17:11:35 +00:00
Zuul 0fb9302428 Merge "Pass the actual target in migrate server policy" 2020-04-01 17:11:29 +00:00
Zuul b9ba20f9f6 Merge "Add new default roles in migrate server policies" 2020-04-01 17:10:21 +00:00
Zuul f399fd3c02 Merge "Introduce scope_types in migrate server" 2020-04-01 17:10:14 +00:00
Zuul a314504d9c Merge "Add new default roles in pause server policies" 2020-04-01 17:10:06 +00:00
Zuul 3683942da1 Merge "Introduce scope_types in pause server policy" 2020-04-01 17:09:58 +00:00
Zuul 5c24cdf9cb Merge "Add test coverage of existing lock server policies" 2020-04-01 17:09:50 +00:00
Zuul 69a232c099 Merge "Add test coverage of existing pause server policies" 2020-04-01 17:09:39 +00:00
Zuul 6e8af0a374 Merge "Fix unpause server policy to be admin_or_owner" 2020-04-01 17:09:32 +00:00
Zuul 32a857722f Merge "Fix unlock server policy to be admin_or_owner" 2020-04-01 16:54:54 +00:00
Zuul 5d00267d58 Merge "Add test coverage of existing migrations policies" 2020-04-01 16:28:11 +00:00
Zuul ab7fb8267c Merge "Add test coverage of existing migrate server policies" 2020-04-01 16:28:05 +00:00
Zuul 71ad055d1c Merge "Add new default roles in os-flavor-access policies" 2020-04-01 16:27:58 +00:00
Stephen Finucane bd9bea5690 libvirt: Remove QEMU_VERSION_REQ_SHARED
The updated minimum required libvirt (4.0.0) and QEMU (2.11)
for "Ussuri" satisfy the version requirements; this was done
in Change-Id: Ia18e9be4d (22c1916b49 — libvirt: Bump
MIN_{LIBVIRT,QEMU}_VERSION for "Ussuri", 2019-11-19).

Drop the version constant  QEMU_VERSION_REQ_SHARED and now-needless
compatibility code; adjust/remove tests.

Change-Id: If878a023c69f25a9ea45b7de2ff9eb1976aaeb8c
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2020-04-01 15:29:02 +01:00
Lee Yarwood dce9bc03c4 images: Remove Libvirt specific configurable use from qemu_img_info
This change addresses an old TODO in the images module by dropping the
use of a Libvirt specific configurable from the qemu_img_info function.
We can identify RBD based volumes by checking for 'rbd:' at the start of
the path provided to the function instead of using the configurable.

Change-Id: Ife9e67d5c71f4cca825dff713f54ec955508f6e6
2020-04-01 15:29:02 +01:00
Lee Yarwood b1b0f1be18 libvirt: Always provide the size in bytes when calling virDomainBlockResize
Since 0.9.11 virDomainBlockResize has accepted the size argument in
bytes when the VIR_DOMAIN_BLOCK_RESIZE_BYTES flag is provided.

This change switches all callers over to using bytes to simplify the
required call, avoiding the need to divide by units.Ki etc.

Change-Id: Ib8d9318596186acd86a738ceea187420698645e6
2020-04-01 15:28:32 +01:00
Zuul f8d11303bd Merge "Add cyborg tempest job." 2020-04-01 09:36:20 +00:00
Zuul eb6b71d5db Merge "Add new default roles in os-hypervisors policies" 2020-04-01 06:37:50 +00:00
Ghanshyam Mann 236483285d Add new default roles in rescue server policies
This adds new defaults roles in rescue server API policies
 to system admin or project member.

Also add tests to simulates the future where we drop the deprecation
fall back in the policy by overriding the rules with a version where
there are no deprecated rule options. Operators can do the same by
adding overrides in their policy files that match the default but
stop the rule deprecation fallback from happening.

Partial implement blueprint policy-defaults-refresh

Change-Id: I5816abd33002b2036068cc686c3d0d44d66ee976
2020-04-01 01:37:01 -05:00
Ghanshyam Mann aefea9218e Introduce scope_types in rescue server policy
oslo.policy introduced the scope_type feature which can
control the access level at system-level and project-level.
 - https://docs.openstack.org/oslo.policy/latest/user/usage.html#setting-scope
 - http://specs.openstack.org/openstack/keystone-specs/specs/keystone/queens/system-scope.html

Appropriate scope_type for nova case:
- https://specs.openstack.org/openstack/nova-specs/specs/ussuri/approved/policy-defaults-refresh.html#scope

This commit introduce scope_type for rescue server API policies
as:
- ['system', 'project'] for rescue/unrescue policy even
for unlock server locked by other policy so that operators
have option to add few project scoped role like admin to
these operation.

Also adds the test case with scope_type enabled and verify we
pass and fail the policy check with expected context.

Partial implement blueprint policy-defaults-refresh

Change-Id: Idf60a3d9aff3607739d2d3d2ff5d20877a477782
2020-04-01 01:07:03 -05:00
Ghanshyam Mann e3ccd91c3c Add test coverage of existing rescue 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 or server owner
- policy check fail with context having non-admin and not server owner

As discussed in policy-defaults-refresh, 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 unrescue policies.

Also pass the actual target which is server's project_id in unrescue policy.

Partial implement blueprint policy-defaults-refresh

Change-Id: I04087be1e0023c026c06b690f20126472b0b63f0
2020-04-01 01:02:59 -05:00
Ghanshyam Mann ade96c0a1e Introduce scope_types in remote consoles policy
oslo.policy introduced the scope_type feature which can
control the access level at system-level and project-level.
 - https://docs.openstack.org/oslo.policy/latest/user/usage.html#setting-scope
 - http://specs.openstack.org/openstack/keystone-specs/specs/keystone/queens/system-scope.html

Appropriate scope_type for nova case:
- https://specs.openstack.org/openstack/nova-specs/specs/ussuri/approved/policy-defaults-refresh.html#scope

This commit introduce scope_type as ['system', 'project']
for remote consoles policy.

Also adds the test case with scope_type enabled and verify we
pass and fail the policy check with expected context.

Partial implement blueprint policy-defaults-refresh

Change-Id: I4ea042f3686e2bd8f589f20d3dbfdfc63bc4343c
2020-04-01 05:49:28 +00:00
Ghanshyam Mann fb1dd345a9 Add test coverage of existing remote console 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 or server owner
- policy check fail with context having non-admin and not server owner

As discussed in policy-defaults-refresh, 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 remote consoles policies.

Also pass the actual target which is server's project_id in policy.

Partial implement blueprint policy-defaults-refresh

Change-Id: I6d6002de59d87f99df3577f8c97d3aaba7c611e8
2020-04-01 00:48:24 -05:00
Zuul ccc5e67a27 Merge "Block unsupported instance operations with accelerators." 2020-04-01 05:20:13 +00:00
Ghanshyam Mann b4e700e592 Pass the actual target in unlock override policy
Currently if target is not passed in context.can(),
it use defauls target which is context.user_id, context.project_id.
These defaults target are not useful as it pass the
context's user_id and project_id only which means we tell
oslo policy to verify the context data with context data.

This commit pass the actual target for unlock override policies
which is server project_id because policy rule is system and
project scoped.

Adding tests also to show that rule can be override with project
roles.

Partial implement blueprint policy-defaults-refresh

Change-Id: Ie3e6667df1e8f5d3e96ac291106f7e4b0273f0ef
2020-04-01 04:05:58 +00:00
Ghanshyam Mann c71cbae6e0 Pass the actual target in migrate server policy
Currently if target is not passed in context.can(),
it use defauls target which is context.user_id, context.project_id.
These defaults target are not useful as it pass the
context's user_id and project_id only which means we tell
oslo policy to verify the context data with context data.

This commit pass the actual target for migrate server policies
which is server project_id because policy rule is system and
project scoped.

Adding tests also to show that rule can be override with project
roles.

Partial implement blueprint policy-defaults-refresh

Change-Id: I3050b7c60ccfe8b737b4dbb93f00f6d6ca82bc6d
2020-03-31 22:56:28 -05:00
Ghanshyam Mann 0605980b4e Add new default roles in migrate server policies
This adds new defaults roles in migrate server API policies.
This policy is default to SYSTEM_ADMIN role.

Also add tests to simulates the future where we drop the deprecation
fall back in the policy by overriding the rules with a version where
there are no deprecated rule options. Operators can do the same by
adding overrides in their policy files that match the default but
stop the rule deprecation fallback from happening.

Partial implement blueprint policy-defaults-refresh

Change-Id: I220a1466437ea8582f3d1cee53ff031465d25447
2020-03-31 22:38:48 -05:00
Ghanshyam Mann 6c6d7e3dc2 Introduce scope_types in migrate server
oslo.policy introduced the scope_type feature which can
control the access level at system-level and project-level.
 - https://docs.openstack.org/oslo.policy/latest/user/usage.html#setting-scope
 - http://specs.openstack.org/openstack/keystone-specs/specs/keystone/queens/system-scope.html

Appropriate scope_type for nova case:
- https://specs.openstack.org/openstack/nova-specs/specs/ussuri/approved/policy-defaults-refresh.html#scope

This commit introduce scope_type for migrate server API policies
as 'system'.

Also adds the test case with scope_type enabled and verify we
pass and fail the policy check with expected context.

Partial implement blueprint policy-defaults-refresh

Change-Id: Icba4c14f240215fd56f1cdd9814cc81ebf2796be
2020-03-31 22:26:39 -05:00
Zuul 34540068d7 Merge "Introduce scope_types in os-hypervisors" 2020-04-01 02:39:11 +00:00
Zuul c31de903dd Merge "Add test coverage of existing hypervisors policies" 2020-04-01 00:14:31 +00:00
Zuul 15974f476f Merge "Pass the actual target in os-agents policy" 2020-03-31 20:03:22 +00:00
Zuul 232486132b Merge "Add new default roles in os-ips policies" 2020-03-31 19:34:16 +00:00
Zuul 59bace629b Merge "Introduce scope_types in os-ips" 2020-03-31 19:34:09 +00:00
Zuul ec8d1b63ee Merge "Add test coverage of existing ips policies" 2020-03-31 19:34:03 +00:00