Total Pageviews

Thursday, 27 March 2014

ZONES (OS level Virtualization) !!!!

With the concept of ZONES (OS level virtualizing) can create multiple instance on existing OS. So that we can manage multiple applications and their environments within one operating system instance.

Let us start with types of zones :

1) Sparse root zone      2) Whole root zone      3) Branded zones

Whole root zone : A wholeroot zone copies all the packages from global zone. 

Sparse root Zone : It maintains an loop back filesystem (LOFS) of all the critical file system from the base OS. It shares the main configuration files from the global zone. /usr, /platform, /sbin, /lib are the file systems are shared from global zone. 

To know the difference between zone, create both whole and sparse root zone, then type the command: 
$zonecfg -z <zonename> info 
  inherit-pkg-dir:

Branded zones : We need to install packages from OS.

For any kind of zone there will be some common states.

1) Uninitialized : initial state of a zone.Not yet started anything.
2) Configured : soon after configuring paramaters, zone will be in configured state.No software has been installed yet. 
3) Incomplete : In this state we can install packages.Zone is ready to be installed or uninstalled.
4) Installed  : Package tools can be run.After installing complete parameters a zone will be in installed state.
5) Ready : Zone is installed and about to move to running state. 
6) Running : Zone will be providing its services.

If a zone is currently in running state to perform any operation like reboot or deletion we need to halt the zone first and then reboot or uninstall.

Let say to delete my existing zone , I need to follow below steps :

zoneadm -z <zone> halt                         ------ halting my zone.
zoneadm -z <zone> uninstall                 ------ uninstall now
zonecfg -z <zone> delete -F                   ------ now we can delete it 

All the administration related tasks will be done by using zoneadm command
and all configuration related tasks will be done by using zonecfg command.

Few regular usage commands :

To view list of zones         zoneadm list -cv
To verify a zone   zoneadm -z <zone> verify
To install a zone                zoneadm -z <zone> install
To make a zone ready   zoneadm -z <zone> ready
To boot a zone     zoneadm -z <zone> boot
To reboot a zone   zoneadm -z <zone> reboot
To halt a zone                   zoneadm -z <zone> halt
To uninstall a zone            zoneadm -z <zone> uninstall -F

zonecfg -z myz
myz: No such zone configured
Use 'create' to begin configuring a new zone.
zonecfg:myz>
zonecfg:myz> create
zonecfg:myz>
zonecfg:myz> set zonepath=/testz
zonecfg:myz> verify
zonecfg:myz> commit
zonecfg:myz> 
zonecfg:myz>add net
zonecfg:myz:net> set physical=eri0
zonecfg:myz:net> set address=192.168.100.111
zonecfg:myz:net> end
zonecfg:myz>add device
zonecfg:myz:device>set match = /dev/dsk/c1t0d0s5
zonecfg:myz:device>end
zonecfg:myz:fs> end
zonecfg:myz> add inherit-pkg-dir
zonecfg:myz:inherit-pkg-dir> set dir=/opt/csw
zonecfg:myz:inherit-pkg-dir> end
zonecfg:myz> info
 zonepath: /testz
 autoboot: true
 pool:
 inherit-pkg-dir:
         dir: /lib
 inherit-pkg-dir:
         dir: /platform
 inherit-pkg-dir:
         dir: /sbin
 inherit-pkg-dir:
         dir: /usr
 inherit-pkg-dir:
         dir: /opt/csw
 net:
         address: 192.168.100.111
         physical: eri0
 zonecfg:myz> verify
 zonecfg:myz> commit
 zonecfg:myz> exit

################################################################################

Wednesday, 19 March 2014

LDOM Creation Steps !!!

Now with this let me give you a clear idea about ldom creation and OS installation in ldoms.

With the help of previous post you all got the concept of LDOMS , this post is something
like a demo...

My ldom name in this post will be dom1 and my control domain will be primary.
Now I will clearly explain u about ldom creation, binding , starting and stopping of ldoms.

