Commit Graph

109 Commits

Author SHA1 Message Date
OpenStack Release Bot 7a5b912e7a Update master for stable/2024.1
Add file to the reno documentation build to show release notes for
stable/2024.1.

Use pbr instruction to increment the minor version number
automatically so that master versions are higher than the versions on
stable/2024.1.

Sem-Ver: feature
Change-Id: Iaaf00db2aeb3be44ed2abdd6f494465facea365d
2024-03-14 19:57:49 +00:00
Zuul 59082738b3 Merge "reno: Update master for unmaintained/victoria" 2024-03-06 07:17:42 +00:00
Zuul e641fcbd69 Merge "reno: Update master for unmaintained/xena" 2024-03-05 21:00:30 +00:00
OpenStack Release Bot db66efe07c reno: Update master for unmaintained/xena
Update the xena release notes configuration to build from
unmaintained/xena.

Change-Id: I731787f378d9c9fd4666bacfb65a8f06a65b2fa9
2024-03-05 18:27:57 +00:00
OpenStack Release Bot 6b6e318b18 reno: Update master for unmaintained/wallaby
Update the wallaby release notes configuration to build from
unmaintained/wallaby.

Change-Id: I4f317aeaad3227621cb158aa8905d26c3ef2177e
2024-03-05 18:27:16 +00:00
OpenStack Release Bot 67a8cbacfe reno: Update master for unmaintained/victoria
Update the victoria release notes configuration to build from
unmaintained/victoria.

Change-Id: Iedd7cbaa032f32e4656f37bc136f6e66fb79814c
2024-03-05 18:26:36 +00:00
Zuul adf68a71bb Merge "Add non-fatal handling for enforcement exceptions" 2024-02-15 07:38:43 +00:00
Anish Reddy Ravula 6ad67e5465 Add non-fatal handling for enforcement exceptions
The current implementation of enforcement exceptions
during lease creation and update transitions the lease into an error
state, which is undesirable.This update introduces non-fatal handling
for the following enforcement exceptions:
  - MaxLeaseDurationException
  - ExternalServiceFilterException

Now, these exceptions will not cause the lease status to be
updated to an error state, allowing smoother lease management.

Test Plan:

PASS: Verify behavior for lease creation with non-fatal
enforcement exceptions
PASS: Verify behavior for lease update with non-fatal
enforcement exceptions
PASS: Confirm consistent lease status for non-fatal exceptions

Negative Testing:

PASS: Ensure that lease status remains unaffected for
non-fatal exceptions
PASS: Validate expected outcomes for various enforcement scenarios

Change-Id: I5d807d33e07d80f69f9734735c11e8d801bf5cde
2024-02-06 09:50:35 -06:00
OpenStack Release Bot a803ba3446 reno: Update master for unmaintained/yoga
Update the yoga release notes configuration to build from
unmaintained/yoga.

Change-Id: Ie8636113867e9a71362e967b61eff6e48c1be958
2024-02-05 17:00:05 +00:00
Matt Crees 0481ad4ad9 Add support for specifying a custom CA bundle
Adds the new config option ``cafile``, which is passed into the
Session invocations for SSL verification.

Partial-Bug: #2045281

Change-Id: I2ec5bc7ac929534175d380d2e3e535a5e7abd962
2024-01-28 22:10:24 +00:00
OpenStack Release Bot e78848edb2 Update master for stable/2023.2
Add file to the reno documentation build to show release notes for
stable/2023.2.

Use pbr instruction to increment the minor version number
automatically so that master versions are higher than the versions on
stable/2023.2.

Sem-Ver: feature
Change-Id: I0cc06001ef8cae5d9abf153c8a705aa5250ac765
2023-09-15 13:47:24 +00:00
Pierre Riteau cf383ae3a5 Update copyright date for release notes
This is a small change to force refresh of release notes.

Change-Id: I269ccaaba569b986b5a9be698686cbdd5ea611fb
2023-03-20 15:25:26 +01:00
OpenStack Release Bot 735d43eccc Update master for stable/2023.1
Add file to the reno documentation build to show release notes for
stable/2023.1.

Use pbr instruction to increment the minor version number
automatically so that master versions are higher than the versions on
stable/2023.1.

Sem-Ver: feature
Change-Id: I64523195b78562f70bb4a98ed908b29164ad7c21
2023-02-28 13:30:53 +00:00
jakecoll c4a4305374 Add randomness to physical host selection
In the event that a given physical node has reliability issues, it can
be difficult for users to "get around" the problem because we currently
deterministically pick the first node from the list of nodes available.
Adding randomness to this process helps spread the probability that a
given lease will nab a node that has issues (but has not yet been
identified as such.)

