From b1b58239dbe4dc05852a35528d87a2257ceaaf7a Mon Sep 17 00:00:00 2001 From: Zhenguo Niu Date: Tue, 6 Jun 2017 17:34:43 +0800 Subject: [PATCH] [DOC] Add states and transitons diagram Change-Id: Ifcc942612dd2371d9af1ec5174f61c2aeec4a008 --- doc/source/conf.py | 1 + doc/source/index.rst | 8 ++++++- doc/source/states.rst | 52 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 doc/source/states.rst diff --git a/doc/source/conf.py b/doc/source/conf.py index 7bf9cb3d..82be7947 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -24,6 +24,7 @@ extensions = [ 'openstackdocstheme', 'oslo_config.sphinxconfiggen', 'oslo_policy.sphinxpolicygen', + 'sphinx.ext.graphviz', ] # openstackdocstheme options diff --git a/doc/source/index.rst b/doc/source/index.rst index e2d317d3..5fd2de70 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -53,6 +53,13 @@ project. Developer Contribution Guide Setting Up Your Development Environment +The following pages describe the architecture of the service. + +.. toctree:: + :maxdepth: 1 + + States and Transitions + Advanced testing and guides --------------------------- @@ -61,7 +68,6 @@ Advanced testing and guides dev/gmr - Administrator's Guide ===================== diff --git a/doc/source/states.rst b/doc/source/states.rst new file mode 100644 index 00000000..46882714 --- /dev/null +++ b/doc/source/states.rst @@ -0,0 +1,52 @@ +States and Transitions +====================== + +The following diagram shows the states that a server goes through +during the lifetime. + +Allowed State Transitions +-------------------------- + +.. graphviz:: + + digraph states { + graph [pad=".35", ranksep="0.65", nodesep="0.55", concentrate=true]; + node [fontsize=10 fontname="Monospace"]; + edge [arrowhead="normal", arrowsize="0.8"]; + label="All states are allowed to transition to DELETING, MAINTENANCE and ERROR."; + forcelabels=true; + labelloc=bottom; + labeljust=left; + + /* states */ + building [label="BUILDING"] + active [label="ACTIVE"] + stopped [label="STOPPED"] + powering_on [label="POWERING_ON"] + powering_off [label="POWERING_OFF"] + soft_powering_off [label="SOFT_POWERING_OFF"] + rebooting [label="REBOOTING"] + soft_rebooting [label="SOFT_REBOOTING"] + rebuilding [label="REBUILDING"] + deleting [label="DELETING", color="red"] + error [label="ERROR", color="red"] + maintenance [label="MAINTENANCE", color="red"] + + /* transitions [action] */ + active -> rebuilding + active -> powering_off + active -> soft_powering_off + active -> rebooting + active -> soft_rebooting + + stopped -> powering_on + stopped -> rebuilding + + building -> active + rebuilding -> active + powering_on -> active + powering_off -> stopped + soft_powering_off -> stopped + rebooting -> active + soft_rebooting -> active + }