Sun's solution for virtualization is Solaris Containers. Actually this solution has two categories: 1. Zones - application isolation 2. Resource management This doc is about Zones only. Zone is virtualized OS environment within single instance of Solaris OS. Every Solaris 10 system contains a global zone (default zone for system and for managing other non-global zones).
# zoneadm list -v ID NAME STATUS PATH BRAND IP 0 global running / native shared |
# svcadm -v disable zones svc:/system/zones:default disabled. # svcs zones STATE STIME FMRI disabled 15:24:37 svc:/system/zones:default |
# zonecfg -z zone-1 zone-1: No such zone configured Use 'create' to begin configuring a new zone. zonecfg:zone-1> create zonecfg:zone-1> set zonepath=/.0/zone-1 zonecfg:zone-1> add net zonecfg:zone-1:net> set physical=eri0 zonecfg:zone-1:net> set address=192.168.etc.etc zonecfg:zone-1:net> end zonecfg:zone-1> verify zonecfg:zone-1> commit zonecfg:zone-1> exit |
# zoneadm -z zone-1 verify /.0/zone-1 must not be group readable. /.0/zone-1 must not be group executable. /.0/zone-1 must not be world readable. /.0/zone-1 must not be world executable. could not verify zonepath /.0/zone-1 because of the above errors. zoneadm: zone zone-1 failed to verify |
# zonecfg -z zone-1 info zonename: zone-1 zonepath: /.0/zone-1 brand: native autoboot: false bootargs: pool: limitpriv: scheduling-class: ip-type: shared inherit-pkg-dir: dir: /lib inherit-pkg-dir: dir: /platform inherit-pkg-dir: dir: /sbin inherit-pkg-dir: dir: /usr net: address: 192.168.x.x physical: eri0 defrouter not specified |
# zoneadm -z zone-1 install Preparing to install zone <zone-1>. Creating list of files to copy from the global zone. Copying <9161> files to the zone. Initializing zone product registry. Determining zone package initialization order. Preparing to initialize <426> packages on the zone. Initialized <426> packages on zone. Zone <zone-1> is initialized. The file </.0/zone-1/root/var/sadm/system/logs/install_log> contains a log of the zone installation |
# zoneadm list -vi ID NAME STATUS PATH BRAND IP 0 global running / native shared - zone-1 installed /.0/zone-1 native shared |
# zoneadm -z zone-1 ready # zoneadm list -vi ID NAME STATUS PATH BRAND IP 0 global running / native shared 1 zone-1 ready /.0/zone-1 native shared |
# zoneadm -z zone-1 boot # zoneadm list -vi ID NAME STATUS PATH BRAND IP 0 global running / native shared 4 zone-1 running /.0/zone-1 native shared |
# zlogin -C zone-1 [Connected to zone 'zone-1' console] Creating new rsa public/private host key pair Creating new dsa public/private host key pair Configuring network interface addresses:. rebooting system due to change(s) in /etc/default/init [NOTICE: Zone rebooting] SunOS Release 5.10 Version Generic_139555-08 64-bit Copyright 1983-2009 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Hostname: zone-1-zone Reading ZFS config: done. zone-1-zone console login: |
# zlogin zone-1 |
# zlogin zone-1 shutdown # zoneadm list -vi ID NAME STATUS PATH BRAND IP 0 global running / native shared - zone-1 installed /.0/zone-1 native shared |
# zoneadm -z zone-1 uninstall -F # zoneadm list -vi ID NAME STATUS PATH BRAND IP 0 global running / native shared |
# zonecfg -z zone-1 info zonename: zone-1 zonepath: /.0/zone-1 brand: native autoboot: false bootargs: pool: limitpriv: scheduling-class: ip-type: shared inherit-pkg-dir: dir: /lib inherit-pkg-dir: dir: /platform inherit-pkg-dir: dir: /sbin inherit-pkg-dir: dir: /usr |
# zonecfg -z zone-1 delete -F # zonecfg -z zone-1 info zone-1: No such zone configured |