Linux menu

Saturday, September 20, 2014

Solaris 11 How to create whole root zone on



In exclusive IP, you can’t set the IP address while configuring the zone. After the installation of zone, you can able to configure the IP from the local zone itself.

You need to install second local zone on this way.You can just clone it from the first simply.That will save the time.How to clone the zone ? Check out here.

1.Create a zone configuration:
create a local zone using zonecfg command  as like how we have used in solaris 10.Here the create command , configure the zones as whole root zone without any options supplied.
Arena-Node1#zonecfg -z sol11z
sol11z: No such zone configured
Use 'create' to begin configuring a new zone.
zonecfg:zarena> create
zonecfg:zarena> info
zonename: sol11z
zonepath:
brand: native
autoboot: false
bootargs:
pool:
limitpriv:
scheduling-class:
ip-type: shared
hostid:
zonecfg:zarena> set zonepath=/export/zones/sol11z
zonecfg:zarena > add anet
zonecfg:zarena:anet> set linkname=net0
zonecfg:zarena:anet> end
zonecfg:zarena > verfiy
zonecfg:zarena > commit
zonecfg:zarena > exit
2.Start the Solaris zone installation
The installation of local zone starts only you have the configure IPS repository.
root@RDSOL11:~# zoneadm -z sol11z install
The following ZFS file system(s) have been created:
    rpool/export/zones/sol11z
Progress being logged to /var/log/zones/zoneadm.20130210T233056Z.sol11z.install
       Image: Preparing at /export/zones/sol11z/root.
 AI Manifest: /tmp/manifest.xml.F_ayqq
  SC Profile: /usr/share/auto_install/sc_profiles/enable_sci.xml
    Zonename: sol11z
Installation: Starting ...
              Creating IPS image
Startup linked: 1/1 done
        Installing packages from:
solaris  origin:  http://localhost:1008/solaris/ce43f14c4791b5320596e2023cde1ec08709a3af/
Symantec origin: http://localhost:1008/Symantec/ce43f14c4791b520596e2023cde1ec08709a3af/

DOWNLOAD                                PKGS         FILES    XFER (MB)   SPEED
Completed                            183/183   33556/33556  222.2/222.2  139k/s

PHASE                                          ITEMS
Installing new actions                   46825/46825
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 2392.837 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 /export/zones/sol11z/root/var/log/zones/zoneadm.2013233056Z.sol11z.install
root@RDSOL11:~#
3.Boot the local zone
root@RDSOL11:/etc/zones# zoneadm -z sol11z boot
root@RDSOL11:/etc/zones# cd
root@RDSOL11:~# zoneadm list -cv
  ID NAME      STATUS     PATH   BRAND    IP
   0 global    running    /     solaris  shared
   3 sol11z    running    /export/zones/sol11z solaris  excl
4. Login to zone’s console:
After logging in to console, you need to configure the local zone.
root@RDSOL11:~# zlogin -C sol11z
[Connected to zone 'sol11z' console]
  Time Zone: Regions
    Select the region that contains your time zone.
      Regions
    qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
      UTC/GMT
      Africa
      Americas
      Antarctica
      Arctic Ocean
      Asia
      Atlantic Ocean
      Australia
      Europe
      Indian Ocean
      Pacific Ocean
  F2_Continue  F3_Back  F6_Help  F9_Quit

    Time Zone: Locations
    Select the location that contains your time zone.
      Locations
    x Afghanistan
    x Armenia
    x Azerbaijan
    x Bahrain
    x Bangladesh
    x Bhutan
    x Brunei
    x Cambodia
    x China
    x Cyprus
    x East Timor
    x Georgia
    x Hong Kong
    v India
  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
   System Configuration Summary
   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: sol11z
     Network Configuration: Automatic

     Support configuration:
     Not generating a Support profile as OCM and ASR services are not
     installed.

^[[12~pply  F3_Back  F6_Help  F9_Quit
SC profile successfully generated.
Exiting System Configuration Tool. Log is available at:
/system/volatile/sysconfig/sysconfig.log.12770
Hostname: sol11z
5.Login to local zone:
sol11z console login: root
Password:
Feb 11 12:13:29 sol11z login: ROOT LOGIN /dev/console
Oracle Corporation      SunOS 5.11      11.1    September 2012
root@sol11z:~# zoneadm list -cv
  ID NAME             STATUS     PATH  BRAND    IP
   3 sol11z           running    /   solaris  excl

root@sol11z:~# dladm
LINK                CLASS     MTU    STATE    OVER
net0                vnic      1500   up       ?

root@sol11z:~# df -h
Filesystem             Size   Used  Available Capacity  Mounted on
rpool/ROOT/solaris     7.5G   416M       7.0G     6%    /
/dev                     0K     0K         0K     0%    /dev
rpool/ROOT/solaris/var
                       7.5G    24M       7.0G     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                   730M   428K       730M     1%    /system/volatile
sharefs                  0K     0K         0K     0%    /etc/dfs/sharetab
/usr/lib/libc/libc_hwcap1.so.1
                       7.5G   416M       7.0G     6%    /lib/libc.so.1
fd                       0K     0K         0K     0%    /dev/fd
swap                   730M     0K       730M     0%    /tmp
rpool/VARSHARE         7.5G    39K       7.0G     1%    /var/share
rpool/export           7.5G    32K       7.0G     1%    /export
rpool/export/home      7.5G    31K       7.0G     1%    /export/home
rpool                  7.5G    31K       7.0G     1%    /rpool
root@sol11z:~# exit
logout
sol11z console login:
6.To terminate the console,
use ~. (shift Esc + .)
sol11z console login: ~.
[Connection to zone 'sol11z' console closed]

7.Configure the IP address:
root@sol11z:~# dladm  show-vnic
LINK                OVER         SPEED  MACADDRESS        MACADDRTYPE       VID
net0                ?            1000   2:8:20:38:8d:7c   random            0
root@sol11z:~# dladm  show-link
LINK                CLASS     MTU    STATE    OVER
net0                vnic      1500   up       ?
root@uaz1:~# ipadm create-ip net0
root@uaz1:~# ipadm create-addr -T static -a local=192.168.2.51/24 net0/v4
root@uaz1:~# ipadm
NAME              CLASS/TYPE STATE        UNDER      ADDR
lo0               loopback   ok           --         --
   lo0/v4         static     ok           --         127.0.0.1/8
   lo0/v6         static     ok           --         ::1/128
net0              ip         ok           --         --
   net0/v4        static     ok           --         192.168.2.51/24
   net0/v6        addrconf   ok           --         fe80::8:20ff:fe38:8d7c/10
root@uaz1:~#

Note:
If you get any errors like the below one ,it could be because incorrect syntax in zone's XML file.So do not edit zone's configuration files manually.(/etc/zones/zone-name.xml)
zonecfg:sol11z> commit
sol11z: Miscellaneous file system error
root@RDSOL11:~# zonecfg -z sol11z remove anet
sol11z: Miscellaneous file system error
Configuration not saved.
root@RDSOL11:~# zoneadm -z sol11z boot
zone 'sol11z': failed to save modified anet resource
zoneadm: zone 'sol11z': call to zoneadmd failed

No comments: