mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 07:26:29 +00:00
implemented CreateSnapshot
This commit is contained in:
parent
5acd0a0dc3
commit
20587148f4
2 changed files with 13 additions and 1 deletions
|
@ -66,7 +66,8 @@ def tasks(tasklist, manifest):
|
||||||
filesystem.UnmountSpecials(),
|
filesystem.UnmountSpecials(),
|
||||||
filesystem.UnmountVolume(),
|
filesystem.UnmountVolume(),
|
||||||
ebs.DetachVolume(),
|
ebs.DetachVolume(),
|
||||||
filesystem.DeleteMountDir())
|
filesystem.DeleteMountDir(),
|
||||||
|
ebs.CreateSnapshot())
|
||||||
|
|
||||||
from common.tasks import TriggerRollback
|
from common.tasks import TriggerRollback
|
||||||
tasklist.add(TriggerRollback())
|
tasklist.add(TriggerRollback())
|
||||||
|
|
|
@ -63,6 +63,17 @@ class DetachVolume(Task):
|
||||||
info.volume.update()
|
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):
|
class DeleteVolume(Task):
|
||||||
phase = phases.cleaning
|
phase = phases.cleaning
|
||||||
after = []
|
after = []
|
||||||
|
|
Loading…
Add table
Reference in a new issue