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
Fix flavor reservation before_end code
This is a customization in our fork, and so needed fixing.
Email relay is configured under the host plugin still based on our email script. See
ChameleonCloud/kolla-containers@ee83055:
  • Loading branch information
Mark-Powers committed Mar 10, 2025
commit 8197f7030cbacfa61f206a2c077604f9c6279763
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Copyright 2025 OpenStack Foundation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Add flavor before end column

Revision ID: a167bcf47857
Revises: 95bd85fe13f0
Create Date: 2025-01-27 19:02:30.182818

"""

# revision identifiers, used by Alembic.
revision = 'a167bcf47857'
down_revision = '95bd85fe13f0'

from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql

def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('instance_reservations', sa.Column('before_end', sa.String(length=36), nullable=True))
# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('instance_reservations', 'before_end')
# ### end Alembic commands ###
1 change: 1 addition & 0 deletions blazar/db/sqlalchemy/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ class InstanceReservations(mb.BlazarBase, mb.SoftDeleteMixinWithUuid):
flavor_id = sa.Column(sa.String(36), nullable=True)
aggregate_id = sa.Column(sa.Integer, nullable=True)
server_group_id = sa.Column(sa.String(36), nullable=True)
before_end = sa.Column(sa.String(36))


class ComputeHostAllocation(mb.BlazarBase, mb.SoftDeleteMixinWithUuid):
Expand Down
8 changes: 8 additions & 0 deletions blazar/plugins/flavor/flavor_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@

LOG = logging.getLogger(__name__)


before_end_options = ['', 'snapshot', 'default', 'email']

QUERY_TYPE_ALLOCATION = 'allocation'


Expand Down Expand Up @@ -74,6 +77,11 @@ def query_allocations(self, hosts, lease_id=None, reservation_id=None):

def allocation_candidates(self, reservation):
"""Return a list of candidate host_ids."""
if 'before_end' not in reservation:
reservation['before_end'] = 'default'
if reservation['before_end'] not in before_end_options:
raise mgr_exceptions.MalformedParameter(param='before_end')

host_ids, _ = self._pick_hosts(reservation)
return host_ids

Expand Down