root@mysrv1:~# 
root@mysrv1:~# 
root@mysrv1:~# 
root@mysrv1:~# ldm list
NAME             STATE      FLAGS   CONS    VCPU  MEMORY   UTIL  UPTIME
primary          active     -n-cv-  SP      12    23G      0.1%  117d 3h      ----control domain
root@mysrv1:~#  
root@mysrv1:~# 
root@mysrv1:~# 
root@mysrv1:~# ldm add-domain dom1             ---- with this I will add a new domain
root@mysrv1:~# 
root@mysrv1:~# 
root@mysrv1:~#
root@mysrv1:~# ldm list
NAME             STATE      FLAGS   CONS    VCPU  MEMORY   UTIL  UPTIME
primary          active     -n-cv-  SP      12    23G      0.1%  117d 5h
dom1             inactive   ------            
root@mysrv1:~# 
root@mysrv1:~# 
root@mysrv1:~# ldm add-vcpu 8 dom1    ------ adding virtual cpus
root@mysrv1:~# 
root@mysrv1:~#
root@mysrv1:~# ldm list
NAME             STATE      FLAGS   CONS    VCPU  MEMORY   UTIL  UPTIME
primary          active     -n-cv-  SP      12    23G      0.1%  117d 5h
dom1             inactive   ------      8
root@mysrv1:~# 
root@mysrv1:~# 
root@mysrv1:~# 
root@mysrv1:~# ldm add-memory 8g dom1    ---- adding memory
root@mysrv1:~# 
root@mysrv1:~#
root@mysrv1:~# ldm list
NAME             STATE      FLAGS   CONS    VCPU  MEMORY   UTIL  UPTIME
primary          active     -n-cv-  SP      12    23G      0.1%  117d 5h
dom1             inactive   ------      8     8G 
root@mysrv1:~# 
root@mysrv1:~# 
root@mysrv1:~# 
root@mysrv1:~# ldm add-vnet vnet1 vsw=primary-vsw0 dom1         ----adding vnet
root@mysrv1:~# 
root@mysrv1:~# 
root@mysrv1:~# ldm add-vdiskserverdevice /dev/dsk/c3t1d0s3 vol3@primary-vds0
root@mysrv1:~#                            adding device to my virtualdiskserver of control domain
root@mysrv1:~# 
root@mysrv1:~# 
root@mysrv1:~# ldm add-vdisk vdisk2 vol3@primary-vds0 dom1
root@mysrv1:~#                           adding disk to my ldom from virtualdiskserver of control domain
root@mysrv1:~# 
root@mysrv1:~#
root@mysrv1:~# ldm list-services            ------ services from my control domian
VCC
    NAME             LDOM             PORT-RANGE
    primary-vcc0     primary          5000-5100

VSW
    NAME             LDOM             MAC               NET-DEV   ID   DEVICE     LINKPROP   DEFAULT-VLAN-ID PVID VID                  MTU   MODE   INTER-VNET-LINK
    primary-vsw0     primary          00:14:4f:f8:2d:a6 net0      0    switch@0              1               1                         1500         on

VDS
    NAME             LDOM             VOLUME         OPTIONS          MPGROUP        DEVICE
    primary-vds0     primary          iso                                            /dev/lofi/1
                                      disk01                                         /dev/dsk/c3t1d0s5
                                      vol1                                           /dev/dsk/c3t1d0s0
                                      vol2                                           /dev/dsk/c3t1d0s1
                                      dvd_vol        ro                              /dev/dsk/c2t0d0s2
                                      vol3                                           /dev/dsk/c3t1d0s3
root@mysrv1:~# 
root@mysrv1:~#
root@mysrv1:~#
root@mysrv1:~# ldm list-bindings dom1
NAME             STATE      FLAGS   CONS    VCPU  MEMORY   UTIL  UPTIME
dom1             inactive   -t----      8     8G        
UUID
    e3b65df4-44a9-c2dc-fb82-a39b18084997
MAC
    00:14:4f:fb:99:b6
HOSTID
    0x84fb99b6
CONTROL
    failure-policy=ignore
    extended-mapin-space=off
DEPENDENCY
    master=
CORE
    CID    CPUSET
    1      (4, 5, 6, 7)
    2      (8, 9, 10, 11)
VCPU
    VID    PID    CID    UTIL STRAND
    0      4      1      100%   100%
    1      5      1      0.0%   100%
    2      6      1      0.0%   100%
    3      7      1      0.0%   100%
    4      8      2      0.0%   100%
    5      9      2      0.0%   100%
    6      10     2      0.0%   100%
    7      11     2      0.0%   100%
MEMORY
    RA               PA               SIZE
    0x8000000        0x5c8000000      8G
NETWORK
    NAME             SERVICE                     ID   DEVICE     MAC               MODE   PVID VID                  MTU   LINKPROP
    vnet0            primary-vsw0@primary        0    network@0  00:14:4f:fa:9a:9b        1                         1500
        PEER                        MAC               MODE   PVID VID                  MTU   LINKPROP
        primary-vsw0@primary        00:14:4f:f8:2d:a6        1                         1500
        vnet1@primary               00:14:4f:f8:cd:ac        1                         1500
