Creating a Base Image
A base image is an image of a virtual machine. The base image will be an installed and configured Ubuntu 16.04 server. This image can then be cloned multiple times to create copies to use when provisioning new virtual machines. This greatly speeds up the process to creating multiple machines and does it in a reliable manner.
The main tool in use here is Packer. Packer will automatically install Ubuntu from the installation ISO and configure it correctly. Once the installation is done, the final installed image is placed into a folder ready for use.
The virtualbox steps on a mac are available as a youtube tutorial now!
Creating an Ubuntu 16.04 base image
First clone this repo:
git clone https://github.com/mrgeoffrich/learn-openstack-scripts
Then run the packer build for your virtualisation tool of choice. Change directory into the repo.
packer build --only=virtualbox-iso ubuntu1604base.json
packer build --only=vmware-iso ubuntu1604base.json
Note - You will need to set up an external Virtual Switch and set the variable in ubuntu1604base.json to match the name of this switch.Run:
packer build --only=hyperv-iso ubuntu1604base.json
Please select a preferred hypervisor using the dropdown at the top right.
What it's doing
Packer will download the ubuntu 16.04 ISO, create a new blank virtual machine, then automatically step through the installation process for Ubuntu 16.04. Once the installation is done, and SSH is available, packer will SSH in and run a number of commands to continue setting up the machine. If you want to look at the configuration, the
ubuntu1604base.json file is the packer config, and in the scripts folder are the shell scripts that are executed.