Create snapshot of volume *after* package install

This commit is contained in:
Anders Ingemann 2013-12-29 20:56:06 +01:00
parent 569f6fd505
commit 15661ae680
2 changed files with 11 additions and 5 deletions

View file

@ -5,6 +5,8 @@ from tasks import CreateFromImage
from providers.ec2.tasks import ebs
from common.tasks import loopback
from common.tasks import volume
from common.tasks import locale
from common.tasks import apt
from common.tasks import bootstrap
from common.tasks import filesystem
from common.tasks import partitioning
@ -26,6 +28,9 @@ def resolve_tasks(tasklist, manifest):
filesystem.TuneVolumeFS,
filesystem.AddXFSProgs,
filesystem.CreateBootMountDir,
apt.DisableDaemonAutostart,
locale.GenerateLocale,
bootstrap.MakeTarball,
bootstrap.Bootstrap]
if manifest.volume['backing'] == 'ebs':

View file

@ -1,7 +1,8 @@
from base import Task
from common import phases
from common.tasks import volume
from common.tasks import bootstrap
from common.tasks import packages
from providers.virtualbox.tasks import guest_additions
from providers.ec2.tasks import ebs
from common.fs import remount
from shutil import copyfile
@ -13,8 +14,8 @@ log = logging.getLogger(__name__)
class Snapshot(Task):
description = 'Creating a snapshot of the bootstrapped volume'
phase = phases.os_installation
predecessors = [bootstrap.Bootstrap]
phase = phases.package_installation
predecessors = [packages.InstallRemotePackages, guest_additions.InstallGuestAdditions]
def run(self, info):
def mk_snapshot():
@ -45,8 +46,8 @@ class CreateFromSnapshot(Task):
class CopyImage(Task):
description = 'Creating a snapshot of the bootstrapped volume'
phase = phases.os_installation
predecessors = [bootstrap.Bootstrap]
phase = phases.package_installation
predecessors = [packages.InstallRemotePackages, guest_additions.InstallGuestAdditions]
def run(self, info):
loopback_backup_name = 'volume-{id}.{ext}.backup'.format(id=info.run_id, ext=info.volume.extension)