DISK
    NAME             VOLUME                      TOUT ID   DEVICE  SERVER         MPGROUP
    vdisk2           vol3@primary-vds0                0    disk@0  primary
VCONS
    NAME             SERVICE                     PORT
    dom1             primary-vcc0@primary        
root@mysrv1:~#
root@mysrv1:~# 
root@mysrv1:~#
root@mysrv1:~# ldm bind-domain dom1         ----- now I will bind my domain
root@mysrv1:~#
root@mysrv1:~# 
root@mysrv1:~# ldm list
NAME             STATE      FLAGS   CONS    VCPU  MEMORY   UTIL  UPTIME
primary          active     -n-cv-  SP      12    23G      0.1%  117d 5h
dom1             bound      ------      8     8G
root@mysrv1:~#
root@mysrv1:~# 
root@mysrv1:~# ldm start-domain dom1
LDom dom1 started
root@mysrv1:~#
root@mysrv1:~#
root@mysrv1:~#
root@mysrv1:~# 
root@mysrv1:~# ldm list
NAME             STATE      FLAGS   CONS    VCPU  MEMORY   UTIL  UPTIME
primary          active     -n-cv-  SP      12    23G      0.1%  117d 3h
dom1             active     -t----  5000    8     8G        12%  5m
root@mysrv1:~#
root@mysrv1:~#
root@mysrv1:~#
root@mysrv1:~#
root@mysrv1:~# echo|format
Searching for disks...done

AVAILABLE DISK SELECTIONS:
       0. c3t0d0 <SUN72G cyl 14087 alt 2 hd 24 sec 424>
          /pci@7c0/pci@0/pci@1/pci@0,2/LSILogic,sas@2/sd@0,0
       1. c3t1d0 <FUJITSU-MAY2073RCSUN72G-0401 cyl 14087 alt 2 hd 24 sec 424>
          /pci@7c0/pci@0/pci@1/pci@0,2/LSILogic,sas@2/sd@1,0
Specify disk (enter its number): Specify disk (enter its number):
root@mysrv1:~#
root@mysrv1:~#
root@mysrv1:~# zpool status
  pool: rpool
 state: ONLINE
  scan: scrub repaired 0 in 0h4m with 0 errors on Thu Mar 28 17:29:19 2013
config:
        NAME        STATE     READ WRITE CKSUM
        rpool       ONLINE       0     0     0
          c3t0d0s0  ONLINE       0     0     0
errors: No known data errors
root@mysrv1:~#
root@mysrv1:~# df -kh
Filesystem             Size   Used  Available Capacity  Mounted on
rpool/ROOT/newbesoalris-1
                        67G    36G       880M    98%    /
/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                    23G   2.6M        23G     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/newbesoalris-1/var
                        67G   4.6G       880M    85%    /var
swap                    23G     8K        23G     1%    /tmp
rpool/export            67G    34K       880M     1%    /export
rpool/export/home       67G    35K       880M     1%    /export/home
rpool                   67G    83K       880M     1%    /rpool
rpool/bkp               67G    31K       880M     1%    /rpool/bkp
rpool/fs1               67G    31K       880M     1%    /rpool/fs1
root@mysrv1:~#
root@mysrv1:~#
root@mysrv1:~#
root@mysrv1:~#
root@mysrv1:~# ldm list
NAME             STATE      FLAGS   CONS    VCPU  MEMORY   UTIL  UPTIME
primary          active     -n-cv-  SP      12    23G      0.1%  117d 4h
dom1             active     -t----  5000    8     8G        12%  24m
root@mysrv1:~#
root@mysrv1:~#
root@mysrv1:~# ldm add-vdiskserverdevice /dev/dsk/c3t1d0s6 vol4@primary-vds0
root@mysrv1:~#                             adding 1more device to my VDS.
root@mysrv1:~#
root@mysrv1:~#
root@mysrv1:~# ldm list-services          ---- check the device in VDS
VCC
    NAME             LDOM             PORT-RANGE
    primary-vcc0     primary          5000-5100
VSW
    NAME             LDOM             MAC               NET-DEV   ID   DEVICE     LINKPROP   DEFAULT-VLAN-ID PVID VID                  MTU   MODE   INTER-VNET-LINK
    primary-vsw0     primary          00:14:4f:f8:2d:a6 net0      0    switch@0              1               1                         1500         on
