Friday 27 December 2013

SOLARIS 11 ZONE CONFIGURATION & INSTALLATION

1)Create a File system for Zones
root@solaris2:~# zfs create testpool/FS1
root@solaris2:~# df -kh
Filesystem             Size   Used  Available Capacity  Mounted on
rpool/ROOT/solaris-2   9.8G   2.2G       3.8G    37%    /
/devices                 0K     0K         0K     0%    /devices
/dev                     0K     0K         0K     0%    /dev
ctfs                     0K     0K         0K     0%    /system/contract
proc                     0K     0K         0K     0%    /proc
mnttab                   0K     0K         0K     0%    /etc/mnttab
swap                    13G   2.2M        13G     1%    /system/volatile
objfs                    0K     0K         0K     0%    /system/object
sharefs                  0K     0K         0K     0%    /etc/dfs/sharetab
fd                       0K     0K         0K     0%    /dev/fd
rpool/ROOT/solaris-2/var
                       9.8G   434M       3.8G    11%    /var
swap                    13G     0K        13G     0%    /tmp
rpool/VARSHARE         9.8G    76K       3.8G     1%    /var/share
rpool/export           9.8G    32K       3.8G     1%    /export
rpool/export/home      9.8G    31K       3.8G     1%    /export/home
rpool                  9.8G    73K       3.8G     1%    /rpool
testpool                20G    32K        14G     1%    /testpool
testpool/FS1            20G    31K        14G     1%    /testpool/FS1
root@solaris2:~# zfs set mountpoint=/TESTZONE testpool/FS1
root@solaris2:~# df -h
Filesystem             Size   Used  Available Capacity  Mounted on
rpool/ROOT/solaris-2   9.8G   2.2G       3.8G    37%    /
/devices                 0K     0K         0K     0%    /devices
/dev                     0K     0K         0K     0%    /dev
ctfs                     0K     0K         0K     0%    /system/contract
proc                     0K     0K         0K     0%    /proc
mnttab                   0K     0K         0K     0%    /etc/mnttab
swap                    13G   2.2M        13G     1%    /system/volatile
objfs                    0K     0K         0K     0%    /system/object
sharefs                  0K     0K         0K     0%    /etc/dfs/sharetab
fd                       0K     0K         0K     0%    /dev/fd
rpool/ROOT/solaris-2/var
                       9.8G   434M       3.8G    11%    /var
swap                    13G     0K        13G     0%    /tmp
rpool/VARSHARE         9.8G    76K       3.8G     1%    /var/share
rpool/export           9.8G    32K       3.8G     1%    /export
rpool/export/home      9.8G    31K       3.8G     1%    /export/home
rpool                  9.8G    73K       3.8G     1%    /rpool
testpool                20G    32K        14G     1%    /testpool
testpool/FS1            20G    31K        14G     1%    /TESTZONE
2)check NICcards
root@solaris2:~# dladm show-phys
LINK              MEDIA                STATE      SPEED  DUPLEX    DEVICE
net1              Ethernet             up         0      unknown   vnet1
net0              Ethernet             up         0      unknown   vnet0
net2              Ethernet             unknown    0      unknown   vnet2
net3              Ethernet             unknown    0      unknown   vnet3
3)configure testzone
root@solaris2:~# zonecfg -z testzone
Use 'create' to begin configuring a new zone.
zonecfg:testzone> create -b
zonecfg:testzone> set autoboot=true
zonecfg:testzone> info
zonename: testzone
zonepath:
brand: solaris
autoboot: true
bootargs:
file-mac-profile:
pool:
limitpriv:
scheduling-class:
ip-type: exclusive
hostid:
fs-allowed:
====>set zonePath
zonecfg:testzone> set zonepath=/TESTZONE
====>Add capped cpu
zonecfg:testzone> add capped-cpu
zonecfg:testzone:capped-cpu> set ncpus=4
zonecfg:testzone:capped-cpu> end
=====>add memory
zonecfg:testzone> add capped-memory
zonecfg:testzone:capped-memory> set physical=4G
zonecfg:testzone:capped-memory> set swap=1G
zonecfg:testzone:capped-memory> set locked=100m
zonecfg:testzone:capped-memory> end
======>to see info
zonecfg:testzone> info
zonename: testzone
zonepath: /TESTZONE
brand: solaris
autoboot: true
bootargs:
file-mac-profile:
pool:
limitpriv:
scheduling-class:
ip-type: exclusive
hostid:
fs-allowed:
capped-cpu:
        [ncpus: 4.00]
