Creating and Installing Solaris Containers (Zones)


Creating and Installing Zone.

This example shows how to create a zone (zone1) on the ZFS pool (zonepool).

# zonecfg -z zone1
zone1: No such zone configured
Use 'create' to begin configuring a new zone.
zonecfg:zone1 > create
zonecfg:zone1 > set zonepath=/zonepool/zone1
zonecfg:zone1 > set autoboot=true
zonecfg:zone1 > add net
zonecfg:zone1:net> set address=10.6.140.137
zonecfg:zone1:net> set physical=vnet0
zonecfg:zone1:net> end
zonecfg:zone1> add net
zonecfg:zone1:net> set address=192.168.2.201
zonecfg:zone1:net> set physical=vnet1
zonecfg:zone1:net> end
zonecfg:zone1> verify
zonecfg:zone1> info
zonename: zone1
zonepath: /zonepool/zone1
brand: native
autoboot: true
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: 10.6.140.137
    physical: vnet0
    defrouter not specified
net:
    address: 192.168.2.201
    physical: vnet1
    defrouter not specified
zonecfg:zone1>
# chmod 700 /zonepool/zone1

Verify that the zone is configured correctly

# zoneadm list -cv
  ID NAME             STATUS     PATH                           BRAND    IP
   0 global           running    /                              native   shared
zone1   configured /zonepool/zone1 native   shared

Install the operating system in the new zone.

#  zoneadm -z zone1 install
cannot create ZFS dataset zonepool/zone1: dataset already exists
Preparing to install zone .
Creating list of files to copy from the global zone.
Copying <7690> files to the zone.
Initializing zone product registry.
Determining zone package initialization order.
Preparing to initialize <1139> packages on the zone.
Initialized <1139> packages on zone.
Zone  is initialized.
The file  contains a log of the zone installation.
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s