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

Creating Zones

Zones on SmartOS use a special zone brand named 'joyent'. The default ipkg brand is not included with SmartOS, as SmartOS does not use ipkg. To configure a zone you must first currently have a zpool named 'zones' mounted at /zones. The dataset setup script ensures this is the case.

After this, a zone template dataset must be imported. Zone templates are SmartOS images with pkgsrc included. Datasets are available through the Joyent dataset API at https://datasets.joyent.com/datasets . This leads to a JSON formatted list of dataset metadata in which you will find several versioned SmartOS datasets. You will want to find the 'url' field of the most recent dataset, for instance:

the url of this entry would be "https://datasets.joyent.com/datasets/be1d48ec-c4ca-11e0-9935-eb833f38dc43/smartos64-1.4.2.zfs.bz2".

Once you have determined the dataset you wish to use, download, uncompress and import (zfs receive or zfs recv) it, for instance like so:

You will then be able to create and install zones and virtual machines using vmadm create.

vmadm create is a tool for fast provisioning of zones; it takes a json payload and clones a dataset in to a working zone.

To use vmadm create you must first start by creating your zone definition file, for instance copying this in to /tmp/zonedef  (substituting the dataset_uuid and network information that's appropriate):

then simply 

and vmadm will respond with a status and your zone will be created and booted.

An alternative to managing your local datasets via manual parsing of https://datasets.joyent.com/datasets, is to use the dsadm utility.

If the file
does not exist, the dsadm utility won't know where to fetch datasets from.  Running this command should fix it:

To list all available datasets from Joyent:

To list all local datasets installed in zones:

To import a dataset from Joyent, use the UUID of the dataset (from dsadm avail):

The dataset is now downloaded and installed at zones/UUID.

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

or

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

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