Switch VCP to LVM based partitions

This patch switches qcow builder to build VCP with lvm based
partition inside. The disk split to 3 partitions:

  1. 1MB partition needed for GPT
  2. 1Gb boot partition
  3. LVM partition

On LVM the following list of partitions is created:

  * /
  * /home
  * /tmp
  * /var/tmp
  * /var/log
  * /var/log/audit

Important: this will break default growroot cloudinit functionality.
To grow LVM automatically the foolowing data should be added to
cloudinit user-data.cfg

user_data:
  growpart:
    mode: auto
    devices: ['/dev/vda3']
    ignore_growroot_disabled: false
  runcmd:
    - [ 'pvresize', '/dev/vda3' ]

The name of LVM partition might be changed depending on the disk
model specified in VCP, by default is virtio.

Further partitioning size tuning should be done via linux formula.

Related-Prod: PROD-24537

Change-Id: Ie7699a747e73fd75b71ce8232b51fe97a310de64
3 files changed
tree: 34d607468ec72421649a53d9176cf5cd30efcd6b
  1. centos-7/
  2. common/
  3. day01-image/
  4. debian-8/
  5. http/
  6. mirror-image/
  7. trymcp-day01-image/
  8. ubuntu-14.04/
  9. ubuntu-16.04/
  10. .gitignore
  11. packer-image-buid.groovy
  12. README.md
README.md

Packer templates

Packer templates are used to:

  • automagically create OS images with upgraded packages
  • provision user defined changes to created image
  • remove user defined elements from image
  • build single version of OS image for multiple hypervisors

Features

Operating Systems

  • Ubuntu 14.04 (trusty)
  • Ubuntu 16.04 (xenial)
  • Debian 8 (jessie)

Providers

  • qemu
  • docker
  • virtualbox
  • vagrant/libvirt
  • vagrant/virtualbox
  • digitalocean

Usage

Install Packer

PACKER_URL="https://dl.bintray.com/mitchellh/packer/packer_0.8.2_linux_amd64.zip"
PACKER_ZIP=$(basename ${PACKER_URL})
PACKER_ZIP_MD5="bc37abe5e183a11bd8c1b2efc385059b"

mkdir -p ~/bin/packer
cd ~/bin/packer
export PATH="${PATH}:~/bin/packer"

wget -O ${PACKER_ZIP} ${PACKER_URL}
echo "${PACKER_ZIP_MD5}  ${PACKER_ZIP}" >> md5sum
md5sum -c --status md5sum

unzip ${PACKER_ZIP}

Image build

Enter build directory by selecting OS type and version. You should see file template.json.

Start building some images:

packer build -only=virtualbox-iso template.json

Development

Directory http/ contains OS installer config files (preseed/kickstart/..)

Directory scripts/ contains set of scripts for provision after image build.

Notes

  • some builders cannot work at the same time (by design)