Summary

Hardy saw the first iteration of ubuntu-vm-builder, and it turned out to be quite popular. This specification retroactively describes the design and implementation of ubuntu-vm-builder, and also adds some new requirements.

Release Note

Ubuntu now features ubuntu-vm-builder which can be used to provision new virtual machines very quickly. For people not yet running Ubuntu, there's a downloadable virtual machine image, which can produce new virtual machines via a web interface.

Rationale

ubuntu-vm-builder is a much faster approach to creating virtual machines than d-i.

Use Cases

Assumptions

Design

ubuntu-vm-builder has three (and a half) stages:

Storage setup

ubuntu-vm-builder either creates raw images or accepts existing block devices. It then partitions them, and loop mounts the partitions, so that the entire filesystem is ready to be filled.

(Je)OS installation

In this stage, the operating system is intalled into the filesystem created in the storage setup stage. For Ubuntu, this means using debootstrap to seed the filesystem, and then installing additional packages (boot loader, kernel, and user-specified extras) into the chroot, creating users, network configuration, configuring apt sources, etc.

Target VM conversion

In this final stage, the raw images are converted to the disk image format for the target virtualisation solution and the vm is "deployed". Deployment in this situation is loosely defined as "whatever will make it easier for the user to start using the virtual machine".

Implementation

Storage setup

If not using pre-existing block devices for storage, ubuntu-vm-builder calls upon qemu-img to create a raw image of an appropriate size. parted is called to generate the the partition table, after which kpartx is invoked to expose the partitions as loopback block devices, after which they are mounted, so that the entire target disk layout is ready to be filled.

(Je)OS installation

VM conversion and "deployment"

At this stage, we convert the raw disk images to the target vm format. For kvm or qemu this is currently qcow2 files, for vmware, it's vmdk's, etc., etc.

Truth be told, the seperation between each stage is not quite as clear cut as this description makes it appear. We will want to fix this, since that will make it easier to extend ubuntu-vm-builder to generate vm's of other distributions.

UI

ubuntu-vm-builder is currently invoked as a command line utility, has a number of dependencies, and is distributed as a package in Ubuntu's repositories.

To make ubuntu-vm-builder of any use to other distributions, we'll create virtual machine capable of creating more virtual images. People will be able to download the virtual machine, access it via a web interface, and generate ubuntu based virtual machines this way.

This will be done by adding a new ubuntu-vm-builder-web package to the ubuntu-vm-builder source package.It will include a CGI script which presents the user with a form for creating new virtual machines. The CGI will call ubuntu-vm-builder to build the vm which will land in an http reachable location for the user to download. There should be a mechanism for removing virtual machines from the machine again. The CGI will by default be reachable via http://ip.address.of.the.machine/ubuntu-vm-builder, but in the vm-builder virtual machines we'll be shipping, it will be reachable via the web root, too. A helpful text will be added to the boot sequence too, so that it's clear what to do if you just fire up the vm.

Test/Demo Plan

It's important that we are able to test new features, and demonstrate them to users. Use this section to describe a short plan that anybody can follow that demonstrates the feature is working. This can then be used during testing, and to show off after release.

This need not be added or completed until the specification is nearing beta.

Outstanding Issues

This should highlight any issues that should be addressed in further specifications, and not problems with the specification itself; since any specification with problems cannot be approved.

BoF agenda and discussion

ubuntu-vm-builder Intrepid Features (already developed)

u-vm-b wanted Features / Bugs


CategorySpec

VMBuilderSpec (last edited 2010-02-01 17:18:40 by turhapuro)