Skip to end of metadata
Go to start of metadata
You are viewing an old version of this page. View the current version. Compare with Current  |   View Page History

OS Virtualized Machines, hereafter referred to as Zones, is a lightweight virtualization technology. Zones are fully isolated user-land environments, they do not possess their own kernel and therefore have effectively no performance overhead allowing for bare metal performance. Network and disk virtualization are provided by ZFS and the SmartOS networking stack ("Crossbow"). The result is a virtual environment that in every way acts like a complete environment.

Creating Zones

The process of creating zones is simple:

  1. Download a Zone Image
  2. Create a Manifest describing the Zone
  3. Create the Zone using vmadm
  4. Use the Zone

Obtaining a Zone Image

Zone creation requires an image to use as a template. To learn more about images, please refer to ...

To find a zone image, use the command imgadm avail. Images with the OS type "smartos" are zone images. The "base" and "base64" images are minimal images with only a basic 32bit or 64bit PKG-SRC installation and should be considered for building your own custom images.

# imgadm avail | grep base64
fdea06b0-3f24-11e2-ac50-0b645575ce9d smartos 2012-12-05 sdc:sdc:base64:1.8.4
aa583f78-3d83-11e2-9188-fff9b605718d smartos 2012-12-03 sdc:sdc:base64:1.8.2
60a3b1fa-0674-11e2-abf5-cb82934a8e24 smartos 2012-09-25 sdc:sdc:base64:1.8.1
e8c41d40-f161-11e1-b839-a3631c115653 smartos 2012-08-28 sdc:sdc:base64:1.7.2
8da4bc54-d77f-11e1-8f6f-cfe8e7177a23 smartos 2012-07-27 sdc:sdc:base64:1.7.1
d0eebb8e-c9cb-11e1-8762-2f01c4acd80d smartos 2012-07-10 sdc:sdc:base64:1.7.0

Import an image by specifying its UUID:

# imgadm import fdea06b0-3f24-11e2-ac50-0b645575ce9d
installing image fdea06b0-3f24-11e2-ac50-0b645575ce9d
fdea06b0-3f24-11e2-ac50-0b645575ce9d successfully installed
image fdea06b0-3f24-11e2-ac50-0b645575ce9d successfully imported

You will referenced this images UUID when you create the zone manifest.

The Zone Manifest

A manifest is a JSON object which describes your zone. There are many options which are fully described in the vmadm(1m) man page. The most important are:

  • brand: This must be set to "joyent" for Zones
  • image_uuid: The UUID of the image you are using as a template (images were previously called "datasets")
  • alias: An arbitrary name displayed in vmadm list output in addition to the UUID
  • hostname: Hostname that will be set within the zone
  • max_physical_memory: Amount of RAM (RSS) available to the zone in MB
  • quota: Amount of disk space in GB
  • nics: One or more network interfaces attached to this zone

Passing SSH keys to the VM

With some images you won't be able to log in to unless you pass an SSH public key to validate your connection with. Adjust your config to contain a customer_metadata block:

Creating the Zone

With your image imported and your manifest created, you can now create the zone. Do this by simply passing the manifest to vmadm create -f manifest.json:

# vmadm create -f web01.json
Successfully created 3afc2fe2-f31a-48ed-88d2-71e0af90bbe1

Alternatively, you can pass the manifest via STDIN:

# vmadm create <<EOL
  (manifest json here)

The zone is now created and running.

Connecting to your Zone

Once you have created a zone with vmadm create, you can log into your zone via one of two methods:


Please refer to the manpage for vmadm and zlogin respectively, for the escape sequence to exit out of console mode.

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.