Files
gantt/nova/tests
Trey Morris cf963d3512 I've added suspend along with a few changes to power state as well. I can't imagine suspend will be controversial but I've added a new power state for "suspended" to nova.compute.power_states which libvirt doesn't use and updated the xenapi power mapping to use it for suspended state. I also updated the mappings in nova.api.openstack.servers to map PAUSED to "error" and SUSPENDED to "suspended". Thoughts there are that we don't currently (openstack API v1.0) use pause, so if somehow an instance were to be paused an error occurred somewhere, or someone did something in error. Either way asking the xenserver host for the status would show "paused". Support for more power states needs to be added to the next version of the openstack API.
merge notes:
merge with trunk went well locally
unittests passed locally
testing of suspend succeeded locally

Notes for testing:
Suspending an instance requires PV drivers.
If using the cloudservers API, suspend and resume are not implemented. I tested by modifying in place nova.api.openstack.servers after pulling my branch. I made pause() and unpause() immediately return self.suspend() and self.resume(). Afterwards cloudserver pause (id) and cloudserver unpause (id) will perform the suspend/resume, and you can watch the compute worker log for info on what is happening.

SAMPLE LOG OUTPUT FOR PAUSE/UNPAUSE +++++++++++++++++++++
DEBUG:root:instance 1178831109: pausing
INFO:root:Task OpaqueRef:ba3b1595-0d70-574a-aaca-27442d04be87 status: success.
INFO:root:(VM_UTILS) xenserver vm state -> |Paused|
INFO:root:(VM_UTILS) xenapi power_state -> |3|
DEBUG:root:instance 1178831109: unpausing
INFO:root:Task OpaqueRef:2d9cb792-0ce5-be23-6c50-3dc52cf1535c status: success.
INFO:root:(VM_UTILS) xenserver vm state -> |Running|
INFO:root:(VM_UTILS) xenapi power_state -> |1|

SAMPLE LOG OUTPUT FOR SUSPEND/RESUME +++++++++++++++++++++
DEBUG:root:instance 1178831109: suspending
INFO:root:Task OpaqueRef:bc5d51da-922f-c9fb-f07c-aaa027fde601 status: success.
INFO:root:(VM_UTILS) xenserver vm state -> |Suspended|
INFO:root:(VM_UTILS) xenapi power_state -> |7|
DEBUG:root:instance 1178831109: resuming
INFO:root:Task OpaqueRef:4e5a3af8-baed-c144-30ea-63637390f6c8 status: success.
INFO:root:(VM_UTILS) xenserver vm state -> |Running|
INFO:root:(VM_UTILS) xenapi power_state -> |1|
2010-12-28 05:51:31 +00:00
..
2010-08-03 16:51:37 +02:00
2010-11-03 14:38:14 -07:00
2010-08-03 16:51:37 +02:00
2010-12-23 21:41:54 +00:00