mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-22 18:00:35 +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.UnmountVolume(),
|
||||
ebs.DetachVolume(),
|
||||
filesystem.DeleteMountDir())
|
||||
filesystem.DeleteMountDir(),
|
||||
ebs.CreateSnapshot())
|
||||
|
||||
from common.tasks import TriggerRollback
|
||||
tasklist.add(TriggerRollback())
|
||||
|
|
|
@ -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 = []
|
||||
|
|
Loading…
Add table
Reference in a new issue