VDS
    NAME             LDOM             VOLUME         OPTIONS          MPGROUP        DEVICE
    primary-vds0     primary          iso                                            /dev/lofi/1
                                      disk01                                         /dev/dsk/c3t1d0s5
                                      vol1                                           /dev/dsk/c3t1d0s0
                                      vol2                                           /dev/dsk/c3t1d0s1
                                      dvd_vol        ro                              /dev/dsk/c2t0d0s2
                                      vol3                                           /dev/dsk/c3t1d0s3
                                      vol4                                           /dev/dsk/c3t1d0s6
root@mysrv1:~#
root@mysrv1:~#
root@mysrv1:~#
root@mysrv1:~#
root@mysrv1:~#
root@mysrv1:~# dfshares 10.20.10.21
RESOURCE                                  SERVER ACCESS    TRANSPORT
10.20.10.21:/softwares                10.20.10.21  -         -
10.20.10.21:/jumpstart/SOL10         10.20.10.21  -         -
root@mysrv1:~#
root@mysrv1:~#
root@mysrv1:/#
root@mysrv1:/# mount 10.20.10.21:/softwares /mnt
root@mysrv1:/#
root@mysrv1:/#                       Now proceed to OS installation on ur LDOM
root@mysrv1:/# cd /mnt
root@mysrv1:/mnt#
root@mysrv1:/mnt#
root@mysrv1:/mnt#
root@mysrv1:/mnt# cd Solaris10U11
root@mysrv1:/mnt/Solaris10U11#
root@mysrv1:/mnt/Solaris10U11# ls -lrth
total 4523184
-rw-r--r--   1 root     root        2.2G Mar 27  2013 sol-10-u11-ga-sparc-dvd.iso
root@mysrv1:/mnt/Solaris10U11#
root@mysrv1:/mnt/Solaris10U11# pwd
/mnt/Solaris10U11
root@mysrv1:/mnt/Solaris10U11#
root@mysrv1:/mnt/Solaris10U11# cp sol-10-u11-ga-sparc-dvd.iso /tmp
root@mysrv1:/mnt/Solaris10U11#
root@mysrv1:/mnt/Solaris10U11#
root@mysrv1:/mnt/Solaris10U11# cd /tmp
root@mysrv1:/tmp#
root@mysrv1:/tmp#
root@mysrv1:/tmp# pwd
/tmp
root@mysrv1:/tmp#
root@mysrv1:/tmp#
root@mysrv1:/tmp# ls
sol-10-u11-ga-sparc-dvd.iso
root@mysrv1:/tmp#
root@mysrv1:/tmp#
root@mysrv1:/tmp# cd /root
root@mysrv1:~#
root@mysrv1:~#
root@mysrv1:~#
root@mysrv1:~# ldm add-vdiskserverdevice /tmp/sol-10-u11-ga-sparc-dvd.iso sol@primary-vds0
root@mysrv1:~#
root@mysrv1:~#
root@mysrv1:~# ldm list-services
VCC
    NAME             LDOM             PORT-RANGE
    primary-vcc0     primary          5000-5100
VSW
    NAME             LDOM             MAC               NET-DEV   ID   DEVICE     LINKPROP   DEFAULT-VLAN-ID PVID VID                  MTU   MODE   INTER-VNET-LINK
    primary-vsw0     primary          00:14:4f:f8:2d:a6 net0      0    switch@0              1               1                         1500         on
VDS
    NAME             LDOM             VOLUME         OPTIONS          MPGROUP        DEVICE
    primary-vds0     primary          iso                                            /dev/lofi/1
                                      disk01                                         /dev/dsk/c3t1d0s5
                                      vol1                                           /dev/dsk/c3t1d0s0
                                      vol2                                           /dev/dsk/c3t1d0s1
                                      dvd_vol        ro                              /dev/dsk/c2t0d0s2
                                      vol3                                           /dev/dsk/c3t1d0s3
                                      vol4                                           /dev/dsk/c3t1d0s6
                                      sol                                            /tmp/sol-10-u11-ga-sparc-dvd.iso
root@mysrv1:~#
root@mysrv1:~#
root@mysrv1:~#
root@mysrv1:~# ldm list-bindings dom1
NAME             STATE      FLAGS   CONS    VCPU  MEMORY   UTIL  UPTIME
dom1             active     -t----  5000    8     8G        12%  1h 18m
UUID
    e3b65df4-44a9-c2dc-fb82-a39b18084997
MAC
    00:14:4f:fb:99:b6
HOSTID
    0x84fb99b6
CONTROL
    failure-policy=ignore
    extended-mapin-space=off
DEPENDENCY
    master=
CORE
    CID    CPUSET
    1      (4, 5, 6, 7)
    2      (8, 9, 10, 11)
