~hudson-openstack/nova/trunk

« back to all changes in this revision

Viewing changes to nova/db/sqlalchemy/models.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:
193
193
    key_name = Column(String(255))
194
194
    key_data = Column(Text)
195
195
 
196
 
    state = Column(Integer)
197
 
    state_description = Column(String(255))
 
196
    power_state = Column(Integer)
 
197
    vm_state = Column(String(255))
 
198
    task_state = Column(String(255))
198
199
 
199
200
    memory_mb = Column(Integer)
200
201
    vcpus = Column(Integer)
238
239
    access_ip_v4 = Column(String(255))
239
240
    access_ip_v6 = Column(String(255))
240
241
 
241
 
    # TODO(vish): see Ewan's email about state improvements, probably
242
 
    #             should be in a driver base class or some such
243
 
    # vmstate_state = running, halted, suspended, paused
244
 
    # power_state = what we have
245
 
    # task_state = transitory and may trigger power state transition
246
 
 
247
 
    #@validates('state')
248
 
    #def validate_state(self, key, state):
249
 
    #    assert(state in ['nostate', 'running', 'blocked', 'paused',
250
 
    #                     'shutdown', 'shutoff', 'crashed'])
251
 
 
252
242
 
253
243
class VirtualStorageArray(BASE, NovaBase):
254
244
    """