A simple kickstart based virtual image bootstrapping tool
Project description
Virtual Image Bootstrapping Tool.
Designed to build an image from nothing (IE via netboot/kickstart), strip it down and re-package it for different targets.
Created due to the huge amount of manual work involved in re-packaging images for new versions of things.
Expected setup
Requirements:
Hardware virtualization support
64bit host (if you want to build 64bit images)
Standard qemu setup (default NAT’d network)
Packages installed:
python-libvirt
qemu
qemu-system
qemu-kvm
libvirt-bin
bridge-utils
libguestfs-tools
Validate the install:
damian@Capricorn:~$ virsh -c qemu:///system net-list Name State Autostart —————————————– default active yes
Workflow
virt-install the machine
serve up a ks file based off the template
run the scripts
shutdown the machine
virt-prep the machine
undefine it
save the image
run qemu-img convert against the image for all desired formats
Example:
>> cat ubuntu-base.conf distro: ubuntu release: saucy target: server arch: x86_64 source: http://mirror.bytemark.co.uk/%(distro)/dists/%(release)/main/installer-%(arch)/
packages: - ubuntu-minimal - openssh-server - salt-minion - puppet
post-scripts: - ../scripts/bootup-generic.sh
images: - vmdk - vdi - qcow2 - raw
>> cat ubuntu-13.10-i386.conf include(‘ubuntu-base.conf’) release: saucy target: server arch: i386
>> ls ./ubuntu/ - bootup-generic.sh - ubuntu-base.conf - ubuntu-13.10-i386.conf - ubuntu-12.10-i386.conf
>> vibootstrap –host=qemu:///system –settings=ubuntu/ubuntu-13.10-i386.conf Setting up qemu box Installing - Progress via callbacks - Post scripts Shutdown Virt prep Undefine Converting images qemu-img convert -O vmdk ubuntu-13.10-i386.raw ubuntu-13.10-i386.vmdk qemu-img convert -O vdi ubuntu-13.10-i386.raw ubuntu-13.10-i386.vdi qemu-img convert -O qcow2 ubuntu-13.10-i386.raw ubuntu-13.10-i386.qcow2 qemu-img convert -O raw ubuntu-13.10-i386.raw ubuntu-13.10-i386.raw Artifacts: - ubuntu-13.10-i386.raw - ubuntu-13.10-i386.vmdk - ubuntu-13.10-i386.vdi - ubuntu-13.10-i386.qcow2