capped-memory:
        physical: 4G
        [swap: 1G]
        [locked: 100M]
rctl:
        name: zone.cpu-cap
        value: (priv=privileged,limit=400,action=deny)
rctl:
        name: zone.max-swap
        value: (priv=privileged,limit=1073741824,action=deny)
rctl:
        name: zone.max-locked-memory
        value: (priv=privileged,limit=104857600,action=deny)
============>to add network device shared
zonecfg:testzone>add net
zonecfg:testzone:net>set physical=net3
zonecfg:testzone:net>set address=10.66.10.114
zonecfg:testzone:net>end
==========>to save configuration
zonecfg:testzone> commit
==========> i added network devce shared but by default ip-type is exclusive so
commit failed
net: address cannot be specified if ip-type = exclusive
ip-type is set to 'exclusive' by default.
Zone testzone failed to verify
testzone: Invalid argument
zonecfg:testzone> verify
net: address cannot be specified if ip-type = exclusive
ip-type is set to 'exclusive' by default.
testzone: Invalid argument
=======>chaged ip-type to shared
zonecfg:testzone> set ip-type=shared
======>verify after change
zonecfg:testzone> verify
====>remove net
zonecfg:testzone> remove net
zonecfg:testzone> info
zonename: testzone
zonepath: /TESTZONE
brand: solaris
autoboot: true
bootargs:
file-mac-profile:
pool:
limitpriv:
scheduling-class:
ip-type: shared
hostid:
fs-allowed:
capped-cpu:
        [ncpus: 4.00]
capped-memory:
        physical: 4G
        [swap: 1G]
        [locked: 100M]
rctl:
        name: zone.cpu-cap
        value: (priv=privileged,limit=400,action=deny)
rctl:
        name: zone.max-swap
        value: (priv=privileged,limit=1073741824,action=deny)
rctl:
        name: zone.max-locked-memory
        value: (priv=privileged,limit=104857600,action=deny)
zonecfg:testzone> set ip-type=exclusive
zonecfg:testzone> verify
zonecfg:testzone> commit
====================>to add anet
zonecfg:testzone> add anet
zonecfg:testzone:anet> set linkname=net2
zonecfg:testzone:anet> end
zonecfg:testzone> verify
zonecfg:testzone> info
zonename: testzone
zonepath: /TESTZONE
brand: solaris
autoboot: true
bootargs:
file-mac-profile:
pool:
limitpriv:
scheduling-class:
ip-type: exclusive
hostid:
fs-allowed:
anet:
        linkname: net2
        lower-link: auto
        allowed-address not specified
        configure-allowed-address: true
        defrouter not specified
        allowed-dhcp-cids not specified
        link-protection: mac-nospoof
        mac-address: random
        mac-prefix not specified
        mac-slot not specified
        vlan-id not specified
        priority not specified
        rxrings not specified
        txrings not specified
        mtu not specified
        maxbw not specified
        rxfanout not specified
        vsi-typeid not specified
        vsi-vers not specified
        vsi-mgrid not specified
        etsbw-lcl not specified
        cos not specified
        pkey not specified
        linkmode not specified
capped-cpu:
        [ncpus: 4.00]
capped-memory:
        physical: 4G
        [swap: 1G]
        [locked: 100M]
rctl:
        name: zone.cpu-cap
        value: (priv=privileged,limit=400,action=deny)
rctl:
        name: zone.max-swap
        value: (priv=privileged,limit=1073741824,action=deny)