Co-Authored-By: Matt Crees <mattc@stackhpc.com>

Change-Id: I0f0ddb14ed5d21f0ccc5c9659c821d58cea5cbde
2023-02-24 08:07:21 +01:00
Pierre Riteau da81c20709 Update copyright date for release notes
This is a small change to force refresh of release notes.

Change-Id: I69f23cb248ffa0d2f290cda5a909187441b0b3cc
2022-09-23 10:51:42 +02:00
OpenStack Release Bot b88b4bf010 Update master for stable/zed
Add file to the reno documentation build to show release notes for
stable/zed.

Use pbr instruction to increment the minor version number
automatically so that master versions are higher than the versions on
stable/zed.

Sem-Ver: feature
Change-Id: Ic64eb1aa7cc764cf025cfa281a9df183e31daa68
2022-09-16 09:21:17 +00:00
Pierre Riteau 22e99c1827 Add enforcement filter using an external HTTP service
Co-Authored-By: Jacob Colleran <jakecoll@uchicago.edu>
Co-Authored-By: Jason Anderson <jasonanderson@uchicago.edu>
Co-Authored-By: Pierre Riteau <pierre@stackhpc.com>

Change-Id: I0728f556829ba84e222c27bd8c407738b4be2f76
2022-08-30 22:06:54 +02:00
leiyuehui f194168ced Update python testing as per zed cycle testing runtime
In Zed cycle, we have dropped the python 3.6/3.7[1] testing
and its support. Removing the py36 centos8 job as well as
updating the python classifier also to reflect the same.

[1] https://governance.openstack.org/tc/reference/runtimes/zed.html

Change-Id: I6c31cc6ab8c58f77216d869dbbcd6c68bec09b7e
2022-06-09 06:44:10 +00:00
OpenStack Release Bot 70b2a49a23 Update master for stable/yoga
Add file to the reno documentation build to show release notes for
stable/yoga.

Use pbr instruction to increment the minor version number
automatically so that master versions are higher than the versions on
stable/yoga.

Sem-Ver: feature
Change-Id: I100f1b72f754df48aaa2446de7ec00a35956139e
2022-03-08 12:00:20 +00:00
Zuul 8b07ee11aa Merge "Use built-in oslo context de/serialization" 2022-02-23 23:11:52 +00:00
Zuul e1c16e6b55 Merge "Add resource properties discovery API" 2022-02-21 22:54:52 +00:00
Mark Powers f5e6d24826 Add resource properties discovery API
This allows users to query for resource properties of hosts,
allowing them to be used in creating leases more effectively. Two new
API endpoints are added for hosts, ``/properties`` and
``/properties/<property_name>``, which allow for listing available
properties, and updating a property respectively. Properties can be
listed with detail, showing possible values and visibility. Admins can
list public and private properties.

A new database table is added ``resource_properties``, which stores
property names and resource types. Resource specific property tables
(e.g. ``computehost_extra_capabilities``) entries store a foreign key to
``resource_properties``, rather than the capability name.

Implements blueprint resource-properties-discovery-api

Change-Id: Ib9f1140c44c5e4fbef6e019c48a842869368cb21
2022-02-10 17:23:15 +00:00
Pierre Riteau 77e0d4a007 Switch to using internal endpoints
This commit makes endpoint types configurable and uses the internal
endpoint as default for Blazar, except admin for reaching keystone to
keep legacy behaviour for now.

Update devstack configuration to use public endpoints, since internal
endpoints are not created by devstack anymore (except for keystone).

Change-Id: I6414be91a1b629df680641050cfd415252b0a3c5
Closes-Bug: #1960335
2022-02-10 13:44:48 +01:00
Zuul fb599ec609 Merge "Fix lease update when resource_type parameter is missing" 2022-02-04 16:49:05 +00:00
Mark Powers d4cb8f428e Restore lease status during a non fatal lease update exception
If a lease update raises an exception that is recoverable (such as
specifying an invalid date range) the lease would be set to ERROR
status. Other cases with wrong input have similar effects.

This change allows for non fatal exceptions to be specified in
the lease status code. If one is raised, the lease is restored
to the original status.

Closes-Bug: #1786031
Change-Id: I73df4587d223dc4582cb15e0f4cb8de1a02ffee7
2022-02-03 10:26:09 +01:00
Mark Powers bf38e16ec3 Update list_allocations in hosts plugin to expose start and end dates
This change modifies the DB utility to fetch reservation allocations so
that a list of reservations is returned with host_ids as an attribute to
each reservation.

