diff options
| author | Brian Lamar <brian.lamar@rackspace.com> | 2011-08-18 12:34:01 -0400 |
|---|---|---|
| committer | Brian Lamar <brian.lamar@rackspace.com> | 2011-08-18 12:34:01 -0400 |
| commit | cab13dbfd652d1fcf9443e796e50f7eb374fc3fc (patch) | |
| tree | 5da76f57c882dd6c8360914e05a475f26c64274a /nova/scheduler | |
| parent | 1d1d027554d6be355bd9b52b2d87081d06f05045 (diff) | |
Updated a number of items to pave the way for new states.
Diffstat (limited to 'nova/scheduler')
| -rw-r--r-- | nova/scheduler/driver.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/nova/scheduler/driver.py b/nova/scheduler/driver.py index f28353f05..b788b996f 100644 --- a/nova/scheduler/driver.py +++ b/nova/scheduler/driver.py @@ -30,6 +30,8 @@ from nova import log as logging from nova import rpc from nova import utils from nova.compute import power_state +from nova.compute import task_state +from nova.compute import vm_state from nova.api.ec2 import ec2utils @@ -104,10 +106,8 @@ class Scheduler(object): dest, block_migration) # Changing instance_state. - db.instance_set_state(context, - instance_id, - power_state.PAUSED, - 'migrating') + values = {"vm_state": vm_state.MIGRATE} + db.instance_update(context, instance_id, values) # Changing volume state for volume_ref in instance_ref['volumes']: @@ -129,8 +129,7 @@ class Scheduler(object): """ # Checking instance is running. - if (power_state.RUNNING != instance_ref['state'] or \ - 'running' != instance_ref['state_description']): + if instance_ref['power_state'] != power_state.RUNNING: instance_id = ec2utils.id_to_ec2_id(instance_ref['id']) raise exception.InstanceNotRunning(instance_id=instance_id) |