rctl:
        name: zone.max-locked-memory
        value: (priv=privileged,limit=104857600,action=deny)
zonecfg:testzone> commit
zonecfg:testzone> exit
==========>to remove anet (after installaing at time of boot it throws error link cannot create)
==========>so i remove net
zonecfg:testzone> remove anet
===========>now add only dedicated network
zonecfg:testzone> add net
zonecfg:testzone:net> set physical=net3
zonecfg:testzone:net> end
zonecfg:testzone> verify
zonecfg:testzone> commit
zonecfg:testzone> exit
4)to see zone list
root@solaris2:~# zoneadm list -cv
  ID NAME             STATUS     PATH                           BRAND    IP
   0 global           running    /                              solaris  shared
   - testzone         configured /TESTZONE                      solaris  excl
5)to veirfy zone
root@solaris2:~# zoneadm -z testzone verify
/TESTZONE must not be group readable.
/TESTZONE must not be group executable.
/TESTZONE must not be world readable.
/TESTZONE must not be world executable.
could not verify zonepath /TESTZONE because of the above errors.
zoneadm: zone testzone failed to verify
6)change permissions & verify
root@solaris2:~# chmod 700 /TESTZONE
root@solaris2:~# zoneadm -z testzone verify
7)to list zone status
root@solaris2:~# zoneadm list -cv
  ID NAME             STATUS     PATH                           BRAND    IP
   0 global           running    /                              solaris  shared
   - testzone         configured /TESTZONE                      solaris  excl
8)to install zone
root@solaris2:~# zoneadm -z testzone install
Progress being logged to /var/log/zones/zoneadm.20131227T191314Z.testzone.install
       Image: Preparing at /TESTZONE/root.
 AI Manifest: /tmp/manifest.xml.t3aaAg
  SC Profile: /usr/share/auto_install/sc_profiles/enable_sci.xml
    Zonename: testzone
Installation: Starting ...
              Creating IPS image
Startup linked: 1/1 done
              Installing packages from:
                  solaris
                      origin:  http://10.66.10.105/
                      origin:  http://10.66.10.105:8082/
Creating Plan (Download Manifests  48/184) -
Creating Plan (Package planning:  35/184):
Creating Plan (Checking for conflicting actions):
Creating Plan (Consolidating action changes):
Creating Plan (Evaluating mediators):
DOWNLOAD                                PKGS         FILES    XFER (MB)   SPEED
Completed                            184/184   34342/34342  247.3/247.3  795k/s

PHASE                                          ITEMS
Installing new actions                   48171/48171
Updating package state database                 Done
Updating image state                            Done
Creating fast lookup database                   Done
Installation: Succeeded
        Note: Man pages can be obtained by installing pkg:/system/manual
 done.
        Done: Installation completed in 820.376 seconds.

  Next Steps: Boot the zone, then log into the zone console (zlogin -C)
              to complete the configuration process.
Log saved in non-global zone as /TESTZONE/root/var/log/zones/zoneadm.20131227T191314Z.testzone.install
8)to see zone status
root@solaris2:/etc/zones# zoneadm list -cv
  ID NAME             STATUS     PATH                           BRAND    IP
   0 global           running    /                              solaris  shared
   - testzone         installed  /TESTZONE                      solaris  excl
9)to ready zone
root@solaris2:/etc/zones# zoneadm -z testzone ready
10)to boot zone
root@solaris2:/etc/zones# zoneadm  -z testzone boot
11)to list zone
root@solaris2:/etc/zones# zoneadm list -cv
  ID NAME             STATUS     PATH                           BRAND    IP
   0 global           running    /                              solaris  shared
   7 testzone         running    /TESTZONE                      solaris  excl
