diff options
author | Lucas Alvares Gomes <lucasagomes@gmail.com> | 2015-07-09 16:29:12 +0100 |
---|---|---|
committer | Lucas Alvares Gomes <lucasagomes@gmail.com> | 2015-07-27 14:43:19 +0100 |
commit | b6ed09e297e84f6cc1ded13e9d9869d2effb3833 (patch) | |
tree | fb62b6560dfe5d8260c0772b4e0122621e95af1a /ironic/common/states.py | |
parent | 7f88443bce1c236da94a24eca577d4a579466016 (diff) | |
download | ironic-b6ed09e297e84f6cc1ded13e9d9869d2effb3833.tar.gz |
Add CLEANWAIT state
This patch adds the CLEANWAIT state. When a node is in CLEANWAIT means
that the ramdisk is executing a clean step (async). When the node is
in CLEANING state it means that the conductor is executing a clean step
(sync).
This is the first patch of a series that aim to make nodes in CLEANWAIT
abortable. We still need a way need some way to tell if a step is
abortable; aborting steps could have negative effects such as bricking
things.
Depends-On: I195ecd90e7e4165504da5ac330cee3fc7c3039c2
Co-Authored-By: Jim Rollenhagen <jim@jimrollenhagen.com>
Partial-Bug: #1455825
Change-Id: Ic2bc4f147f68947f53d341fda5e0c8d7b594a553
Diffstat (limited to 'ironic/common/states.py')
-rw-r--r-- | ironic/common/states.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/ironic/common/states.py b/ironic/common/states.py index 7fef39cf8..14ee211e0 100644 --- a/ironic/common/states.py +++ b/ironic/common/states.py @@ -132,6 +132,13 @@ represented in target_provision_state. CLEANING = 'cleaning' """ Node is being automatically cleaned to prepare it for provisioning. """ +CLEANWAIT = 'clean wait' +""" Node is waiting to be cleaned. + +This will be the node `provision_state` while the node is waiting for +the driver to finish cleaning step. +""" + CLEANFAIL = 'clean failed' """ Node failed cleaning. This requires operator intervention to resolve. """ @@ -220,6 +227,7 @@ machine.add_state(DEPLOYFAIL, target=ACTIVE, **watchers) # Add clean* states machine.add_state(CLEANING, target=AVAILABLE, **watchers) +machine.add_state(CLEANWAIT, target=AVAILABLE, **watchers) machine.add_state(CLEANFAIL, target=AVAILABLE, **watchers) # Add delete* states @@ -278,6 +286,11 @@ machine.add_transition(CLEANING, AVAILABLE, 'done') # If cleaning fails, wait for operator intervention machine.add_transition(CLEANING, CLEANFAIL, 'fail') +machine.add_transition(CLEANWAIT, CLEANFAIL, 'fail') + +# A deployment may also wait on external callbacks +machine.add_transition(CLEANING, CLEANWAIT, 'wait') +machine.add_transition(CLEANWAIT, CLEANING, 'resume') # An operator may want to move a CLEANFAIL node to MANAGEABLE, to perform # other actions like zapping |