Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This patch adds the new provisioning state AVAILABLE, and bumps the API microversion to 1.1. This version exposes the renaming of the previous provision_state="None" to provision_state="available" for nodes which are available for use. A database migration is added which updates all DB records' provision_state from NOSTATE to AVAILABLE. Since database migrations and code changes may be rolled out at different times, the conductor can deploy to a node in either NOSTATE or AVAILABLE states. OperatorImpact: This change should be rolled out to production services, and the conductor service should be restarted, *before* the database migration is applied. Ironic will then begin "translating" existing node states to the new AVAILABLE state automatically when it touches them. If the DB migration is run much later, it may not actually update any records (and that is OK). DocImpact: This change updates the Node provision_state value which represents a node that is available for provisioning. It is changed from "None" to "available", but this change is only realized when the X-OpenStack-Ironic-API-Version header is >= 1.1 *** NOTE *** Nova interprets the provision_state of Nodes to determine which should be exposed to the scheduler and counted as available resources. Up to the Juno release, Nova looked for the "NOSTATE" state to indicate this, represented as provision_state=None. After commit Idbd36b230cf997bed7a86c3f56cf9c70995028b2 landed in Nova, both the old "None" and new "available" states are interpreted in this way. As such, Nova may continue to use Juno Ironic, which did not support microversions, or may begin using the 1.1 version. Implements: blueprint new-ironic-state-machine Change-Id: I5e6f6ee5877d475136ce2ebad4a9333b424dc96b
- Loading branch information
1 parent
4159532
commit e7958de
Showing
14 changed files
with
182 additions
and
53 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,7 +38,7 @@ | |
|
||
|
||
MIN_VER = 0 | ||
MAX_VER = 0 | ||
MAX_VER = 1 | ||
|
||
|
||
class MediaType(base.APIBase): | ||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
52 changes: 52 additions & 0 deletions
52
ironic/db/sqlalchemy/alembic/versions/5674c57409b9_replace_nostate_with_available.py
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# 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. | ||
|
||
"""replace NOSTATE with AVAILABLE | ||
Revision ID: 5674c57409b9 | ||
Revises: 242cc6a923b3 | ||
Create Date: 2015-01-14 16:55:44.718196 | ||
""" | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = '5674c57409b9' | ||
down_revision = '242cc6a923b3' | ||
|
||
from alembic import op | ||
from sqlalchemy import String | ||
from sqlalchemy.sql import table, column | ||
|
||
node = table('nodes', | ||
column('uuid', String(36)), | ||
column('provision_state', String(15))) | ||
|
||
|
||
# NOTE(deva): We must represent the states as static strings in this migration | ||
# file, rather than import ironic.common.states, because that file may change | ||
# in the future. This migration script must still be able to be run with | ||
# future versions of the code and still produce the same results. | ||
AVAILABLE = 'available' | ||
|
||
|
||
def upgrade(): | ||
op.execute( | ||
node.update().where( | ||
node.c.provision_state == None).values( | ||
{'provision_state': op.inline_literal(AVAILABLE)})) | ||
|
||
|
||
def downgrade(): | ||
op.execute( | ||
node.update().where( | ||
node.c.provision_state == op.inline_literal(AVAILABLE)).values( | ||
{'provision_state': None})) |
This file contains 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
This file contains 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
Oops, something went wrong.