12)to login to zone console
root@solaris2:/etc/zones# zlogin -C testzone
[Connected to zone 'testzone' console]
94/115


                           System Configuration Tool
     System Configuration Tool enables you to specify the following
     configuration parameters for your newly-installed Oracle Solaris 11
     system:
     - network, time zone, user and root accounts, name services
     System Configuration Tool produces an SMF profile file in
     /system/volatile/scit_profile.xml.
     How to navigate through this tool:
     - Use the function keys listed at the bottom of each screen to move
       from screen to screen and to perform other operations.
     - Use the up/down arrow keys to change the selection or to move
       between input fields.
     - If your keyboard does not have function keys, or they do not
       respond, press ESC; the legend at the bottom of the screen will
       change to show the ESC keys for navigation and other functions.
  F2_Continue  F6_Help  F9_Quit

                                   Network
   Enter a name for this computer that identifies it on the network. It must
   be at least two characters. It can contain letters, numbers, and minus
   signs (-).
   Computer Name: testzone

   Select how the wired ethernet network connection is configured.
     Automatically     Automatically configure the connection
     Manually          Enter the information on the following screen
     None              Do not configure the network at this time
==========>select manually
  F2_Continue  F3_Back  F6_Help  F9_Quit

 Enter the configuration for this network connection. All entries must
   contain four sets of numbers, 0 to 255, separated by periods.
     NIC:        net3              Settings will be applied to this
                                   interface
     IP Address: 10.66.10.114      Must be unique for this network
     Netmask:    255.255.255.0     Your subnet use may require a
                                   different mask
     Router:     10.66.10.1        The IP address of the router on this
                                   subnet
  F2_Continue  F3_Back  F6_Help  F9_Quit


                              DNS Name Service
    Indicates whether or not the system should use the DNS name service.
      Configure DNS
      Do not configure DNS
===========>select donot configure
  F2_Continue  F3_Back  F6_Help  F9_Quit

                            Alternate Name Service
    From the list below, select one name service to be used by this system.
    If the desired name service is not listed, select None. The selected
    name service may be used in conjunction with DNS.
      None
      LDAP
      NIS
=============>select none
  F2_Continue  F3_Back  F6_Help  F9_Quit

                             Time Zone: Regions
    Select the region that contains your time zone.
      Regions
    ────────────────────────────────────────
      UTC/GMT
      Africa
      Americas
      Antarctica
      Arctic Ocean
      Asia
      Atlantic Ocean
      Australia
      Europe
      Indian Ocean
      Pacific Ocean
===========>select region
  F2_Continue  F3_Back  F6_Help  F9_Quit

                            Time Zone: Locations
    Select the location that contains your time zone.
      Locations
    ────────────────────────────────────────
    ^ India
    │ Indonesia
    │ Iran
    │ Iraq
    │ Israel
    │ Japan
    │ Jordan
    │ Kazakhstan
    │ Korea (North)
    │ Korea (South)
    │ Kuwait
    │ Kyrgyzstan
    │ Laos
    v Lebanon

  F2_Continue  F3_Back  F6_Help  F9_Quit

                                   Time Zone
    Select your time zone.
      Time Zones
    ────────────────────────────────────────
      Asia/Kolkata

  F2_Continue  F3_Back  F6_Help  F9_Quit


                                     Users
    Define a root password for the system and user account for yourself.

    System Root Password
     Root password:    ********
     Confirm password: ********
    Create a user account
     Your real name:
     Username:
     User password:
     Confirm password:
  F2_Continue  F3_Back  F6_Help  F9_Quit

 Review the settings below before continuing. Go back (F3) to make changes.
   ─ Time Zone: Asia/Kolkata
   │
   │ Language: *The following can be changed when logging in.
   │ Default language: C/POSIX
   │ Terminal type: vt100
   │
   │ Users:
   │ No user account
   │
   │ Network:
   │ Computer name: testzone
   │ Manual Configuration: net3 (vnet3)
   │ IP Address: 10.66.10.114
   │ Netmask: 255.255.255.0
   │ Router: 10.66.10.1
   │
   v Support configuration:
  F2_Apply  F3_Back  F6_Help  F9_Quit

SC profile successfully generated.
Exiting System Configuration Tool. Log is available at:
/system/volatile/sysconfig/sysconfig.log.11285

