zonecfg templates

With the arrival of Solaris 11.2 come new features in zonecfg that facilitate faster configuration of zones. 

The main notable feature being the default zonepath, which is "/system/zones/%{zonename)". This essentially lets you configure zones in a single step as,

   zonecfg -z <zonename> create

A customer can create their own template for creating zones, as below.

    zpool create -O mountpoint=/zones
    zonecfg -z MYsolaris 'create -t SYSsolaris; set zonepath=/zones/%{zonename}'
    svccfg -s zones setprop zonecfg/default_template = MYsolaris
    zonecfg -z z1 create
    zoneadm -z z1 install

In the case of solaris-kz, the analagous procedure would be:

    zpool create -O mountpoint=/zones
    zonecfg -z MYsolaris-kz
       create -t SYSsolaris-kz
       select device id=0
          set storage=dev:/dev/zvol/dsk/zones/%{zonename}/disk%{id}
          end
       add suspend
          set path=/zones/%{zonename}/suspend
          end
       exit
    svccfg -s zones setprop zonecfg/default_template = MYsolaris-kz
    zonecfg -z kz1 create
    zoneadm -z kz1 install

Of course, if default_template isn't changed in either case, 'create -t <template>' will work just fine too. 

NOTE: While creating a zone from template we reset properties that shouldn't have the same value across zones such as, allowed-address in net resource. Refer to brand specific manpage for more information.

Adding some resources now gives you a default set of property values, for the resource, in hope that you could essentially just "add <resource>" and all required properties are already filled out. 

   zonecfg:z1> add anet
   zonecfg:z1> end


Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

Phil Wang-Oracle

Search

Categories
Archives
« September 2015
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today