

digraph OpenNebula {
    graph [
        nodesep= 0.5,
        ratio=1,
        pad=1,
    ];

    node [fontname="Helvetica"];
    edge [fontname="Menlo"];
    
    user [
        fillcolor="black",
        style="filled", shape="box",
        fontcolor="white", fontsize= "24.0"];

    ANY [ shape="box" ];
    "ANY \\ {suspended,poweroff,done}" [ shape="box" ];

    subgraph { rank = min; user}
#    subgraph { rank = same; pending; hold; color="white"}
    subgraph { rank = same; prolog; boot; color="white" }
    subgraph { rank = same; migrate; save; shutdown; unknown; hotplug; 
        color="white" }
    subgraph { rank = max; suspended; done; failure; stopped; poweroff; color="white" }

#   create
    user -> pending [label="create"];

#   deploy
    pending     -> prolog [label="deploy"];
    prolog      -> boot [style="dashed"];
    boot        -> running [style="dashed"];

#   shutdown
    running     -> shutdown [label="shutdown"];
    shutdown    -> epilog [label="shutdown", style="dashed"];
    epilog      -> done [style="dashed"];

#   poweroff
    running     -> shutdown [label="poweroff"];
    shutdown    -> poweroff [label="poweroff", style="dashed"];

#   livemigrate
    running     -> migrate [label="livemigrate"];
    migrate     -> running [label="livemigrate", style="dashed"];

#   migrate
    running     -> save [label="migrate"];
    save        -> migrate [label="migrate", style="dashed"];
    migrate     -> boot [label="migrate", style="dashed"];

#   hold
    pending     -> hold [label="hold"];

#   release
    hold        -> pending [label="release"];

#   stop
    running     -> save [label="stop"];
    save        -> epilog [label="stop", style="dashed"];
    epilog      -> stopped [label="stop", style="dashed"];

#   cancel
    running     -> shutdown [label="cancel"];

#   suspend
    running     -> save [label="suspend"];
    save        -> suspended [label="suspend", style="dashed"];

#   resume
    stopped     -> pending [label="resume"];
    suspended   -> boot [label="resume"];

#   delete
    ANY         -> done [label="delete"];

#   restart
    unknown     -> boot [label="restart"];
    boot        -> boot [label="restart"];
    poweroff    -> boot [label="restart"];

#   reboot, reset
    running     -> running [label="reboot / reset"];

#   attachdisk
    running     -> hotplug [label="attachdisk / detachdisk"]
    hotplug     -> running [style="dashed"];

#   resubmit
    "ANY \\ {suspended,done}" -> pending [label="resubmit"];

#   failures and misc.
    ANY         -> failure [style="dotted"];
}