Hostname: testzone
Dec 28 01:28:05 testzone sendmail[12256]: My unqualified host name (testzone) unknown; sleeping for retry
Dec 28 01:28:05 testzone sendmail[12255]: My unqualified host name (testzone) unknown; sleeping for retry
testzone console login: root
Password:
Dec 28 01:28:12 testzone login: ROOT LOGIN /dev/console
Oracle Corporation      SunOS 5.11      11.1    May 2013
root@testzone:~#
==============>after install zone only small-server pkg are installed
root@testzone:~# pkg info solaris-small-server
          Name: group/system/solaris-small-server
       Summary: Oracle Solaris Small Server
   Description: Provides a useful command-line Oracle Solaris environment
      Category: Meta Packages/Group Packages
         State: Installed
     Publisher: solaris
       Version: 0.5.11
 Build Release: 5.11
        Branch: 0.175.1.0.0.24.3
Packaging Date: Wed Sep 19 18:53:18 2012
          Size: 5.46 kB
          FMRI: pkg://solaris/group/system/solaris-small-server@0.5.11,5.11-0.175.1.0.0.24.3:20120919T185318Z

root@testzone:~# dladm show-phys
LINK              MEDIA                STATE      SPEED  DUPLEX    DEVICE
net3              Ethernet             up         0      unknown   vnet3

root@testzone:~# prtconf
System Configuration:  Oracle Corporation  sun4v
Memory size: 4096 Megabytes
System Peripherals (Software Nodes):
prtconf: devinfo facility not available

root@testzone:~# psrinfo
0       on-line   since 12/27/2013 23:12:07
1       on-line   since 12/27/2013 23:12:09
2       on-line   since 12/27/2013 23:12:09
3       on-line   since 12/27/2013 23:12:09
4       on-line   since 12/27/2013 23:12:09
5       on-line   since 12/27/2013 23:12:09
6       on-line   since 12/27/2013 23:12:09
7       on-line   since 12/27/2013 23:12:09
8       on-line   since 12/27/2013 23:12:09
9       on-line   since 12/27/2013 23:12:09
10      on-line   since 12/27/2013 23:12:09
11      on-line   since 12/27/2013 23:12:09
12      on-line   since 12/27/2013 23:12:09
13      on-line   since 12/27/2013 23:12:09
14      on-line   since 12/27/2013 23:12:09
15      on-line   since 12/27/2013 23:12:09
16      on-line   since 12/27/2013 23:12:09
17      on-line   since 12/27/2013 23:12:09
18      on-line   since 12/27/2013 23:12:09
19      on-line   since 12/27/2013 23:12:09
20      on-line   since 12/27/2013 23:12:09
21      on-line   since 12/27/2013 23:12:09
22      on-line   since 12/27/2013 23:12:09
23      on-line   since 12/27/2013 23:12:09
24      on-line   since 12/27/2013 23:12:09
25      on-line   since 12/27/2013 23:12:09
26      on-line   since 12/27/2013 23:12:09
27      on-line   since 12/27/2013 23:12:09
28      on-line   since 12/27/2013 23:12:09
29      on-line   since 12/27/2013 23:12:09
root@testzone:~# df -h
Filesystem             Size   Used  Available Capacity  Mounted on
rpool/ROOT/solaris      14G   438M        14G     3%    /
/dev                     0K     0K         0K     0%    /dev
rpool/ROOT/solaris/var
                        14G    27M        14G     1%    /var
proc                     0K     0K         0K     0%    /proc
ctfs                     0K     0K         0K     0%    /system/contract
mnttab                   0K     0K         0K     0%    /etc/mnttab
objfs                    0K     0K         0K     0%    /system/object
swap                   1.0G   122M       902M    12%    /system/volatile
sharefs                  0K     0K         0K     0%    /etc/dfs/sharetab
fd                       0K     0K         0K     0%    /dev/fd
swap                   1.0G   122M       902M    12%    /tmp
rpool/VARSHARE          14G    39K        14G     1%    /var/share
rpool/export            14G    32K        14G     1%    /export
rpool/export/home       14G    31K        14G     1%    /export/home
rpool                   14G    31K        14G     1%    /rpool

