This document describes States for various cloudStack objects
1) Zone
Allocation State:
- Enabled - zone is enabled for resources creation/allocation. Any user can deployVms/createVolumes/create other cloudStack objecs in this zone.
- Disabled - zone is disabled for resources allocation by regular user / domain Admin. Only ROOT admin can deployVms/destroyVms/do other kinds of operations when zone is in this state.
2) Host
State (state of the actual physical host):
- Creating - addHost command just has been called, and the record was created in the DB for it. Next state is Connecting
- Connecting - host is connecting to the cloudStack.
- Up - host is up and connected to cloudStack
- Down - host is considered to be Down by cloudStack. And can be removed at this point.
- Disconnected - host is Disconnected from the cloudStack
- Alert - the host state can't be determined, and cloudStack is going to make (or already making) an investigation before marking host as Down.
- Removed - host is Removed
- Error - host failed to create.
- Rebalancing - host is being relalanced from one management server to another (cluster setup)
ResourceState:
- Creating - host is being created.
- Enabled - host is enabled for resource allocation
- Disabled - host is disabled for resources allocation.
- PrepareForMaintenance - the maintenance has started and going on for the host.
- ErrorInMaintenance - maintenance failed for the host
- Maintenance - the maintenance has completed for the host.
- Error - host failed to create.
3) StoragePool
State:
- Up - storage pool is up, and can be used for volumes allocation
- PrepareForMaintenance - maintenance has started, and going on for this storage pool.
- ErrorInMaintenance - maintenance failed
- CancelMaintenance - maintenance is cancelled
- Maintenance - storage pool is in maintenance state
- Removed - the storage pool is marked for removal. It will not stay in this state for long, a matter of seconds, till the database objects referencing it are removed.
4) Vm
State:
- Starting("VM is being started. At this state, you should find host id filled which means it's being started on that host.")
- Running("VM is running. host id has the host that it is running on")
- Stopping("VM is being stopped. host id has the host that it is being stopped on.")
- Stopped("VM is stopped. host id should be null.")
- Migrating("VM is being migrated. host id holds to from host")
- Error("VM is in error. Goes to this state when deployVm command fails")
- Unknown("VM state is unknown.")
- Shutdowned("VM is shutdowned from inside")
Vms in 2 states below, are never returned to the regular user
- Destroyed("VM is marked for destroy. Vm in Destroyed state can be recovered by the admin")
- Expunging("VM is being expunged. No recovery is possible at this point")
5) Volume
State:
- Allocated("The volume is allocated but has not been created yet.")
- Creating("The volume is being created. getPoolId() should reflect the pool where it is being created.")
- Ready("The volume is ready to be used.")
- Migrating("The volume is migrating to other storage pool")
- Expunging("The volume is being expunging")
- Destroy("The volume is destroyed, and can't be recovered.")
- UploadOp ("The volume upload operation is in progress or in short the volume is on secondary storage")
- Snapshotting ("There is a snapshot created on this volume, not backed up to secondary storage yet")
6) Network
- Allocated - Indicates the network configuration is in allocated but not setup (Vlan is not set, and network is not ready for use). Isolated network goes to this state right after it's created with NO Vlan passed in. As vlan is optional parameter in createNetwork call only for Isolated networks, you should see this state for isolated networks only.
- Setup - Indicates the network configuration is setup with Vlan from the moment it was created. Happens when vlan is passed in to the createNetwork call, so its immutable for the network for its entire lifecycle. Happens for Shared networks.
- Implementing - Indicates the network configuration is being implemented
- Implemented - Indicates the network configuration is ready to be used by VM (Vlan is set for the network)
Remark - the difference between Implemented and Setup state. When vlanId is passed in to createNetwork call, the newly created network is marked with Setup state - meaning that its never gonna release the vlan till the network is destroyed.
When no vlanId is passed in to the createNetwork, you leave the vlan allocation up to the cloudStack, and vlan can be different during the vm lifecycle. So network gets created in Allocated state, with no Vlan. Once the first vm is deployed in Isolated network, the vlan is allocated from the physical network vlan pool, and network goes to Implemented state. If there are no user vms running in the network for a certain period of time, the Vlan gets released and network goes to Allocated state back again. Till the new vm gets deployed in the network - and the vlan allocation cycle repeats again.
- Shutdown - Indicates the network configuration is being shutdown (this is intermediate state, although the name doesn't sound so). During this stage Vlan is being released, and the network goes back to Allocated state.
- Destroy - Indicates that the network is destroyed and not displayed to the end user.
State transition for networks:
- State.Allocated, Event.ImplementNetwork, State.Implementing
- State.Allocated, Event.DestroyNetwork, State.Destroy
- State.Implementing, Event.OperationSucceeded, State.Implemented
- State.Implementing, Event.OperationFailed, State.Shutdown
- State.Implemented, Event.DestroyNetwork, State.Shutdown
- State.Shutdown, Event.OperationSucceeded, State.Allocated
- State.Shutdown, Event.OperationFailed, State.Implemented
- State.Setup, Event.DestroyNetwork, State.Destroy
5) Firewall rule, Port Forwarding rule, Load Balancing rule, Network ACL rule
All the networking rules - firewall/pf/lb/acl - share the same set of states
- Staged, // Rule been created but has never got through network rule conflict detection. Rules in this state can not be sent to network elements.
- Add, // Add means the rule has been created and has gone through network rule conflict detection.
- Active, // Rule has been sent to the network elements and reported to be active.
- Revoke, // Revoke means this rule has been revoked. If this rule has been sent to the network elements, the rule will be deleted from database.
- Deleting // Another name for the "Revoke" state. Basically Revoke state is translated to "Deleting" so its more API/UI friendly.