11

I'm trying to find the best-practice, modern way of doing what I used to do with python-vm-builder (aka ubuntu-vm-builder).

I want a scripted, repeatable way to start from something like ubuntu-core (aka the artist formerly known as JeOS), add some packages, define first-run scripts, etc.

What I'm after is something akin to spinning a custom ISO (although it wont be an ISO, it will be an "installed" system). The result needs to be a kernel, initrd image, and rootfs that is suitable for a diskless PXE boot with NFS.

What tools are used to create say the Ubuntu netboot image (or any Ubuntu images for that matter)? Are they flexible enough for my needs?

How about the tools used to create the fresh-install environments used for the Ubuntu integration testing? Would they be appropriate?

Note that at run time the rootfs will be mounted read-only, so I'm not looking to manage an instance over time. I'm looking to re-spin an automated install at each new Ubuntu release, and periodically in the 6 months between.

jderose
  • 669
  • 2
    I don't have an answer, as I'm not sure of the current best practice way, but this sounds suspiciously like a task for Chef or Puppet, possibly even Vagrant. – Marco Ceppi Mar 08 '13 at 19:44
  • 1
    Why vmbuilder do not suit your needs anymore? It uses debootstrap to create the base system (a "chroot" which can then be copied to a disk image). Take a look and see if it helps. – Salem Mar 08 '13 at 20:15
  • vmbuilder would work, I think, but this is for a long-term system, so I don't want to build on bits that are already dead in the water. – jderose Mar 08 '13 at 20:18

3 Answers3

7

You can use an official cloud image directly, and then create a small ISO image using cloud-localds (from the cloud-utils package) to use as a "nocloud" data source to cloud-init.

Then you can use cloud-init userdata (example) as a single mechanism to add packages and to run your own first run scripts across cloud providers that provide official Ubuntu Cloud images as well as on your local VMs.

If you run cloud-localds with no parameters, it will display example usage to configure and run a VM using kvm directly.

To run the VM some other way, just supply a cloud image (eg. downloaded from https://cloud-images.ubuntu.com/precise/current/precise-server-cloudimg-amd64-disk1.img for 12.04) as the first disk, and present the ISO image output from cloud-localds as a CD-ROM.

More information is in Scott Moser's blog post.

Robie Basak
  • 15,930
  • 1
    I'm not sure how applicable this would be if you want to end up with a desktop system, though. – Robie Basak Mar 15 '13 at 11:52
  • Thanks! This looks like the sort of thing I'm looking for. And this environment isn't for a desktop system, BTW. I'm building something a bit like the MAAS ephemeral environment. It needs to be more comprehensive than say Ubuntu core alone, but I'd like it to be quite a bit smaller than a minimal Ubuntu server install. – jderose Mar 16 '13 at 18:31
2

I've never packaged an ISO, so I can't comment from my own experience, but it appears that the answer to your question is Cobbler (http://cobbler.github.com).

From Ubuntu Community Documentation:
"Ubuntu uses cobbler as the preferred provisioning server for Ubuntu machines." - https://help.ubuntu.com/community/Cobbler

  • 1
    https://help.ubuntu.com/community/Cobbler is out of date. I've just asked for it to be updated. Sorry this was missed before. – Robie Basak Mar 15 '13 at 11:54
  • 1
    Thanks! Although I could probably do what I want with Cobbler, it seems way overkill for what I'm aiming for. I don't want a provisioning service (and the complexities that brings), just a very simple provisioning tool. I'm looking for something higher level than debootstrap, but still a single-use command line or API tool. – jderose Mar 16 '13 at 18:26
0

For anyone looking for answer to this one, Oz (https://github.com/clalancette/oz) seems really good.

zecg
  • 21