/ SmartOS

SmartOS and Why I Need datasets.at

SmartOS changed my life over the past year and hopefully will change a lot more in the future as well. It is the foundation of all my little test systems - I tend to ignore VMware Fusion on my macbook.

SmartOS

SmartOS is by far the easiest virtualization platform to setup and update on real hardware. Even without SmartDataCenter and all the pxe booting goodness that Joyent did build to really rapidly get large cloud installations online.

The live image based OS is awesome for updates. You simply grab the new version, put that on the usbkey and reboot the host. Most of the tools inside a zone get mounted read-only from the host and therefor are updated also if you just boot a new platform version.

All the vm management is done through two little helper tools imgadm and vmadm.

imgadm will help manageing available and fetched images and vmadm will provision a new virtual machine or smartmachine based uppon a simple json definition.

prepackaged images for your virtual machines built in

It is really simple to create virtual machines an smartmachines on SmartOS but to do it the really easy way you have to use pre packaged images.

An image is a preinstalled version of an operating system for a virtual machine or some preconfigured smartmachine with added extra packages and tools. You will get a usable system ready to serve your application in a matter of seconds - never installing an OS anymore!

This list of freely available (thanks Joyent) images is growing. Even if it’s just ubuntu 12.04, the image itself can have more than one version as that gets incremented and rebuild as soon as Joyent engineers tweak some settings or update additional tools.

imgadm avail will show you a list of available images you could fetch.

Here is a list of the currently available ubuntu-12.04 images:

UUID                                 OS      PUBLISHED  URN
1327ed36-5130-11e2-95a8-9b5a153adf3e linux   2013-01-24 sdc:jpc:ubuntu-12.04:2.3.1
583287ae-366b-11e2-aea4-bf6c552eb39b linux   2012-11-30 sdc:jpc:ubuntu-12.04:2.2.1
78ab4d60-2610-11e2-b3f7-b3bd2c369427 linux   2012-11-04 sdc:jpc:ubuntu-12.04:2.1.2
6a67c702-2083-11e2-b4fa-03f9d1d64ef0 linux   2012-10-28 sdc:jpc:ubuntu-12.04:2.1.1
ed7f7f66-e6ec-11e1-bf22-d70b826ad87f linux   2012-09-24 sdc:jpc:ubuntu-12.04:2.0.2

You’ll get a list of UUIDs, the OS used by the image, the publishing date for the image and it’s mostly readable unique name. That name consists of the cloud it is build on/for, the creator, the short image name itself and the version of that image.

The complete list of all available images currently is 118 lines long.

To create a virtual machine out of one of those prepackaged images you will need to feed vmadm a json definition file. That file itself can have plenty many options set but a basic definition for the latest ubuntu-12.04 would probably look like this:

{
  "brand": "kvm",
  "autoboot": true,
  "ram": 1024,
  "cpu_type": "qemu64",
  "nics": [
    {
      "nic_tag": "admin",
      "ip": "dhcp",
      "model": "virtio",
      "primary": true
    }
  ],
  "disks": [
    {
      "boot": true,
      "image_uuid": "1327ed36-5130-11e2-95a8-9b5a153adf3e",
      "image_size": 16384,
      "model": "virtio"
    }
  ]
}

datasets.at

to circumvent the discussion about “why not images.at?”
images were once called datasets
images.at was not free and datasets.at is cooler

So why do I have something like datasets.at online?

The main reason was to have a mirror for all available images in Europe because fetching those images from the US is really slow sometimes. Also the community had no simple possibility to extend that provided list of images on their own what made me sad a little after it took me a lot of time to create a usable image and couldn’t share it easily with others.

The project itself got extended afterwards and got a neat little UI to solve some of my other problems.

I always look for the latest version of some image before I create a new virtual machine. Searching the latest version of a specific image in the imgadm avail list was possible with some bash and pipes but - I’m lazy.

I also don’t like to write too much to just create a simple virtual machine to test something. So the UI also got extended further to include a html form you can fill out with needed information and grab a ready to use json for vmadm without writing a single line of json.

Interested in typing less? maybe just play around on datasets.at :) Here are some screenshots of the basic interface - function will be shown in some later screencast about creating your own image for use as a template for your own virtual machines. That will also cover the metadata part of SmartOS and how to get aditional information into the guest while provisioning.

latest image versions on datasets.at home page

the builder for a selected image

editable nic properties in the builder

known metadata keys for each image are provided in a dropdown

the form is tranformed to a simple json that can be used by vmadm