This allows the host plugin to include more information when listing
allocations, namely start and end dates. This can be used to see when
resources are available, and for the creation of a reservation calendar
(blueprint calendar-view).

Change-Id: I464898bdeda6b55a028c8a14a54eb137c92a83c1
2022-01-27 15:03:24 +01:00
Pierre Riteau 39c67f09b8 Fix list_allocations for multi-host reservations
The get_reservation_allocations_by_host_ids function builds an
allocation dictionary that looks like this:

    allocations = {
        'r1': ['host1'],
        'r2': ['host1', 'host2']
    }

The list returned by this function was only using the first host of each
reservation:

    allocations[r['id']][0]

Loop over hosts to build the list of (reservation, lease, host) tuples.

Change-Id: I55b3cb4e736f6f747c8b3254c62fa40bac3f288f
Closes-Bug: #1958307
2022-01-18 23:21:43 +01:00
Pierre Riteau caf4b282f0 Fix lease update when resource_type parameter is missing
Change-Id: Id7771b63116064f2adc0cdfd700f14afa1ea6170
Closes-Bug: #1957761
2022-01-13 15:23:52 +01:00
Jason Anderson ed238925f9
Use built-in oslo context de/serialization
The oslo context library has built-in mechanisms to deserialize a
context object from a set of headers; Blazar's built in extension of the
context class was ignoring several possibly-important pieces of
information, notably the Keystone domain name.

To fix, this removes much of the custom logic in the BlazarContext and
keeps only the two important bits:

1. A stack of contexts is maintained to allow for nested operations w/
   different sets of credentials
2. The service_catalog is preserved. It's unclear if this is really
   needed long-term, but some code still relies on it. Also unclear why
   the oslo context doesn't include this when parsing headers.

Support for multiple domains is included as part of this changeset.
Before, it was assumed that all users (admins and project users) were
part of the default domain.

Closes-Bug: #1881162
Change-Id: I75fcd97cf7a53d17c909620fcf41a8b5a3699dfa
2021-12-02 11:52:12 -06:00
Pierre Riteau 949c52dba4 Ignore usage enforcement release note for Xena
Change-Id: I913b5f54fb23e452038e0b4668938a058f192186
2021-09-28 11:25:31 +02:00
Pierre Riteau 5dad1a8394 Set earliest-version for Xena release notes
The usage enforcement framework is currently included in both Xena and
Wallaby release notes. Update Xena configuration to ignore it.

Change-Id: I2bf9b85b19df211ae53e9453ccb999c34ce4f24c
2021-09-22 10:32:53 +02:00
OpenStack Release Bot dd9ac233c3 Update master for stable/xena
Add file to the reno documentation build to show release notes for
stable/xena.

Use pbr instruction to increment the minor version number
automatically so that master versions are higher than the versions on
stable/xena.

Sem-Ver: feature
Change-Id: I0df58ad0f20b91a8a2f02718e211b3b75b5fba1a
2021-09-17 13:31:29 +00:00
OpenStack Release Bot d7b82a0a84 Update master for stable/wallaby
Add file to the reno documentation build to show release notes for
stable/wallaby.

Use pbr instruction to increment the minor version number
automatically so that master versions are higher than the versions on
stable/wallaby.

Sem-Ver: feature
Change-Id: I3abd87790e34e4549917705ae1c2f5e92363575a
2021-03-25 15:20:41 +00:00
Jacob Colleran d3f77fd0c5 Add usage enforcement framework
Implements filter-based architecture for usage enforcement.

One filter is initially included: MaxLeaseDurationFilter allows
operators to define the maximum duration of a lease in seconds. All
filters must be enabled and configured in the [enforcement] group of
blazar.conf.

When ending a lease, the allocations currently associated with the
reservations of the lease are sent to the enforcement layer for
processing. This works fine when deleting a lease, but when a lease
naturally ends, that is, when the current time is greater than the
lease's recorded end time, the allocation lookup returns 0 results
because we have a filter on the time of the lease/reservation by
default, which starts from datetime.now. This is really not what we want
to do when explicitly filtering on a lease/reservation, so this updates
the generic query function to not apply this filtering in this case.

It turns out, it was possible for usage enforcement's on_end hook to run
multiple times if the first reservation teardown failed. In this
circumstance, the end_lease event would be IN_PROGRESS but the
reservations would be in an error state. The code only checks if any
reservation is DELETED before trying to run on_end again.

To fix this, only try to run on_end if we detected that there was an
UNDONE end_lease event; that's the only time in which we'll actually be
responsible for running this logic.

This also updates the delete logic to be a bit more consistent with the
internal way we track states. It is not enough to check dates, because
it could be that Blazar never got around to actually starting the
leases; we should be checking events. This also makes the logic a bit
easier to understand.