VCPU
    VID    PID    CID    UTIL STRAND
    0      4      1      100%   100%
    1      5      1      0.0%   100%
    2      6      1      0.0%   100%
    3      7      1      0.0%   100%
    4      8      2      0.0%   100%
    5      9      2      0.0%   100%
    6      10     2      0.0%   100%
    7      11     2      0.0%   100%
MEMORY
    RA               PA               SIZE
    0x8000000        0x5c8000000      8G
NETWORK
    NAME             SERVICE                     ID   DEVICE     MAC               MODE   PVID VID                  MTU   LINKPROP
    vnet0            primary-vsw0@primary        0    network@0  00:14:4f:fa:9a:9b        1                         1500
        PEER                        MAC               MODE   PVID VID                  MTU   LINKPROP
        primary-vsw0@primary        00:14:4f:f8:2d:a6        1                         1500
        vnet1@primary               00:14:4f:f8:cd:ac        1                         1500
DISK
    NAME             VOLUME                      TOUT ID   DEVICE  SERVER         MPGROUP
    vdisk2           vol3@primary-vds0                0    disk@0  primary
VCONS
    NAME             SERVICE                     PORT
    dom1             primary-vcc0@primary        5000
root@mysrv1:~#
root@mysrv1:~#
root@mysrv1:~# ldm add-vdisk iso1 sol@primary-vds0 dom1
Please perform the operation while the LDom is bound or inactive
root@mysrv1:~#
root@mysrv1:~# ldm list
NAME             STATE      FLAGS   CONS    VCPU  MEMORY   UTIL  UPTIME
primary          active     -n-cv-  SP      12    23G      0.1%  117d 5h
dom1             active     -t----  5000    8     8G        12%  1h 19m
root@mysrv1:~#
root@mysrv1:~#
root@mysrv1:~#
root@mysrv1:~# ldm stop-domain dom1
LDom dom1 stopped
root@mysrv1:~#
root@mysrv1:~#
root@mysrv1:~# ldm list
NAME             STATE      FLAGS   CONS    VCPU  MEMORY   UTIL  UPTIME
primary          active     -n-cv-  SP      12    23G      0.1%  117d 5h
dom1             bound      ------  5000    8     8G
root@mysrv1:~#
root@mysrv1:~# ldm add-vdisk iso1 sol@primary-vds0 dom1
root@mysrv1:~#
root@mysrv1:~#
root@mysrv1:~# ldm list-bindings dom1
NAME             STATE      FLAGS   CONS    VCPU  MEMORY   UTIL  UPTIME
dom1             bound      ------  5000    8     8G
UUID
    e3b65df4-44a9-c2dc-fb82-a39b18084997
MAC
    00:14:4f:fb:99:b6
HOSTID
    0x84fb99b6
CONTROL
    failure-policy=ignore
    extended-mapin-space=off
DEPENDENCY
    master=
CORE
    CID    CPUSET
    1      (4, 5, 6, 7)
    2      (8, 9, 10, 11)
VCPU
    VID    PID    CID    UTIL STRAND
    0      4      1             100%
    1      5      1             100%
    2      6      1             100%
    3      7      1             100%
    4      8      2             100%
    5      9      2             100%
    6      10     2             100%
    7      11     2             100%
MEMORY
    RA               PA               SIZE
    0x8000000        0x5c8000000      8G
NETWORK
    NAME             SERVICE                     ID   DEVICE     MAC               MODE   PVID VID                  MTU   LINKPROP
    vnet0            primary-vsw0@primary        0    network@0  00:14:4f:fa:9a:9b        1                         1500
        PEER                        MAC               MODE   PVID VID                  MTU   LINKPROP
        primary-vsw0@primary        00:14:4f:f8:2d:a6        1                         1500
        vnet1@primary               00:14:4f:f8:cd:ac        1                         1500
DISK
    NAME             VOLUME                      TOUT ID   DEVICE  SERVER         MPGROUP
    vdisk2           vol3@primary-vds0                0    disk@0  primary
    iso1             sol@primary-vds0                 1    disk@1  primary
VCONS
    NAME             SERVICE                     PORT
    dom1             primary-vcc0@primary        5000
