diff options
author | Josh Gachnang <josh@pcsforeducation.com> | 2015-02-17 17:42:18 -0800 |
---|---|---|
committer | Jim Rollenhagen <jim@jimrollenhagen.com> | 2015-03-13 15:42:11 -0700 |
commit | 7589d1faaf5415c12b2e738c6c09b17b65993235 (patch) | |
tree | f2c5c73ee18795f04cd608fe70706e8b6b1581b6 /ironic/db | |
parent | e807e28986f3b11a1569c2b4a4fddedef100a119 (diff) | |
download | ironic-7589d1faaf5415c12b2e738c6c09b17b65993235.tar.gz |
Implement execute clean steps
This implements executing the clean steps in the conductor. The RPC
API version is bumped to allow async clean steps to call back
to the conductor.
Adds node.clean_step to store the current cleaning operation.
The conductor will get a list of clean steps from the node's drivers,
order them by priority, and then have the drivers execute the steps
in order.
Adds a config option to enable cleaning, defaulting to True.
Related-bug: #1174153
Implements blueprint implement-cleaning-states
Change-Id: I96af133c501f86a6e620c4684ee65abad2111f7b
Diffstat (limited to 'ironic/db')
-rw-r--r-- | ironic/db/sqlalchemy/alembic/versions/4f399b21ae71_add_node_clean_step.py | 35 | ||||
-rw-r--r-- | ironic/db/sqlalchemy/models.py | 1 |
2 files changed, 36 insertions, 0 deletions
diff --git a/ironic/db/sqlalchemy/alembic/versions/4f399b21ae71_add_node_clean_step.py b/ironic/db/sqlalchemy/alembic/versions/4f399b21ae71_add_node_clean_step.py new file mode 100644 index 000000000..a8c57983d --- /dev/null +++ b/ironic/db/sqlalchemy/alembic/versions/4f399b21ae71_add_node_clean_step.py @@ -0,0 +1,35 @@ +# 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 node.clean_step + +Revision ID: 4f399b21ae71 +Revises: 1e1d5ace7dc6 +Create Date: 2015-02-18 01:21:46.062311 + +""" + +# revision identifiers, used by Alembic. +revision = '4f399b21ae71' +down_revision = '1e1d5ace7dc6' + +from alembic import op +import sqlalchemy as sa + + +def upgrade(): + op.add_column('nodes', sa.Column('clean_step', sa.Text(), + nullable=True)) + + +def downgrade(): + op.drop_column('nodes', 'clean_step') diff --git a/ironic/db/sqlalchemy/models.py b/ironic/db/sqlalchemy/models.py index 6cbe5394c..ecc908885 100644 --- a/ironic/db/sqlalchemy/models.py +++ b/ironic/db/sqlalchemy/models.py @@ -167,6 +167,7 @@ class Node(Base): driver = Column(String(15)) driver_info = Column(JSONEncodedDict) driver_internal_info = Column(JSONEncodedDict) + clean_step = Column(JSONEncodedDict) # NOTE(deva): this is the host name of the conductor which has # acquired a TaskManager lock on the node. |