~hudson-openstack/nova/trunk

« back to all changes in this revision

Viewing changes to nova/compute/vm_states.py

  • Committer: Tarmac
  • Author(s): Brian Lamar, Dan Prince
  • Date: 2011-08-31 22:55:34 UTC
  • mfrom: (1443.3.61 instance_states)
  • Revision ID: tarmac-20110831225534-upfhtsvcsafyql6x
Fixed and improved the way instance "states" are set. Instead of relying on solely the power_state of a VM, there are now explicitly defined VM states and VM task states which respectively define the current state of the VM and the task which is currently being performed by the VM.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# vim: tabstop=4 shiftwidth=4 softtabstop=4
 
2
 
 
3
# Copyright 2010 OpenStack LLC.
 
4
# All Rights Reserved.
 
5
#
 
6
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
 
7
#    not use this file except in compliance with the License. You may obtain
 
8
#    a copy of the License at
 
9
#
 
10
#         http://www.apache.org/licenses/LICENSE-2.0
 
11
#
 
12
#    Unless required by applicable law or agreed to in writing, software
 
13
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 
14
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 
15
#    License for the specific language governing permissions and limitations
 
16
#    under the License.
 
17
 
 
18
"""Possible vm states for instances.
 
19
 
 
20
Compute instance vm states represent the state of an instance as it pertains to
 
21
a user or administrator. When combined with task states (task_states.py), a
 
22
better picture can be formed regarding the instance's health.
 
23
 
 
24
"""
 
25
 
 
26
ACTIVE = 'active'
 
27
BUILDING = 'building'
 
28
REBUILDING = 'rebuilding'
 
29
 
 
30
PAUSED = 'paused'
 
31
SUSPENDED = 'suspended'
 
32
RESCUED = 'rescued'
 
33
DELETED = 'deleted'
 
34
STOPPED = 'stopped'
 
35
 
 
36
MIGRATING = 'migrating'
 
37
RESIZING = 'resizing'
 
38
 
 
39
ERROR = 'error'