mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 15:36:27 +00:00
Create snapshot of volume *after* package install
This commit is contained in:
parent
569f6fd505
commit
15661ae680
2 changed files with 11 additions and 5 deletions
|
@ -5,6 +5,8 @@ from tasks import CreateFromImage
|
||||||
from providers.ec2.tasks import ebs
|
from providers.ec2.tasks import ebs
|
||||||
from common.tasks import loopback
|
from common.tasks import loopback
|
||||||
from common.tasks import volume
|
from common.tasks import volume
|
||||||
|
from common.tasks import locale
|
||||||
|
from common.tasks import apt
|
||||||
from common.tasks import bootstrap
|
from common.tasks import bootstrap
|
||||||
from common.tasks import filesystem
|
from common.tasks import filesystem
|
||||||
from common.tasks import partitioning
|
from common.tasks import partitioning
|
||||||
|
@ -26,6 +28,9 @@ def resolve_tasks(tasklist, manifest):
|
||||||
filesystem.TuneVolumeFS,
|
filesystem.TuneVolumeFS,
|
||||||
filesystem.AddXFSProgs,
|
filesystem.AddXFSProgs,
|
||||||
filesystem.CreateBootMountDir,
|
filesystem.CreateBootMountDir,
|
||||||
|
|
||||||
|
apt.DisableDaemonAutostart,
|
||||||
|
locale.GenerateLocale,
|
||||||
bootstrap.MakeTarball,
|
bootstrap.MakeTarball,
|
||||||
bootstrap.Bootstrap]
|
bootstrap.Bootstrap]
|
||||||
if manifest.volume['backing'] == 'ebs':
|
if manifest.volume['backing'] == 'ebs':
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
from base import Task
|
from base import Task
|
||||||
from common import phases
|
from common import phases
|
||||||
from common.tasks import volume
|
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 providers.ec2.tasks import ebs
|
||||||
from common.fs import remount
|
from common.fs import remount
|
||||||
from shutil import copyfile
|
from shutil import copyfile
|
||||||
|
@ -13,8 +14,8 @@ log = logging.getLogger(__name__)
|
||||||
|
|
||||||
class Snapshot(Task):
|
class Snapshot(Task):
|
||||||
description = 'Creating a snapshot of the bootstrapped volume'
|
description = 'Creating a snapshot of the bootstrapped volume'
|
||||||
phase = phases.os_installation
|
phase = phases.package_installation
|
||||||
predecessors = [bootstrap.Bootstrap]
|
predecessors = [packages.InstallRemotePackages, guest_additions.InstallGuestAdditions]
|
||||||
|
|
||||||
def run(self, info):
|
def run(self, info):
|
||||||
def mk_snapshot():
|
def mk_snapshot():
|
||||||
|
@ -45,8 +46,8 @@ class CreateFromSnapshot(Task):
|
||||||
|
|
||||||
class CopyImage(Task):
|
class CopyImage(Task):
|
||||||
description = 'Creating a snapshot of the bootstrapped volume'
|
description = 'Creating a snapshot of the bootstrapped volume'
|
||||||
phase = phases.os_installation
|
phase = phases.package_installation
|
||||||
predecessors = [bootstrap.Bootstrap]
|
predecessors = [packages.InstallRemotePackages, guest_additions.InstallGuestAdditions]
|
||||||
|
|
||||||
def run(self, info):
|
def run(self, info):
|
||||||
loopback_backup_name = 'volume-{id}.{ext}.backup'.format(id=info.run_id, ext=info.volume.extension)
|
loopback_backup_name = 'volume-{id}.{ext}.backup'.format(id=info.run_id, ext=info.volume.extension)
|
||||||
|
|
Loading…
Add table
Reference in a new issue