Change-Id: Ic106bee4fc3f5c401c4f8d8ecb1c4e735560bcc2
Co-Authored-By: Jason Anderson <jasonanderson@uchicago.edu>
Co-Authored-By: Pierre Riteau <pierre@stackhpc.com>
Implements: blueprint flexible-reservation-usage-enforcement
2021-03-24 16:57:13 +01:00
Zuul 2d95b84e7d Merge "remove unicode from code" 2021-02-23 11:38:11 +00:00
Ghanshyam Mann 3f1c1ed312 [goal] Deprecate the JSON formatted policy file
As per the community goal of migrating the policy file format from JSON
to YAML [1], we need to do two things:

1. Change the default value of '[oslo_policy] policy_file' config option
   from 'policy.json' to 'policy.yaml' with upgrade checks.

2. Deprecate the JSON formatted policy file on the project side via
   warning in documentation and release notes.

[1] https://governance.openstack.org/tc/goals/selected/wallaby/migrate-policy-format-from-json-to-yaml.html

Change-Id: I9ca5459a6968d93dee1bf24b3e0012a4cc7020b5
2021-01-28 16:37:30 +01:00
Pierre Riteau b1841dc4b9 Fix use of legacy Alembic API
The `name` keyword argument for Operations.alter_column() has been
deprecated since version 0.8. It was finally removed in Alembic 1.5.0,
causing the following error during installation of Blazar:

TypeError: alter_column() got multiple values for keyword argument 'name'

Change-Id: I05541da4d87575f65d8e78f0fc54bd415328b9f2
Closes-Bug: #1912502
2021-01-20 16:29:18 +01:00
wu.shiming e81bbc72b7 remove unicode from code
Change-Id: I2e6e9c3b3d934e1ba60b07d239e970137c32a48f
2021-01-13 09:26:38 +08:00
OpenStack Release Bot d8ddf42d10 Update master for stable/victoria
Add file to the reno documentation build to show release notes for
stable/victoria.

Use pbr instruction to increment the minor version number
automatically so that master versions are higher than the versions on
stable/victoria.

Change-Id: Ibce320ad948c113c2afc513a2f7fe5ee77c769a3
Sem-Ver: feature
2020-09-25 08:36:26 +00:00
Sam Morrison 532544efbf Fix up adding availability zone (AZ) to a host on creation
1. Nova AZ returns hosts as service hosts as opposed to hypervisor
   hostnames
2. Handle case where a Nova AZ has no hosts

Change-Id: If6f6cf21170e95c58dd8a0a1b41b9b5f4797a627
Closes-Bug: #1880646
2020-06-30 11:40:43 +02:00
Andreas Jaeger b489995c8b Switch to newer openstackdocstheme and reno versions
Switch to openstackdocstheme 2.2.1 and reno 3.1.0 versions. Using
these versions will allow especially:
* Linking from HTML to PDF document
* Allow parallel building of documents
* Fix some rendering problems

Update Sphinx version as well.

Set openstackdocs_pdf_link to link to PDF file. Note that
the link to the published document only works on docs.openstack.org
where the PDF file is placed in the top-level html directory. The
site-preview places the PDF in a pdf directory.

Change pygments_style to 'native' since old theme version always used
'native' and the theme now respects the setting and using 'sphinx' can
lead to some strange rendering.

openstackdocstheme renames some variables, so follow the renames
before the next release removes them. A couple of variables are also
not needed anymore, remove them.

See also
http://lists.openstack.org/pipermail/openstack-discuss/2020-May/014971.html

Change-Id: Ib2fc9304a6db9f01eb6d0eb82363906fd322612f
2020-05-21 16:12:27 +02:00
OpenStack Release Bot 979088001a Update master for stable/ussuri
Add file to the reno documentation build to show release notes for
stable/ussuri.

Use pbr instruction to increment the minor version number
automatically so that master versions are higher than the versions on
stable/ussuri.

Change-Id: Ie52668228b9f16f62b2e4fa37558c78da47b6629
Sem-Ver: feature
2020-04-23 19:19:43 +00:00
Tetsuro Nakamura 352893e78c [ussuri][goal] Drop python 2.7 support and testing
OpenStack is dropping the py2.7 support in ussuri cycle.

Blazar is ready with python 3 and ok to drop python 2.7 support.

Complete discussion & schedule can be found in
- http://lists.openstack.org/pipermail/openstack-discuss/2019-October/010142.html
- https://etherpad.openstack.org/p/drop-python2-support

