Commit Graph

497 Commits

Author SHA1 Message Date
Dr. Jens Harbott 1379dfdd38 Drop zuul configuration for stable/pike branch
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
2023-09-06 14:10:47 +02:00
Pierre Riteau 55cacc36f8 [CI] Move queue setting to project level
Per [1].

[1] http://lists.zuul-ci.org/pipermail/zuul-discuss/2022-May/001801.html

Change-Id: I34934eefee6c0cd3b999fa028e6697d1c5e8476a
(cherry picked from commit b6ec5600fd)
(cherry picked from commit 95a3d4d821)
2023-06-06 19:02:18 +00:00
OpenDev Sysadmins 51eb409eb9 OpenDev Migration Patch
This commit was bulk generated and pushed by the OpenDev sysadmins
as a part of the Git hosting and code review systems migration
detailed in these mailing list posts:

http://lists.openstack.org/pipermail/openstack-discuss/2019-March/003603.html
http://lists.openstack.org/pipermail/openstack-discuss/2019-April/004920.html

Attempts have been made to correct repository namespaces and
hostnames based on simple pattern matching, but it's possible some
were updated incorrectly or missed entirely. Please reach out to us
via the contact information listed at https://opendev.org/ with any
questions you may have.
2019-04-19 19:48:00 +00:00
Ian Wienand 783bb2f541 Replace openstack.org git:// URLs with https://
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
2019-03-24 20:32:43 +00:00
Pierre Riteau c87ed2c768 Create blazar-devstack-dsvm job for stable/pike
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
2018-09-18 13:13:52 +01:00
Nguyen Hai d90513c759 import zuul job settings from project-config
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
2018-09-18 11:27:51 +00:00
Hiroaki Kobayashi 8a1b2703c0 Allow deleting leases which failed to start at any time
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)
2017-11-14 12:27:31 +00:00
Pierre Riteau 86b3aa872f Add support for multi-region deployments
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)
2017-10-20 15:07:47 +09:00
Jenkins 0b750f6ea2 Merge "Shrink Tempest scenario manager copy" into stable/pike 2017-10-06 02:39:49 +00:00
Hiroaki Kobayashi 005e020e86 Fix filter scheduler settings in DevStack plugin
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
2017-10-03 07:38:57 +00:00
ghanshyam e087575a8b Shrink Tempest scenario manager copy
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
2017-09-23 18:29:08 +00:00
Masahito Muroi f320a8ed44 Add default branch for pike release
Change-Id: I1eb05af1b02ebd2e2b3b75488c0ecfcfa106b378
2017-08-28 21:14:34 +09:00
Hiroaki Kobayashi 4eeba937f0 Support updating capacity of reservations
Change-Id: Ia990e126607657c8811fe92f23f6c30cc9889946
Partially-Implements: blueprint update-reserved-capacity
2017-08-22 09:02:56 +00:00
Jenkins cf31fb3f95 Merge "Allow duplicate lease names" 2017-08-21 07:20:54 +00:00
Jenkins 7977c90152 Merge "Set user_id when creating leases" 2017-08-21 07:17:39 +00:00
Jenkins a47dfb107f Merge "Allow update host API to add new extra capabilities" 2017-08-21 04:43:25 +00:00
Jenkins b1c5d6636f Merge "Return a MissingParameter error when required parameters are missing" 2017-08-21 04:32:34 +00:00
Pierre Riteau 3018e70d34 Allow duplicate lease names
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
2017-08-16 11:51:37 +01:00
Pierre Riteau 9f832e13fb Set user_id when creating leases
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
2017-08-16 09:25:45 +01:00
Masahito Muroi eb2a6fa743 Return a MissingParameter error when required parameters are missing
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
2017-08-14 17:45:11 +00:00
Hiroaki Kobayashi cb187056f8 Support before_end parameter in the REST API
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
2017-08-11 10:28:16 +01:00
Pierre Riteau 03e0059932 Allow update host API to add new extra capabilities
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
2017-08-11 09:20:04 +01:00
Pierre Riteau ec854ee613 Pass hostnames rather than IDs to remove_computehost()
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
2017-08-07 19:00:30 +01:00
Masahito Muroi fe23f716fe Add a release note of the new instance reservation feature
Partially implements: blueprint new-instance-reservation

Change-Id: I8065118fca5588e89888ef11888696886573d379
2017-08-07 10:56:19 +00:00
Masahito Muroi 6deb9385df Add a user guide for the new instance reservation feature
Partially implements: blueprint new-instance-reservation

