bootstrap-vz/bootstrapvz/providers/ec2/tasks/packages.py
Jonh Wendell c477c32e4a EC2: Added growpart script
This is an attempt to fix issue #237

The script "growpart" was added as an asset, because
Debian's Jessie version (inside cloud-utils) package is
outdated and buggy.

Then "expand-root" init script was modified to call growpart
before calling resize2fs. In fact, calling resize2fs without
resizing the partition first is useless.

The task was named 'AddWorkaroundGrowpart' because it must
go away in the future in favor of using recent stuff in cloud-utils.

Currently even the official images suffer this issue, that makes
the system use only 8 GiB, even if the user chooses a bigger
storage size inside AWS.
2016-01-12 18:46:20 +00:00

31 lines
955 B
Python

from bootstrapvz.base import Task
from bootstrapvz.common import phases
import os.path
class DefaultPackages(Task):
description = 'Adding image packages required for EC2'
phase = phases.preparation
@classmethod
def run(cls, info):
info.packages.add('file') # Needed for the init scripts
kernel_packages_path = os.path.join(os.path.dirname(__file__), 'packages-kernels.yml')
from bootstrapvz.common.tools import config_get
kernel_package = config_get(kernel_packages_path, [info.manifest.release.codename,
info.manifest.system['architecture']])
info.packages.add(kernel_package)
class AddWorkaroundGrowpart(Task):
description = 'Adding growpart'
phase = phases.system_modification
@classmethod
def run(cls, info):
from shutil import copy
from . import assets
src = os.path.join(assets, 'bin/growpart')
dst = os.path.join(info.root, 'usr/bin/growpart')
copy(src, dst)