root@testzone:~# ping 10.66.10.114
10.66.10.114 is alive
root@testzone:~# ping 10.66.10.1
10.66.10.1 is alive
root@testzone:~#

~.
[Connection to zone 'testzone' console closed]


root@solaris2:~# zonestat 5
Collecting data for first interval...
Interval: 1, Duration: 0:00:05
SUMMARY                 Cpus/Online: 30/30   PhysMem: 16.0G  VirtMem: 16.9G
                    ---CPU----  --PhysMem-- --VirtMem-- --PhysNet--
               ZONE  USED %PART  USED %USED  USED %USED PBYTE %PUSE
            [total]  0.11 0.39% 3246M 19.8% 5309M 30.5%   526 0.00%
           [system]  0.01 0.05% 2957M 18.0% 4972M 28.5%     -     -
             global  0.10 0.33%  194M 1.18%  199M 1.14%   362 0.00%
           testzone  0.00 0.00% 94.7M 0.57%  137M 0.79%   164 0.00%
Interval: 2, Duration: 0:00:10
SUMMARY                 Cpus/Online: 30/30   PhysMem: 16.0G  VirtMem: 16.9G
                    ---CPU----  --PhysMem-- --VirtMem-- --PhysNet--
               ZONE  USED %PART  USED %USED  USED %USED PBYTE %PUSE
            [total]  0.12 0.42% 3246M 19.8% 5309M 30.5%  1744 0.00%
           [system]  0.02 0.08% 2957M 18.0% 4972M 28.5%     -     -
             global  0.10 0.33%  194M 1.18%  195M 1.12%  1520 0.00%
           testzone  0.00 0.00% 94.7M 0.57%  141M 0.81%   224 0.00%
Interval: 3, Duration: 0:00:15
SUMMARY                 Cpus/Online: 30/30   PhysMem: 16.0G  VirtMem: 16.9G
                    ---CPU----  --PhysMem-- --VirtMem-- --PhysNet--
               ZONE  USED %PART  USED %USED  USED %USED PBYTE %PUSE
            [total]  0.13 0.44% 3246M 19.8% 5309M 30.5%  1296 0.00%
           [system]  0.01 0.03% 2957M 18.0% 4977M 28.5%     -     -
             global  0.12 0.40%  194M 1.18%  207M 1.19%  1176 0.00%
           testzone  0.00 0.00% 94.7M 0.57%  124M 0.71%   120 0.00%

root@solaris2:~# zonestat -z testzone 5
Collecting data for first interval...
Interval: 1, Duration: 0:00:05
SUMMARY                 Cpus/Online: 30/30   PhysMem: 16.0G  VirtMem: 16.9G
                    ---CPU----  --PhysMem-- --VirtMem-- --PhysNet--
               ZONE  USED %PART  USED %USED  USED %USED PBYTE %PUSE
            [total]  0.12 0.41% 3246M 19.8% 5309M 30.5%   280 0.00%
           [system]  0.02 0.08% 2957M 18.0% 4977M 28.5%     -     -
           testzone  0.00 0.00% 94.7M 0.57%  135M 0.78%    82 0.00%
Interval: 2, Duration: 0:00:10
SUMMARY                 Cpus/Online: 30/30   PhysMem: 16.0G  VirtMem: 16.9G
                    ---CPU----  --PhysMem-- --VirtMem-- --PhysNet--
               ZONE  USED %PART  USED %USED  USED %USED PBYTE %PUSE
            [total]  0.13 0.45% 3246M 19.8% 5309M 30.5%  1552 0.00%
           [system]  0.01 0.04% 2957M 18.0% 4977M 28.5%     -     -
           testzone  0.00 0.00% 94.7M 0.57%  139M 0.80%   164 0.00%



 

No comments:

Post a Comment