~cloudbuilders/nova/os-keypair-integration

« back to all changes in this revision

Viewing changes to nova/scheduler/driver.py

  • Committer: Vishvananda Ishaya
  • Date: 2011-09-01 04:55:12 UTC
  • mfrom: (1455.1.62 nova)
  • Revision ID: vishvananda@gmail.com-20110901045512-ndwp9nu3alwbnnj8
merge trunk, fix tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
from nova import rpc
31
31
from nova import utils
32
32
from nova.compute import power_state
 
33
from nova.compute import vm_states
33
34
from nova.api.ec2 import ec2utils
34
35
 
35
36
 
104
105
                                          dest, block_migration)
105
106
 
106
107
        # Changing instance_state.
107
 
        db.instance_set_state(context,
108
 
                              instance_id,
109
 
                              power_state.PAUSED,
110
 
                              'migrating')
 
108
        values = {"vm_state": vm_states.MIGRATING}
 
109
        db.instance_update(context, instance_id, values)
111
110
 
112
111
        # Changing volume state
113
112
        for volume_ref in instance_ref['volumes']:
129
128
        """
130
129
 
131
130
        # Checking instance is running.
132
 
        if (power_state.RUNNING != instance_ref['state'] or \
133
 
           'running' != instance_ref['state_description']):
 
131
        if instance_ref['power_state'] != power_state.RUNNING:
134
132
            instance_id = ec2utils.id_to_ec2_id(instance_ref['id'])
135
133
            raise exception.InstanceNotRunning(instance_id=instance_id)
136
134