Skip to content

Updates for flavor reservation/virtualization #123

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 25 commits into
base: chameleoncloud/2023.1
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
e9b4c3e
:Only create a server group when affinity is set
MoteHue Jul 3, 2024
ec96690
Delete server group only if one was created
priteau Aug 26, 2024
a9d5277
db: add compute resources and traits
JohnGarbutt Apr 29, 2024
c9924ad
Write inventory and traits into DB
JohnGarbutt Apr 29, 2024
6e17404
Add host_resource_inventory_get_all_per_host
JohnGarbutt May 2, 2024
347e93a
Implement allocation_candidates for flavor-based reservation
JohnGarbutt Apr 29, 2024
24e4dae
Make flavor plugin usable
JohnGarbutt May 2, 2024
fefec7e
Document flavor-based instance reservations
MoteHue Aug 23, 2024
4b7d22b
Enable flavor:instance plugin in DevStack
priteau Aug 28, 2024
fb67c3d
Fix InstanceReservations affinity nullable flag
priteau Feb 15, 2024
e6ae4cf
Fix flavor reservations for Chameleon Cloud
Mark-Powers Jan 17, 2025
9738fae
Fix enforcement to pass flavor info in request
Mark-Powers Jan 22, 2025
b56049a
Add description to flavor
Mark-Powers Jan 27, 2025
8197f70
Fix flavor reservation before_end code
Mark-Powers Jan 27, 2025
c5aa2b3
Add option to disable physical:host reservation
Mark-Powers Jan 27, 2025
350384d
Fix unit tests
Mark-Powers Jan 27, 2025
f226745
Add update_reservation to flavor plugin
Mark-Powers Jan 28, 2025
6f2f2ec
Add randomization to flavor plugin
Mark-Powers Jan 30, 2025
7d33582
Add "usage" information to host allocation tied to instance res
Mark-Powers Feb 17, 2025
ba1f398
Add required flavor resource
Mark-Powers May 27, 2025
b93ecbb
Revert "Delete instances running on reserved hosts when starting rese…
Mark-Powers Jun 2, 2025
d6cbc57
Update exception base class to use status 400
Mark-Powers Jun 9, 2025
87a3ca9
Fix before_end actions with flavor reservations
Mark-Powers Jun 9, 2025
cc17590
Revert "Add required flavor resource"
Mark-Powers Jun 27, 2025
93f6d69
Ignore flavor traits
Mark-Powers Jun 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add required flavor resource
Change-Id: I190dca0ba944d8131ad3f0aedbe5e43eac147192
  • Loading branch information
Mark-Powers committed May 28, 2025
commit ba1f398f81c4dc195fc1488e2cca2d964dd6a62e
5 changes: 5 additions & 0 deletions blazar/manager/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,3 +317,8 @@ class InvalidDevice(exceptions.NotAuthorized):
class HostHavingContainers(exceptions.BlazarException):
code = 409
msg_fmt = _("Containers found for host %(host)s")


# Flavor plugin related exceptions
class InvalidFlavor(exceptions.NotAuthorized):
msg_fmt = _("Flavor %(flavor)s is not reservable")
15 changes: 13 additions & 2 deletions blazar/plugins/flavor/flavor_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@
cfg.BoolOpt('randomize_host_selection',
default=False,
help='Allocate hosts for reservations randomly.'),
cfg.StrOpt('placement_reservation_permitted_trait',
default=None,
help='If set, only permit flavor reservation for flavors with this trait.'),

]

CONF = cfg.CONF
Expand Down Expand Up @@ -142,8 +146,7 @@ def _query_available_hosts(self, start_date, end_date,
# resource requests, e.g. baremetal vs virtual
# or missing traits
if resource_traits:
raise mgr_exceptions.NotImplemented(
error="Resource traits not supported yet")
LOG.warning("Resource traits not supported yet. Ignoring.")
hosts = db_api.reservable_host_get_all_by_queries([])

# find reservations for each host in our time period
Expand Down Expand Up @@ -298,6 +301,14 @@ def _get_flavor_details(self, flavor_id):
resource_request, resource_traits = \
self._estimate_flavor_resources(source_flavor)

if (
CONF[self.resource_type].placement_reservation_permitted_trait and
resource_traits.get(
CONF[self.resource_type].placement_reservation_permitted_trait
) != "required"
):
raise mgr_exceptions.InvalidFlavor(flavor=source_flavor["name"])

return (resource_request, resource_traits, source_flavor)

def _estimate_flavor_resources(self, source_flavor):
Expand Down
Loading