root@mysrv1:~#
root@mysrv1:~#
root@mysrv1:~# ldm start-domain dom1
LDom dom1 started
root@mysrv1:~#
root@mysrv1:~#
root@mysrv1:~# ldm list
NAME             STATE      FLAGS   CONS    VCPU  MEMORY   UTIL  UPTIME
primary          active     -n-cv-  SP      12    23G      0.2%  117d 5h
dom1             active     -t----  5000    8     8G        12%  2s
root@mysrv1:~#
root@mysrv1:~#
root@mysrv1:~# telnet 0 5000
Trying 0.0.0.0...
Connected to 0.
Escape character is '^]'.
Connecting to console "dom1" in group "dom1" ....
Press ~? for control options ..
You do not have write access
Warning: another user currently has write permission
to this console and forcibly removing him/her will terminate
any current write action and all work will be lost.
Would you like to continue?[y/n] y
{0} ok
{0} ok
{0} ok
{0} ok
{0} ok
{0} ok devalias
iso1                     /virtual-devices@100/channel-devices@200/disk@1
vdisk2                   /virtual-devices@100/channel-devices@200/disk@0
vnet0                    /virtual-devices@100/channel-devices@200/network@0
net                      /virtual-devices@100/channel-devices@200/network@0
disk                     /virtual-devices@100/channel-devices@200/disk@0
virtual-console          /virtual-devices/console@1
name                     aliases
{0} ok
{0} ok
{0} ok boot iso1

Sun Fire T200, No Keyboard
Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
OpenBoot 4.30.4.d, 8192 MB memory available, Serial #83597750.
Ethernet address 0:14:4f:fb:99:b6, Host ID: 84fb99b6.

Boot device: /virtual-devices@100/channel-devices@200/disk@1  File and args:
SunOS Release 5.10 Version Generic_147147-26 64-bit
Copyright (c) 1983, 2013, Oracle and/or its affiliates. All rights reserved.
Configuring devices.
Using RPC Bootparams for network configuration information.
Attempting to configure interface vnet0...
Skipped interface vnet0
Setting up Java. Please wait...
lSerial console, reverting to text install
^R
Beginning system identification...
Searching for configuration file(s)...
Search complete.
Discovering additional network configuration...
                                                 From here proceed with normal OS Installation procedure
Select a Language
   0. English
   1. Brazilian Portuguese
   2. French
   3. German
   4. Italian
   5. Japanese
   6. Korean
   7. Simplified Chinese
   8. Spanish
   9. Swedish
  10. Traditional Chinese
Please make a choice (0 - 10), or press h or ? for help: 0


What type of terminal are you using?
 1) ANSI Standard CRT
 2) DEC VT52
 3) DEC VT100
 4) Heathkit 19
 5) Lear Siegler ADM31
 6) PC Console
 7) Sun Command Tool
 8) Sun Workstation
 9) Televideo 910
 10) Televideo 925
 11) Wyse Model 50
 12) X Terminal Emulator (xterms)
 13) CDE Terminal Emulator (dtterm)
 14) Other
Type the number of your choice and press Return: 3
Completing system identification...

After successful installation of OS your ldom is ACTIVE and ready to act as a individual server.

 #################################################################################

LDOMS (H/W level Virtualization) Concept !!!

In Solaris we have two beautiful concepts of Virtualization.

1) LDOMS (Logical Domains) : Hardware level Virtualization.
2) ZONES : Operating System level Virtualization.

Now in this post let us discuss about LDOMS in brief.

##########################

Logical Domains (LDOMS) :

LDOMs are also called as Oracle VM for SPARC. LDOMS can be created on High End servers like T5 series, M5 series and on all above that.

Before splitting High end server into Logical Domains we need Primary Domains.A server like M5-32 can have maximum of 4 PDOMS. We can create the whole server as a single PDOM also.

For every Pdom we need a Control Domain that controls the Logical Domain Environment.Control domain will have the control of all resources and guest domains.

Here for every PDOM we can create a control domain itself or we can make a Control and I/O Domain.

Every LDOM is a full virtual machine that runs an independent operating system instance. Below are different domains that can be created on a PDOM.

Control domain
Service domain
I/O domain
Root domain
Guest domain

The Control domain, as its name implies, controls the logical domain environment. It is used to configure machine resources and guest domains, and provides services necessary for domain operation, such as virtual console service. The control domain also normally acts as a service domain.

Service domains present virtual services, such as virtual disk drives and network switches, to other domains.

I/O domains have direct ownership of a PCI bus and direct access to physical I/O devices, such as a network card in a PCI controller.

Root domains have direct ownership of PCIe "root complex" and all associated PCIe slots. This can be used to grant access to physical I/O devices. A root domain is also an I/O domain.

Guest domains run an operating system instance without performing any of the above roles, but leverage the services provided by the above in order to run applications.

Control and service functions can be combined within domains, however it is recommended that user applications not run within control or service domains in order to protect domain stability and performance.

It is better to create both Control and I/O Domain individually, so that we can achieve redundancy while ldoms are accessing the hardware resources.