Change-Id: I9d7e8e689a8a86366fc59cd643c7a53e01dadf73
2017-08-07 10:55:53 +00:00
Masahito Muroi 901a5d3d52 Enable DevStack to set up the new instance reservation feature
Partially implements: blueprint new-instance-reservation

Change-Id: Ic0f09e29b435aa0d563733872f1e2b1ea92259de
2017-08-07 10:55:29 +00:00
Masahito Muroi fb71db3b92 Enable deployers to specify virtual.instance.plugin in blazar.conf
Partially implements: blueprint new-instance-reservation
Change-Id: I2632f09e9fbbdc7eb9e8e01998fa4043a60b8c9e
2017-08-07 10:55:03 +00:00
Masahito Muroi c79cd10f06 Enable instance_plugin to handle on_start and on_end events
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
2017-08-07 10:54:38 +00:00
Masahito Muroi c2b65be7c4 Create Nova resources for instance reservations
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
2017-08-07 10:54:17 +00:00
Masahito Muroi 9094488ed0 Check maximum usages of hosts in a particular time window
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
2017-08-07 10:53:50 +00:00
Masahito Muroi b835f311a1 Add instance reservation plugin
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
2017-08-07 10:37:50 +00:00
Jenkins 1bedac5001 Merge "Pass only instance reservation specific columns to the reservation table" 2017-08-07 10:35:27 +00:00
Jenkins 1193a4a555 Merge "Add spec for instance reservation" 2017-08-07 10:06:52 +00:00
Masahito Muroi a323230594 Pass only instance reservation specific columns to the reservation table
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
2017-08-07 09:29:08 +00:00
Masahito Muroi 2e9466d904 Add spec for instance reservation
Change-Id: I03315216c3a6203e088e914ffb9fedf1e672d732
Partially-Implements: blueprint new-instance-reservation
2017-08-07 08:50:54 +00:00
Pierre Riteau 0558b5233e Skip on_end action if reservation has already ended
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
2017-08-06 12:46:06 +01:00
Jenkins 4d89350417 Merge "Fix host filtering by extra capability" 2017-08-03 10:29:20 +00:00
Jenkins ce9e40ad3c Merge "Handle more exceptions raised in reserve_resource()" 2017-08-03 10:24:27 +00:00
Jenkins 33a5104a23 Merge "Configure ReservationPool with the blazar admin user" 2017-08-03 08:51:39 +00:00
Masahito Muroi b8b4749916 Configure ReservationPool with the blazar admin user
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
2017-08-03 07:51:38 +00:00
Hiroaki Kobayashi 119e986c60 Revise endpoint creation part of the installation guide
Change-Id: I40c6305ad0825c1e9bf8a37f56d803e5057d9e27
2017-08-01 17:57:30 +09:00
Hiroaki Kobayashi 3865234584 Handle more exceptions raised in reserve_resource()
This commit also moves parameter validation to a separate function.

Change-Id: Ic1382873ddd819535254b738b17176981ba771e6
Closes-Bug: #1702853
2017-08-01 16:10:10 +09:00
Hiroaki Kobayashi a5fb773bcd Support running actions before the end of a lease
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
2017-07-31 14:42:56 +00:00
Jenkins 2ea4f6e8ef Merge "Replace uuid.uuid4() with uuidutils.generate_uuid()" 2017-07-31 08:51:09 +00:00
Kiran_totad 3ac9197588 Replace uuid.uuid4() with uuidutils.generate_uuid()
oslo.utils has a generate_uuid function for generating UUIDs. We should
use that function when generating UUIDs for consistency.

Change-Id: Ibf36852e71d716a52a9e231ca2054dd6988771c1
2017-07-26 05:32:08 +00:00
Jenkins 3bcf199050 Merge "Fix race condition between lease creation and event thread" 2017-07-21 08:49:22 +00:00
Jenkins 4de8370c02 Merge "Update URLs in documents according to document migration" 2017-07-19 02:59:32 +00:00
OpenStack Proposal Bot 08dda112f7 Updated from global requirements
Change-Id: I4a702cf339819db93f4cfdc33d040ed476c48170
2017-07-18 01:44:24 +00:00
Pierre Riteau 030e9edbd9 Fix race condition between lease creation and event thread
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
2017-07-14 10:44:32 +01:00
melissaml 6b9335e85b Update URLs in documents according to document migration
Change-Id: I9122f32048cffbcfb23bcb6129e95ef1c7804908
2017-07-14 09:28:59 +08:00