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

« Previous Version 3 Next »

7.1 Zones/Containers

Zones are a feature of OpenIndiana that allows virtual kernel instances. Each one is effectively a completely seperate OpenIndiana machine but with very low overhead as they share much of the OS. There is always a 'global' zone which is the boot environment and is the master zone with real hardware access and control of all sub zones (it is similar to a hypervisor in other virtualization systems). From the global zone you can create new sub-zones and decide how much resources to allocate to its children zones. As Zones shares kernel and other resources with each other (including the global zone) its security isn't as powerful as xVM (Xen) virtualization but it is still high enough for for most uses and being incredible cheap to run and maintain its usually the first place to look for separated applications. Large systems have 10s or even 100s of zones without any major overhead caused by the zoneing itself, each blissfully unaware of its sibling zones and the work they are performing.

Each zone is backed by its own ZFS file system, this file system is the extent of its visibility on the global file system without explicit sharing mechanism (NFS etc.) 

When each zone is created  it comes with a minimal set of packages, and from there you can add and use most packages and applications as required.

Quick Setup Example

For each zone (in a simple configuration), you really only need a few bits of info.

  • The zone's name - something you can remember it by. For this example I'm naming the zone, example_zone
  • The physical nic - which physical network cards the zone will share. For this example I'm using e1000g0
  • An IP address the zone will use. 192.168.254.200 for this example
  • The mount point in the global zone for the zone's file system. For this example I'm using /export/example_zone

As a user with Primary Administrator role, you create the zone with

zonecfg -z example_zone

this puts you inside the zone configuration program where you can change and update settings particular to the zone specified with -z. zonecfg break different resource groups of data, you add a new resource with add. The most important resource is a virtual network card, this is added with add net then details are added and then end closes the editing of this resource. 

add net  

set physical = e1000g0

set address = 192.168.254.200

end

Then tell the zone where its root filesystem will be create and mounted in the global zone

set zonepath=/export/example_zone

Then commit the changes and exit the zone configuration program.

commit

exit

Now all you have to do is install and boot your zone, the install process download the basic packages from your IPS repository and then boot performs a virtual hardware boot of your new zone.

zoneadm -z example_zone install

zoneadm -z example_zone boot

Whilst booting for the first time you will need to ask some basic configuration (you can set this all up via zone configuration before hand), to login is as the zone local console (as if you were sitting in front of a real machine as it boots), type

zlogin -C example_zone

Answer the questions (when it asks you for terminal type, the answer will be in most cases xterm), once done you can log in locally (you will get a login prompt) or you can ssh in via the IP address you provided to zone config.

That is it your zone is now up and running, as zones start with a minimal configuration, you will likely be missing many of the niceties you would expect. All are available via IPS packaging, for example if you miss the editor nano then from your example_zones command prompt type

pkg install nano

In general you are likely to want to install lots of of packages depending on what your using the zone for.

7.2 xVM

7.3 Other.......

  • No labels