We need to install Logical Domains Manager software to enable ldm commands in control domain.

Every ldom will have three states :

1) INACTIVE  ---- state achieved by a ldom immediately after creating it. (ldm add-domain ldom)
2) BOUND ------- state achieved by a ldom when we bind it.  (ldm bind-domain ldom)
3) ACTIVE ------- state achieved by a ldom when we start the domain (ldm start-domain ldom)

To perform any action related to adding,removing resources from a ldom we need to bring that particular domain either to BOUND or INACTIVE state.

We can bring back a ACTIVE domain to BOUND state by giving ldm stop-domain ldom.
We can bring back a BOUND domain to INACTIVE state by giving ldm unbind-domain ldom.

Let us see few basic ldm commands needed while creating a new ldom,

*********
ldm list ------------ to list all ldoms.
ldm add-domain ldom ---------- to add a new ldom.
ldm remove-domain ldom ---------- to remove a particular ldom.

*********
ldm add-vcpu number ldom ---------- to add virtual cpu's to a ldom.
ldm remove-vcpu number ldom ---------- to remove virtual cpu's from a ldom.
*********
ldm add-memory size [unit] ldom ---------- to add memory from a ldom.
ldm remove-memory size [unit] ldom ---------- to remove memory from a ldom.

*********
ldm add-vsw vswitch-name ldom ---------- to add virtual switch from a ldom.
ldm remove-vsw vswitch-name ---------- to remove virtual switch from a ldom.

*********
ldm add-vnet vnetname vsw=vswitch-name ---------- to add virtual net from a ldom.
ldm remove-vnet vnetname ldom ---------- to remove virtual net from a ldom.

*********
ldm add-vds service-name ldom  ---------- to add virtual disk service.
ldm remove-vds service-name   ---------- to remove virtual disk service.

*********
ldm add-vdsdev devname volume-name@service-name ---------- to add a device to vds.
ldm remove-vdsdev volume-name@service-name ---------- to remove a device from vds.

*********
ldm add-vdisk disk-name volume-name@service-name ldom --- to add a disk from vds to ldom.
ldm remove-vdisk disk-name ldom --- to remove a disk of vds from ldom.

*********
ldm start-domain ldom
ldm stop-domain ldom
*********
ldm bind-domain ldom
ldm unbind-domain ldom
*********
ldm list-bindings ldom
ldm list-devices ldom
ldm list-services ldom

################################################################################

Friday, 14 March 2014

Failed Disk Replacement !!!

In this post we are going to see how a failed disk is to be replaced.It is very usual ,we will face hard errors on local disks.

To avoid data loss in such c
ases,we will be maintaining a mirror copy of root disk.

So when a root disk is under SVM we need to detach and unconfigure the mirror disk to replace it.

In below description, my server is having 2 disks and under SVM with RAID 1 (mirroring).

mysrv1 # echo |format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
       0. c1t0d0 <SUN146G cyl 14087 alt 2 hd 24 sec 848>
         
/pci@9,600000/SUNW,qlc@2/fp@0,0/ssd@w21000000875c9aa4,0
       1. c1t1d0 <HITACHI-HUS1014FASUN146G-2A08 cyl 14087 alt 2 hd 24 sec 848>
         
/pci@9,600000/SUNW,qlc@2/fp@0,0/ssd@w21000000875cbe35,0
Specify disk (enter its number): Specify disk (enter its number):
root@mysrv1 #
root@mysrv1 #

We can check the disk status with iostat -en.

root@mysrv1 # iostat -en |grep -i c1t1d0  
23   4   0  27 c1t1d0

To make sure regarding hard errors we cand check the dmesg errors and the metastat output.

root@mysrv1 # metastat -c
d20              m   30GB d21 d22 (maint)    
    d21          s   30GB c1t0d0s1
    d22          s   30GB c1t1d0s1 (maint)

d10              m   14GB d11 d12 (maint)    
    d11          s   14GB c1t0d0s0
    d12          s   14GB c1t1d0s0 (maint)           ----- Disk is in maintenance state.


Now we need to detach metadevice and clear the metas and metadb related to failed disk.

root@mysrv1#metadetach d20 d22
root@mysrv1 #
root@mysrv1 #metadetach d10 d12
root@mysrv1 #
root@mysrv1 #metastat -c
d20              m   30GB
    d21          s   30GB c1t0d0s1
d10              m   14GB
    d11          s   14GB c1t0d0s0
d22          s   30GB c1t1d0s1 (maint)
d12          s   14GB c1t1d0s0 (maint)

