Adds support for Pause and Unpause of xenserver instances.

Pause freezes the vm, keeping resources in-memory. 

I used this version of python cloudservers to test with:
https://github.com/SandyWalsh/python-cloudservers

url's are
http://a.b.c.d/v1.0/servers/#######/pause
and
http://a.b.c.d/v1.0/servers/#######/unpause

Note: no support for libvirt.
This commit is contained in:
Sandy Walsh
2010-12-20 20:26:59 +00:00
committed by Tarmac
3 changed files with 10 additions and 1 deletions

View File

@@ -194,6 +194,7 @@ class HostInfo(object):
class NovaAdminClient(object):
def __init__(
self,
clc_url=DEFAULT_CLC_URL,

View File

@@ -127,6 +127,14 @@ class ComputeTestCase(test.TestCase):
self.assert_(instance_ref['launched_at'] < terminate)
self.assert_(instance_ref['deleted_at'] > terminate)
def test_pause(self):
"""Ensure instance can be paused"""
instance_id = self._create_instance()
self.compute.run_instance(self.context, instance_id)
self.compute.pause_instance(self.context, instance_id)
self.compute.unpause_instance(self.context, instance_id)
self.compute.terminate_instance(self.context, instance_id)
def test_reboot(self):
"""Ensure instance can be rebooted"""
instance_id = self._create_instance()