Fix/usage extra - #10
Open
msherman64 wants to merge 396 commits into
Open
Conversation
Currently, the enforcement filters don't run in order. So it may cause allocation overcharge when the balance service filter runs before the max_reservation_length filter. For example, if someone tries to extend the lease two days prior to the end time, the project will be charged with the encumbered SUs but then failed on extending the lease.
Change-Id: I8798aed409feb1b4fceb153483993463b5f3bef3
Change-Id: I3ce9dc288297dcc1debf50fe9030bb4fd517c591
Change-Id: I4eb364acf35cda33b2c8cbe8d6efecabf6ed437c
Change-Id: I138acab2ba3115bb9bd8f8acfd384899c11ff653
…rvers Prevent reallocating a host with servers
Fix lease-update bug
Change-Id: If124e93c07fed80c399e2c6b06ace8b631164c35
Change-Id: I2a256fc6bad51116791ef2a95c75ed66a652a9a8
Change-Id: If332ef90744494487029b510ffbf936b78d06697
Change-Id: I7f5a5bb1052ce3dd12fea97658f083db9464adf5
Change-Id: I9f542288e9663201fdc2227577d6642b8fd86b09
Change-Id: Ia96af5da4bfc8388c2dbb60659cf46685c176a6f
Merge upstream balzar
Change-Id: Ie7a3c9b5da41da83dae663dd123e1f64a394ee2c
Change-Id: Ifee28a2acbd2abfe3d8dbce0880eaa94a1f65131
Revert constraints back to train
Update default resource properties
Change I1fa9b40823bac94550a0fc1b83a9f6818936cea4 could raise manager_ex.ResourceProviderNotFound, but didn't define it.
This adds the flavor.instance plugin, where users request a reservation
similar to:
openstack reservation lease create test --reservation \
resource_type=flavor:instance,amount=2,\
flavor_id='e26a4241-b83d-4516-8e0e-8ce2665d1966'
This uses lots of ideas from the existing instance reservation plugin,
and where possible leans on some of the existing logic, currently only
filter_hosts_by_reservation.
The plugin is not currently usable. There are follow-on patches that
implement reserve_resource and then finally update_reservation.
Change-Id: I7507e87908e16b313fd624810d6f43cb73dddafe
(cherry picked from commit d5dadf2)
This implements everything except update_reservation, so you can create, use and delete flavor-based reservations. We are able to re-use the on_start and on_end implementation from the instance plugin, along with its cleanup_resources implementation. However, the flavors created for each reservation are different, because we copy the details from the source flavor, then add the Blazar-specific resource requests on top. This allows users to make use of pinned CPUs, huge pages, and simple PCI device requests and vGPUs. We do not support all flavor options, and these flavors will be rejected. Change-Id: I5b2c9fded67ae7c593ea50ebef0f42b6c5856324 (cherry picked from commit 8f2fab3)
Change-Id: Ia3470b5423a9757a8c43d2cbc2e90ffaca0e983b (cherry picked from commit 7490a7f)
Change-Id: I98accb0f8caa652c6091f361c9eb7ff8279453da (cherry picked from commit 1e85ec3)
…rvation Feat/backport flavor reservation
The flavor plugin didn't pass "lease" to on_start and on_end, which wouldn't work.
Email relay is configured under the host plugin still based on our email script. See ChameleonCloud/kolla-containers@ee83055: allocation_candidates operatoes on a copy of the reservation, so the side effect of setting before_end doesn't do anything. Instead we set it in reserve_resource, which is actually creating the DB entry.
Add `filter_ironic_hosts` setting to exclude ironic hosts from those available for flavor reservations. ALlows coexistence of host reservations for ironic with flavor reservations for VMs. Extracted from Chameleon 2fd82f9 Co-authored-by: Mark-Powers Change-Id: Icbebb86386d99a006a84b161ee05ec7c005acbae
Filter flavor reservation host candidates by the authorized_projects extra capability, matching the behavor for host reservations. Extracted from Chameleon 2fd82f9 Co-authored-by: Mark Powers <markpowers@uchicago.edu> Change-Id: Ib54cf2a1aa07b52982b52365c8efd8babeba1314
Implement update_reservation for the flavor plugin. Allows changing lease's start and end dates. Attempting to update other properties will raise CantUpdateParameter. Extracted from Chameleon 7dbcb24, 7b6cff2, and 12d31f3. Co-authored-by: Mark Powers <markpowers@uchicago.edu> Change-Id: I2808a29ee541740d03a5132cf853369216c33a03
Add a backward-compatible version= param to BlazarNovaClient/NovaClientWrapper so the flavor plugin can pin microversion 2.55 (required to set a flavor description) without bumping the global nova_client_version.
Give each reserved Nova flavor a human-readable description of the form "<lease name> (ID: <lease id>)" so that users can see which lease each flavor is from. Needs nova microversion >= 2.55 to set flavor description. Extracted from Chameleon 3d88112 and dd69493 Co-authored-by: Mark Powers <markpowers@uchicago.edu> Change-Id: I94ab29514af601befdbb9e9b57ad753ef10baf53
Add query and microversion parameters to list_resource_providers so callers can filter server-side: e.g. required=<traits> for trait matching, or in_tree=<rp_uuid> for child resource providers. Now raises ResourceProviderListFailed on error instead of silently returning an empty list. Extracted from Chameleon 515a2ee and 56b9e23 Co-authored-by: Mark Powers <markpowers@uchicago.edu> Change-Id: Ic3732e26e58d4137dffee19ee04242d0b69e5bb6
Maps traits from flavors (required or forbidden) to a placement query, and filters out hosts not matched by placement. Extracted from Chameleon 515a2ee, 56b9e23 and 29abc8a. (Superseded commits 1ba0fd0, 6e28462 and ecd9d40.) Change-Id: I7871b796ba95b6a2aca6bf0343c9676605f20e19 Co-authored-by: Mark Powers <markpowers@uchicago.edu>
Previously, computehost inventory was taken from the placement resource provider for that host, but ignored any child resources nested under it in the same tree, such as GPUs. Instead, fetch the full tree of RPs from placement, and sum resources across them. TODO: child RPs may have different min_unit, max_unit, step_size, and allocation_ratio. It's not really valid to sum across them if they don't match. For now we emit a warning in this case. Squashed from chameleoncloud/2023.1-kvm-rebase 7ebe0ce (summing) and 13af89c (max_unit warning). Change-Id: Ib3cd3b5d008a60107cad2e9ab6b7e918684195a3 Co-authored-by: Mark Powers <markpowers@uchicago.edu>
Fixes the max usage calculation on a host to use the actual number of allocations on that host. Previously, this used 'amount' as the number of allocations, which is not correct in the case where a reservation has allocations spread across multiple hosts. A 10-instance reservation spread over 5 hosts reported 10x usage on each host, so capacity checks rejected hosts that were actually free. Ported from chameleoncloud/2023.1-kvm-rebase 45d37e9. Change-Id: I30d39629050accb81392b3555a338caed0d7d8aa Co-authored-by: Mark Powers <markpowers@uchicago.edu>
As the instance plugin doesn't declare a config section, checking retry_allocation_without_defaults or display_default_resource_properties raises would raise NoSuchOptError. First introduced in 23dd353 "Update default resource properties" Fix extracted from chameleoncloud/2023.1-kvm-rebase 2c35148. Change-Id: I6caeb0b45d5d86724f60fc69aba99c5afc8cf1fa Co-authored-by: Mark Powers <markpowers@uchicago.edu>
poll_resource_failures logs an error referencing the most recent physical:host reservation, but crashes if there has never been one. For now, skip the host in this case. TODO: We should clean up properly by making sure the host is in the freepool instead of skipping. First introduced in 6a6010f "Host aggregate cleanup - UTC time fix and better logging (#96)" Fix extracted from chameleoncloud/2023.1-kvm-rebase 7d80cf7. Co-authored-by: Mark Powers <markpowers@uchicago.edu> Change-Id: I3ace395855f665e10282e7b3eb2b3ab0e1d32af1
Extracted from chameleoncloud/2023.1-kvm commit 7d80cf7 Co-authored-by: Mark Powers <markpowers@uchicago.edu> Change-Id: I3daa469e370d5114f31fcd7cd50c5285c221e971
Similar to host plugin, adds `randomize_host_selection` config to the flavor plugin. This setting causes the allocation candidates for flavor reservation to be shuffled, avoiding packing all reservations into the same hosts. (cherry picked from commit d19bcbe) Co-authored-by: Mark Powers <markpowers@uchicago.edu> Change-Id: I18c3b525abf4cdfd039ee3d7b11bcc1492448426
Add filter_vm_hosts filter exclude kvm hosts from physical host reservations. Useful in "hybrid" case where baremetal hosts should have host reservations, and kvm hosts should have flavor reservations. (cherry picked from commit 2fd82f9) Co-authored-by: Mark Powers <markpowers@uchicago.edu> Change-Id: Icbebb86386d99a006a84b161ee05ec7c005acbae
Adds db query to fetch instance_reservation_get_by_reservation_id. This is needed because instance reservations carry information about "how much" of a resource is used, opposed to only the start and end dates. Prerequisite for resource usage calculations for flavor calendar and enforcement. Extracted from chameleoncloud/2023.1-kvm-rebase 04e5b71 Co-authored-by: Mark Powers <markpowers@uchicago.edu> Change-Id: I3ef04e728ac66bb67c3852052e0f35fa06ea3674
For host allocations corresponding to instance flavor reservations, add resource usage information the api response. This is necessary for the flavor calendar in horizon to display how much of a host is allocation, rather than only the start and end dates of each reservation. Currently, only vcpus, memory, and disk are tracked. (cherry picked from commit 04e5b71) Co-authored-by: Mark Powers <markpowers@uchicago.edu> Change-Id: I8cf0e014b6ade6a9a2870eed85370d18f99a37f7
When set, allows admins to bypass physical:host and project_restricted filters, primarily to block off hosts for maintenance or debugging. Extracted from commit cc53690 Co-authored-by: Mark Powers <markpowers@uchicago.edu> Change-Id: Ibe3cd360bbd706cda49bc33156bc319b2485d4b6
Users don't specify resource/hypervisor properties when making flavor reservations, so there is no need to check them. (cherry picked from commit 549d6ac) Co-authored-by: Mark Powers <markpowers@uchicago.edu> Change-Id: I4f122093cd4de4e358cbe8a5cfe7dbfb8ca1354c
Chameleon commit a22868f refactored the blazar nova api client. Unlike upstream, it doesn't take the project_id from ctx.current(), so pass it directly. Change-Id: If8926e4b77d23e7d73e6e5263ebd1b166ea0b337
create_lease passed reservations to enforcement directly from the request body, skipping extra information that plugins may have added during the creation process. (Flavor plugin adds vcpus, memory, ...) Fix by fetching values as persisted to the DB, after plugins have acted. Extracted from chameleon commit b549a00 Co-authored-by: Mark Powers <markpowers@uchicago.edu> Change-Id: I14c0d067fc293651130fb1c24e099f56f2d4b0ed
Change-Id: Ic9b974b7978c0b2967692f991a15534182490b12 (cherry picked from commit 9bc3045)
msherman64
force-pushed
the
fix/usage_extra
branch
from
August 3, 2026 22:29
6728e17 to
7992451
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.