root@mysrv1 #
root@mysrv1 #
root@mysrv1 #metaclear d20 d10
root@mysrv1 #
root@mysrv1 #
root@mysrv1 #metadb -d /dev/dsk/c1t1d0s7

Unconfigure the disk,    cfgadm -al :

root@mysrv1 # cfgadm -al
Ap_Id                          Type         Receptacle   Occupant     Condition
c0                             scsi-bus     connected    configured   unknown
c0::dsk/c0t0d0     CD-ROM       connected    configured   unknown
c1                             fc-private   connected    configured   unknown
c1::dsk/c1t1d0          disk         connected    configured   unknown

usb0/1                         unknown      empty        unconfigured ok
usb0/2                         unknown      empty        unconfigured ok
usb0/3                         unknown      empty        unconfigured ok
usb0/4                         unknown      empty        unconfigured ok

root@mysrv1 #
root@mysrv1 #
root@mysrv1 # cfgadm
Ap_Id                          Type         Receptacle   Occupant     Condition
c0                             scsi-bus     connected    configured   unknown
c1                             fc-private   connected    configured   unknown

usb0/1                         unknown      empty        unconfigured ok
usb0/2                         unknown      empty        unconfigured ok
usb0/3                         unknown      empty        unconfigured ok
usb0/4                         unknown      empty        unconfigured ok

root@mysrv1 #
root@mysrv1 #

Now unconfigure the failed disk ,

root@mysrv1 #
root@mysrv1 #cfgadm -c unconfigure c1::dsk/c1t1d0
root@mysrv1 #
root@mysrv1 #
root@mysrv1 # cfgadm -al
Ap_Id                          Type         Receptacle   Occupant     Condition
c0                             scsi-bus     connected    configured   unknown
c0::dsk/c0t0d0     CD-ROM       connected    configured   unknown
c1                             fc-private   connected    configured   unknown
c1::dsk/c1t1d0          disk         connected    unconfigured   unknown

usb0/1                         unknown      empty        unconfigured ok
usb0/2                         unknown      empty        unconfigured ok
usb0/3                         unknown      empty        unconfigured ok
usb0/4                         unknown      empty        unconfigured ok

root@mysrv1 #
root@mysrv1 #

Remove the failed disk and insert the new disk.After inserting configure the new disk again.

root@mysrv1 #cfgadm -c configure c1::dsk/c1t1d0
root@mysrv1 #
root@mysrv1 # cfgadm
Ap_Id                          Type         Receptacle   Occupant     Condition
c0                             scsi-bus     connected    configured   unknown
c1                             fc-private   connected    configured   unknown
usb0/1                         unknown      empty        unconfigured ok
usb0/2                         unknown      empty        unconfigured ok
usb0/3                         unknown      empty        unconfigured ok
usb0/4                         unknown      empty        unconfigured ok

root@mysrv1 #

Now disk is ready , so copy the prtvtoc of primary disk and create metadb and metadevices.
Now re-attach the metadevices created from new
disk.

root@mysrv1 #
root@mysrv1 #prtvtoc /dev/rdsk/c1t0d0s2 | fmthard -s - /dev/rdsk/c1t1d0s2
root@mysrv1 #
root@mysrv1 #metadb -a -c 3 c1t1d0s7
root@mysrv1 #
root@mysrv1 # metadb
        flags           first blk       block count
     a m  p  luo        16              8192            /dev/dsk/c1t0d0s7
     a    p  luo        8208            8192            /dev/dsk/c1t0d0s7
     a    p  luo        16400           8192            /dev/dsk/c1t0d0s7
     a        u         16              8192            /dev/dsk/c1t1d0s7
     a        u         8208            8192            /dev/dsk/c1t1d0s7
     a        u         16400           8192            /dev/dsk/c1t1d0s7

root@mysrv1 #
root@mysrv1 #
root@mysrv1 #metainit d12 1 1 c1t1d0s0
root@mysrv1 #
root@mysrv1 #metainit d22 1 1 c1t1d0s1
root@mysrv1 #
root@mysrv1 #metattach d10 d12
root@mysrv1 #
root@mysrv1 #metattach d20 d22
root@mysrv1 #
root@mysrv1 # metastat -c
d20              m   30GB d21 d22 (resync-21%)
    d21          s   30GB c1t0d0s1
    d22          s   30GB c1t1d0s1

d10              m   14GB d12 d11 (resync-35%)
  
  d11          s   14GB c1t0d0s0
    d12          s   14GB c1t1d0s0

root@mysrv1 #

Thus Failed disk is replaced and new disk is configured and attached.

##################################################################################