The current .zuul.yaml references a template that is going to be
deleted. All other CI jobs are failing, too, so drop the config
completely in order to unblock things and just have a noop job.
Change-Id: Ic9e27482cd7436a818bbd4065b7cb513494b01fb
This is a mechanically generated change to replace openstack.org
git:// URLs with https:// equivalents.
This is in aid of a planned future move of the git hosting
infrastructure to a self-hosted instance of gitea (https://gitea.io),
which does not support the git wire protocol at this stage.
This update should result in no functional change.
For more information see the thread at
http://lists.openstack.org/pipermail/openstack-discuss/2019-March/003825.html
Change-Id: I46b150433a9ea9c072a1ef1c7d0ccb33c4f4edef
The blazar-devstack-dsvm job was moved to in-repo configuration during
the Queens cycle. This patch creates it for the stable/pike branch as it
is being removed from openstack-infra/project-config. The python35
variant is not added as stable/pike doesn't support Python 3.
Change-Id: I2c5421a9e969bfe3129e0ab415226546397d79a8
This is a mechanically generated patch to complete step 1 of moving
the zuul job settings out of project-config and into each project
repository.
Because there will be a separate patch on each branch, the branch
specifiers for branch-specific jobs have been removed.
Because this patch is generated by a script, there may be some
cosmetic changes to the layout of the YAML file(s) as the contents are
normalized.
See the python3-first goal document for details:
https://governance.openstack.org/tc/goals/stein/python3-first.html
Change-Id: I8ae98a81787d4f31fa8fd42c578a6550ab033744
Story: #2002586
Task: #24286
Leases which failed to start could not be deleted until their end date.
This patch enables deletion of such leases at any time.
Change-Id: I8a4764fdcf4750a0dd89e787ee96d930245e8cf7
Closes-Bug: #1713768
(cherry picked from commit 3c1143085f)
In multi-region deployments using a shared Keystone, with each region
using its own Blazar and Nova services, Blazar could not be configured
to be part of a specific region. It would use the first endpoint found
in the service catalog. As a result, Blazar in RegionTwo would try to
manage Nova hosts and aggregates in RegionOne.
This patch adds a new configuration option called os_region_name in the
[DEFAULT] section. If set, Blazar looks up the right endpoints for its
region. The DevStack plugin is also updated to use the correct region
and Keystone host (which is otherwise set to the default of 127.0.0.1).
Change-Id: I0e548103dbd3d50af366ad5c19c98724e22bdc3d
Closes-Bug: #1694754
(cherry picked from commit eec558da8d)
Some necessary scheduler filters for instance reservation are not
enabled by the DevStack plugin. This patch fixes the problem.
Change-Id: I07a959b36578f3ec9188f5b86593bbbba6370b58
Closes-Bug: #1719278
scenario manager in tempest plugin was copied from
Tempest to avoid any plugin break.
This copied version of scenario manager is using lot of
Tempest interfaces. Many of them are not stable and might
change which can break plugin.
For example - https://review.openstack.org/#/c/503875/3
This commit shrinks the scenario manager copy to keep
only required methods.
Change-Id: I1a3b654afed303bdea77177d18aa294fd6d00d7d
A unique constraint currently restricts two leases from having the same
name, even if they belong to different projects.
This patch removes this constraint in order to allow duplicate lease
names, even within the same project, to match the behavior of Nova with
instances and Glance with images.
Change-Id: I89d358e35e57edbff1d841df96ce705455b1cd11
Closes-Bug: #1711076
The user_id field in leases is set from ctx.user_id, which is always
None because it is not defined in trusts.create_ctx_from_trust().
Nevertheless, we cannot use this value since we are in the trustee
context, which is the blazar user.
This patch modifies the API handler so that the real user_id is included
in the lease_values dict passed to create_lease(). Ideally, the context
would be extended to include a field referring to the trustor user.
Change-Id: If0ee6efcd30dc56dfd78fbfe566517a8d8aa6ba7
Closes-Bug: #1709103
The instance reservation plugin was failing to raise a MissingParameter
exception in its parameter validation method. It resulted in users
receiving a "500 Internal Server Error" when trying to create instance
reservations with insufficient parameters.
This patch changes the plugin to correctly raise a MissingParameter
exception in the validation method, which results in a MissingParameter
error with a 400 status code being returned to the user.
Change-Id: I2217eb60496e4f564b0e5181445e9ac919c70d3d
Currently, the action taken before the end of a lease is specified by a
configuration option. This patch enables users to specify the action
through the 'before_end' parameter of the lease creation request.
Change-Id: I90fb90d9d53814791d863f4ce5dab28388d3688d
Partially Implements: blueprint on-end-options
The update host API can only update existing extra capabilities.
However, we can support adding new extra capabilities to hosts without
API change.
With this patch, Blazar can both create and update extra capabilities
via the update host API.
Partial-Bug: #1674524
Change-Id: Ic9bd743a1c31858db9390a3379dc19e1e54327a8
Calls to the remove_computehost method need to pass hostnames of the
hosts to remove rather than their ID. Using IDs works as long as the
internal IDs in Nova and Blazar are synchronized, which is not
guaranteed.
Change-Id: Ic4c0b119cb45a2d4914e23f11130bbf0b4880cb7
The Blazar manager service calls on_start/on_end methods of the
instance_plugin class at the beginning or end of reservations. This
patch implements the two methods in instance_plugin.
The on_start method adds a flavor access right to the reserving user and
adds allocated hosts to the reserved aggregate.
The on_end method removes the access right to avoid creating new
instances with the reserved flavor first, then it deletes all instances
created by the flavor and removes hosts from the reserved aggregate.
Partially implements: blueprint new-instance-reservation
Change-Id: I885139224d8116599b2b02cab6ac1831352f8cb1
The instance reservation feature needs to handle Nova resources
(flavors, aggregates, and server groups) for scheduling. This patch
enables instance_plugin to create these resources when the create_lease
API is called.
Partially implements: blueprint new-instance-reservation
Change-Id: Ic69ebf613668d15b566a59702100ad8abfba8a6c
Instance reservation needs to check maximum usages of hypervisors in a
particular time window since multi-instances reservations share one
hypervisor at the same time.
This patch enables the instance reservation plugin to calculate
maximum usages of vcpus, memory_mb, and disk_gb for a hypervisor.
Partially implements: blueprint new-instance-reservation
Change-Id: I78be0aa3fdccc110f5f67dfc7315c8d9c4cc5e1a
This patch adds a new instance plugin. It is a first cut for the plugin.
Currently, the plugin only creates reservations but doesn't handle
starting and ending reservations.
Partially implements: blueprint new-instance-reservation
Change-Id: I60d93829bd05f0be48ba07b01f76a1f6bf190cf8
Some duplicated columns, such as 'id', are overwritten by columns with
the same name defined in the instance reservation table.
This patch prevents the instance reservation columns from overwriting
the reservation columns values in the to_dict method.
Partially implements: blueprint new-instance-reservation
Change-Id: I188c1db4512073bf36371b9022bd17716547bdbe
When a reservation reaches its lease end time, the on_end action is run
via the end_lease event and deletes the corresponding pool after
terminating instances. However, it is also run when calling
delete_lease, regardless of the reservation status.
This leads to the following scenario. A reservation reaches its lease
end time and on_end is run, which deletes the pool. Then, a user deletes
the corresponding lease, which results in on_end being run again for the
same reservation. Logging at DEBUG level will show that the second
on_end call tries to access the pool, which has already been deleted.
RESP BODY: {"itemNotFound": {"message": "Aggregate 2 could not be found.", "code": 404}}
This commit skips the on_end action if the host reservation is already
marked as deleted (which actually means it has ended, not that the lease
was deleted by the user).
Change-Id: I8d1e4cae5213b825fd81d676ecca8527d6b910bb
By default, Nova requires API clients to have admin role to handle host
aggregates. Blazar uses a role based on the current context of each API
call. Since callers of the create_lease API can be non-admin users as
well as admin users, requests by non-admin users fail to create host
aggregates when creating leases.
This patch ensures the ReservationPool class is configured with the
blazar admin user, which enables both admins and non-admins to have host
aggregates created on their behalf when they call the create_lease API.
Change-Id: Id3259b143925feb0a60e29eac9f85578b44926fc
Closes-Bug: #1706882
This patch adds a before_end() method to the resource plugin. It is
called from the manager at the before_end_lease event. An actual action
is configurable for each resource plugin. The physical host plugin
currently supports 'snapshot'.
This patch also renames the API parameter 'before_end_notification'
'before_end_date' because actions other than notification get to use
this parameter.
Change-Id: Ifdb42e431f2b5134ed8a720ae040486aee2e4acc
Implements: blueprint on-end-options
oslo.utils has a generate_uuid function for generating UUIDs. We should
use that function when generating UUIDs for consistency.
Change-Id: Ibf36852e71d716a52a9e231ca2054dd6988771c1
If a lease is created to start immediately, there is a possible race
condition between the lease creation function (create_lease() in
blazar/manager/service.py) and the manager thread running lease events.
The race condition happens in the following fashion:
1. create_lease() calls db_api.lease_create(lease_values). The
lease_values dict contains events values, which means both lease and
associated events are created. However, associated reservations are not
yet created at this stage.
2. The manager thread running events is triggered by its periodic timer.
It finds that the start_lease event is ready to run and executes
_basic_action(). Since there is no reservation yet, _basic_action() only
marks the event status as 'DONE'.
3. create_lease() finishes running by creating reservations associated
with the lease.
4. Reservations stay in "pending" status forever because the start_lease
event has already run.
This is resolved by separating event creation in the database from the
lease creation and moving it after reservation creation is done.
Change-Id: Ia954461a682b4c5eef6dd5f3d5b779650ce404aa
Closes-Bug: #1704359