Ussuri Community-wide goal:
https://governance.openstack.org/tc/goals/selected/ussuri/drop-py27.html

Co-Authored-By: Ghanshyam Mann <gmann@ghanshyammann.com>

Change-Id: I69bd82f8a1156f2f2eb636ea96c439c0645cc102
2019-12-10 10:20:00 +01:00
Jason Anderson 0346b02cce Fix issue moving hosts back to freepool
If an aggregate fails to be created for some reason, for example because
the requested node is not in the freepool, some cleanup occurs. Part of
the cleanup is ensuring the target node is moved _back_ to the freepool.
This should theoretically "heal" cases where the node wasn't in the
freepool but also wasn't in some lease aggregate.

However, this call to Nova's API refers to the freepool aggregate by its
name, which is not supported here: the ID must be used[1]. This caused
this operation to fail and raise a NotFound, confusingly (because Nova
couldn't find an aggregate with ID='freepool' for example.)

[1]:
https://docs.openstack.org/api-ref/compute/?expanded=add-host-detail#add-host

Closes-Bug: #1847821
Change-Id: I7af4d407b183578617131f0de42becb3dc2bc415
2019-10-18 16:30:11 +02:00
Pierre Riteau ab69233df3 Hide version 3.0.0 from Train release notes
The release notes for version 3.0.0 were displayed both on the Stein and
Train pages. Use earliest-version to hide them from the Train page.

Change-Id: I248430a9407d1944ae05ba2352b370862ef4e0e0
2019-10-01 11:43:03 +02:00
OpenStack Release Bot 102c68df2b Update master for stable/train
Add file to the reno documentation build to show release notes for
stable/train.

Use pbr instruction to increment the minor version number
automatically so that master versions are higher than the versions on
stable/train.

Change-Id: Ief70dd33d7b3dd955a892f4e3775ff1a6235fa8a
Sem-Ver: feature
2019-09-27 15:26:40 +00:00
Pierre Riteau 3137ffc84d Add update_reservation to floating IP plugin
The update reservation functionality was not implemented in the original
plugin. Consequently, any mixed resource lease containing a floating IP
resource would fail when the lease was updated.

Co-Authored-By: Jacob Colleran <jakecoll@uchicago.edu>
Change-Id: I2f55f33ba5af9d9f2b84b716caaa8ed1cfd0db66
2019-09-13 11:58:32 +02:00
asmita singh 520005b13d Add microversion support
This patch adds microversion support so that it is possible to make
minor changes to the APIs as required to fix Launchpad bug #1740091.

Change-Id: I7ea48be72897a77fc8424a57f4ce2d4798daf4eb
Related-Bug: #1740091
2019-09-10 18:59:36 +02:00
asmita singh 563e4a8da2 Send global_request_id for tracing calls
This patch adds global_request_id to the constructor for nova client,
keystone client, neutron client and placement client which will pass the
global_request_id to these respective services on all API calls.
Supporting global_request_id makes debugging easier when requests reach
many different OpenStack services. The blazar global_request_id will be
sent to these services in the request header like below and it will be
available with context.global_request_id:

  -H "X-OpenStack-Request-ID: req-1a9b7b24-02ed-4400-bcc3-cc1bcbb59147"

Sample log output of neutron service for ``POST v1/floatingips`` API
which logs global request ID `req-e19f8f4f-40e7-441e-b776-7b43ed15c7dd`
is shown at: http://paste.openstack.org/show/753807

Oslo spec I65de8261746b25d45e105394f4eeb95b9cb3bd42
Change-Id: I5bb3631c4fb178293ee8eefbe1aa8b819a196a9f
2019-09-06 11:15:18 +02:00
openstack 438585e3d7 Add request_id middleware support
'x-openstack-request-id' is the common header name for request ID
which is implemented in most of the OpenStack services. Using the
oslo middleware `request_id` middleware is a convenient way to
generate request ID and also include it in the response.

The request ID will be generated by the oslo middleware and is
inserted into the request environment. On the response end, the
middleware is again used, this time to attach the
'x-openstack-request-id' header, using the value of the generated
request ID.

Sample log output of blazar-api service for ``GET v1/os-hosts`` API
which logs local request ID `req-de45521c-2a04-4e7d-809a-960e782eb1e7`
is shown below:
  http://paste.openstack.org/show/753805/

Note: For v2 apis, the request_id is not returned in response header
but it will be logged in logs.

APIImpact:
responses of the API will include 'x-openstack-request-id' header.

Implements: blueprint oslo-middleware-request-id
Change-Id: I437f783787514ff1add2d7f0059cb27addd12c3e
2019-09-05 14:39:00 +00:00