implemented CreateSnapshot

This commit is contained in:
Anders Ingemann 2013-07-07 19:24:52 +02:00
parent 5acd0a0dc3
commit 20587148f4
2 changed files with 13 additions and 1 deletions

View file

@ -66,7 +66,8 @@ def tasks(tasklist, manifest):
filesystem.UnmountSpecials(),
filesystem.UnmountVolume(),
ebs.DetachVolume(),
filesystem.DeleteMountDir())
filesystem.DeleteMountDir(),
ebs.CreateSnapshot())
from common.tasks import TriggerRollback
tasklist.add(TriggerRollback())

View file

@ -63,6 +63,17 @@ class DetachVolume(Task):
info.volume.update()
class CreateSnapshot(Task):
description = 'Creating a snapshot of the EBS volume'
phase = phases.image_registration
def run(self, info):
info.snapshot = info.volume.create_snapshot()
while info.snapshot.status != 'completed':
time.sleep(2)
info.snapshot.update()
class DeleteVolume(Task):
phase = phases.cleaning
after = []