SmartOS is an open-source project from Joyent that takes the open-sourced version of Solaris with ZFS, Zones and DTrace, adds in ported version of KVM and some other magic to create a lean hypervisor that Joyent is using to power their very own cloud called SmartDataCenter.

The cool thing is SmartOS is still open-source and downloaded, so you can play with it on your own.

Where do I get it?

Ideally, you can go to their download page and find what you are looking for. Just for convience, go here for the VMWare image or here for the ISO.

For the sake of arguing, download and startup the VMWare image just so we can play around with it for a bit with out breaking anything important. Just run through the setup. It’s pretty simple and only a few steps.

Okay, what next?

Let’s create a new zone. We have a few steps we need to take first.

After you log in, type:

echo "https://datasets.joyent.com/datasets" >> /var/db/imgadm/sources.list
imgadm update
imgadm avail

The first line tells imgadm where to find it’s list of images from. The second line downloads and updates that list while the third shows you what is in it.

imgadm is the tool that you can use to manage virtual images.

We’ll use one of the smartos images to test with, so do

imgadm import 01b2c898-945f-11e1-a523-af1afbe22822

This will install the zone image. I’m assuming it is downloading it from someplace on Joyent’s servers. It may take a few minutes.

After it is done, create a text file call smartos.json with the following:

{
	"brand": "joyent", "alias": "smartos1", "zonename": "smartos1",
	"dataset_uuid": "01b2c898-945f-11e1-a523-af1afbe22822",
	"resolvers": [
		"208.67.220.220",
		"208.67.222.222"  
	],
	"nics": [
		{
		  "nic_tag": "admin",  
		  "ip": "dhcp"  
		}  
	]
}

This is the defination of what your new virtual machine will look like. There are lots of options that you can look at here.

When you’re ready, try:

vmadm create -f ~/smartos.json

You will need to notate the UUID that is returned. You can always find it later by doing:

vmadm list

Wanna log into it?

zlogin smartos1

How about that. You can find out the IP address by doing:

ifconfig -a

And now you have your very own zone, all up and running.



Published

22 June 2012

Category

infrastructure

Tags