nova/doc/source/vmstates.rst
Markus Zoeller 7b352048bf devref: virtual machine states and transitions
The diagrams were hard to read and update. Replaced them with
simplified diagrams and tables. I used the content as is. I looks
inconsistent to me, but should now be easier to change.

Partially implements: blueprint devref-refresh-liberty

Change-Id: I707e1a6ab69ef44448b66e8be007307b5d73eb06
2015-07-03 11:10:41 +02:00

6.0 KiB

Virtual Machine States and Transitions

The following diagrams and tables show the required virtual machine (VM) states and task states for various commands issued by the user.

Allowed State Transitions

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 DELETED and ERROR."; forcelabels=true; labelloc=bottom; labeljust=left;

/* states */ building [label="BUILDING"] active [label="ACTIVE"] paused [label="PAUSED"] suspended [label="SUSPENDED"] stopped [label="STOPPED"] rescued [label="RESCUED"] resized [label="RESIZED"] soft_deleted [label="SOFT_DELETED"] shelved [label="SHELVED"] shelved_offloaded [label="SHELVED_OFFLOADED"] deleted [label="DELETED", color="red"] error [label="ERROR", color="red"]

/* transitions [action] */ building -> active

active -> active [headport=nw, tailport=ne] // manual layout active -> soft_deleted [tailport=e] // prevent arrowhead overlap active -> suspended active -> paused [tailport=w] // prevent arrowhead overlap active -> stopped active -> shelved active -> shelved_offloaded active -> rescued active -> resized

soft_deleted -> active [headport=e] // prevent arrowhead overlap

suspended -> active suspended -> shelved suspended -> shelved_offloaded

paused -> active paused -> shelved paused -> shelved_offloaded

stopped -> active stopped -> stopped [headport=nw, tailport=ne] // manual layout stopped -> resized stopped -> rescued stopped -> shelved stopped -> shelved_offloaded

resized -> active

rescued -> active

shelved -> shelved_offloaded shelved -> active

shelved_offloaded -> active

}

Requirements for Commands

Command Req'd VM States Req'd Task States Target State

pause

Active, Shutoff, Rescued

Resize Verify, unset

Paused

unpause Paused N/A Active
suspend Active, Shutoff N/A Suspended
resume Suspended N/A Active
rescue Active, Shutoff Resize Verify, unset Rescued
unrescue Rescued N/A Active
set admin password Active N/A Active
rebuild Active, Shutoff Resize Verify, unset Active
force delete Soft Deleted N/A Deleted
restore Soft Deleted N/A Active

soft delete

Active, Shutoff, Error

N/A

Soft Deleted

delete

Active, Shutoff, Building, Rescued, Error

N/A

Deleted

backup Active, Shutoff N/A Active, Shutoff
snapshot Active, Shutoff N/A Active, Shutoff
start Shutoff, Stopped N/A Active

stop

Active, Shutoff, Rescued

Resize Verify, unset

Stopped

reboot

Active, Shutoff, Rescued

Resize Verify, unset

Active

resize Active, Shutoff Resize Verify, unset Resized
revert resize Active, Shutoff Resize Verify, unset Active
confirm resize Active, Shutoff Resize Verify, unset Active

VM states and Possible Commands

VM State Commands
Paused unpause
Suspended resume

Active

set admin password, suspend, pause, rescue, rebuild, soft delete, delete, backup, snapshot, stop, reboot, resize, revert resize, confirm resize

Shutoff

suspend, pause, rescue, rebuild, soft delete, delete, backup, start, snapshot, stop, reboot, resize, revert resize, confirm resize

Rescued unrescue, pause
Stopped rescue, delete, start
Soft Deleted force delete, restore
Error soft delete, delete
Building delete
Rescued delete, stop, reboot

Create Instance States

The following diagram shows the sequence of VM states, task states, and power states when a new VM instance is created.

seqdiag {

edge_length = 250; span_height = 40; node_width=200; default_note_color = lightblue;

// Use note (put note on rightside) api [label="Compute.api"]; manager [label="Compute.manager"]; api -> manager [label = "create_db_entry_for_new_instance", note = "VM: Building Task: Scheduling Power: No State"]; manager -> manager [label="_start_building", note ="VM: Building Task: None"]; manager -> manager [label="_allocate_network", note ="VM: Building Task: Networking"]; manager -> manager [label="_prep_block_device", note ="VM: Building Task: Block_Device_Mapping"]; manager -> manager [label="_spawn", note ="VM: Building Task: Spawning"]; api <-- manager [note ="VM: Active Task: None"];

}