Total Pageviews

Monday, 2 February 2015

Making Luns Visible at Host Side !!!

Whenever we assign luns for host, they won't be visible to host. To make luns visible at host side we need to perform few things. 

We can assume all these steps together as " host side scanning ".
Once host side scanning is performed, luns will be visible at OS level.

In one of our servers, we alloted 2 new luns. I want to add these luns to my DATA DG to increase it's size.

Now let us see what things need to be followed to make them visible at OS level.

root@mydbsrvr # bash
root@mydbsrvr #
root@mydbsrvr # df -kh /oracle
Filesystem             size   used  avail capacity  Mounted on
/dev/vx/dsk/DATA/oracle
                       408G   386G    22G    95%    /oracle
root@mydbsrvr #
root@mydbsrvr # vxdisk -oalldgs list

DEVICE       TYPE            DISK         GROUP        STATUS
c1t0d0s2     auto:none       -            -            online invalid
c1t1d0s2     auto:none       -            -            online invalid
emcpower0s2  auto:sliced     DATA0     DATA      online
emcpower1s2  auto:sliced     DATA1     DATA      online
emcpower2s2  auto:sliced     DATA2     DATA      online
emcpower3s2  auto:sliced     DATA3     DATA      online
emcpower4s2  auto:sliced     DATA4     DATA      online
emcpower5s2  auto:sliced     DATA5     DATA      online
emcpower6s2  auto:sliced     -            (DATA_old)      online
emcpower7s2  auto:sliced     DATA_new0     DATA_new      online
root@mydbsrvr #

Till now luns are not visible at veritas level, let us check in powerpath.

root@mydbsrvr # powermt display
Symmetrix logical device count=8
CLARiiON logical device count=0
Hitachi logical device count=0
Invista logical device count=0
HP xp logical device count=0
Ess logical device count=0
HP HSx logical device count=0
==============================================================================
----- Host Bus Adapters ---------  ------ I/O Paths -----  ------ Stats ------
###  HW Path                       Summary   Total   Dead  IO/Sec Q-IOs Errors
==============================================================================
3072 pci@8,700000/QLGC,qlc@3/fp@0,0  optimal      8      0       -     0      0
3076 pci@8,700000/QLGC,qlc@2/fp@0,0  optimal      8      0       -     0      8
root@mydbsrvr #

We can see device count is 8, new luns not yet visible...
So now to make luns visible, we need to scan our host, which includes following steps :

1. Configure the controllers related to fibre channel.

root@mydbsrvr # 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::500000e01821d261           disk         connected    configured   unknown
c1::500000e01821f6c1           disk         connected    configured   unknown
c2                             fc-fabric    connected    configured   unknown
c2::5006048452a85012           disk         connected    configured   unknown
c3                             fc           connected    unconfigured unknown
c6                             fc-fabric    connected    configured   unknown
c6::5006048452a8501d           disk         connected    configured   unknown
c7                             fc           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@mydbsrvr #

root@mydbsrvr # cfgadm -c configure c2
root@mydbsrvr #
root@mydbsrvr # cfgadm -c configure c6
root@mydbsrvr #

2. Scanning at multipathing level.

root@mydbsrvr # powermt config
root@mydbsrvr #
root@mydbsrvr # powermt save
root@mydbsrvr #
root@mydbsrvr # powermt display
Symmetrix logical device count=10
CLARiiON logical device count=0
Hitachi logical device count=0
Invista logical device count=0
HP xp logical device count=0
Ess logical device count=0
HP HSx logical device count=0
==============================================================================
----- Host Bus Adapters ---------  ------ I/O Paths -----  ------ Stats ------
###  HW Path                       Summary   Total   Dead  IO/Sec Q-IOs Errors
==============================================================================
3072 pci@8,700000/QLGC,qlc@3/fp@0,0  optimal      10      0       -     0      0
3076 pci@8,700000/QLGC,qlc@2/fp@0,0  optimal      10      0       -     0      8
root@mydbsrvr #

Sometimes If at this step luns are not visible go for step 3. 

3. vxscandisks and vxdctl enable which helps to scan host at Veritas level.

Let us check now,

root@mydbsrvr # vxdisk -oalldgs list
DEVICE       TYPE            DISK         GROUP        STATUS
c1t0d0s2     auto:none       -            -            online invalid
c1t1d0s2     auto:none       -            -            online invalid
emcpower0s2  auto:sliced     DATA0     DATA      online
emcpower1s2  auto:sliced     DATA1     DATA      online
emcpower2s2  auto:sliced     DATA2     DATA      online
emcpower3s2  auto:sliced     DATA3     DATA      online
emcpower4s2  auto:sliced     DATA4     DATA      online
emcpower5s2  auto:sliced     DATA5     DATA      online
emcpower6s2  auto:sliced     -            (DATA_old)     online
emcpower7s2  auto:sliced     DATA_new0     DATA_new      online
emcpower8s2  auto:none       -            -            online invalid
emcpower9s2  auto:none       -            -            online invalid
root@mydbsrvr #

Now we have to proceed initializing the disk to bring them under Veritas Control.

root@mydbsrvr #  vxdisksetup -i emcpower8 format=sliced
root@mydbsrvr #
root@mydbsrvr #  vxdisksetup -i emcpower9 format=sliced
root@mydbsrvr #

root@mydbsrvr # vxdisk -oalldgs list
DEVICE       TYPE            DISK         GROUP        STATUS
c1t0d0s2     auto:none       -            -            online invalid
c1t1d0s2     auto:none       -            -            online invalid
emcpower0s2  auto:sliced     DATA0     DATA      online
emcpower1s2  auto:sliced     DATA1     DATA      online
emcpower2s2  auto:sliced     DATA2     DATA      online
emcpower3s2  auto:sliced     DATA3     DATA      online
emcpower4s2  auto:sliced     DATA4     DATA      online
emcpower5s2  auto:sliced     DATA5     DATA      online
emcpower6s2  auto:sliced     -            (DATA_old)     online
emcpower7s2  auto:sliced     DATA_new0     DATA_new      online
emcpower8s2  auto:sliced     -            -            online
emcpower9s2  auto:sliced     -            -            online
root@mydbsrvr #

Now luns are ready to add to DG.

root@mydbsrvr # vxdg list
NAME         STATE           ID
DATA      enabled              1330684297.33.DATA
DATA_new  enabled              1330684501.41.DATA_new
root@mydbsrvr #
root@mydbsrvr #
root@mydbsrvr # vxdg -g DATA adddisk DATA6=emcpower8
root@mydbsrvr #
root@mydbsrvr # vxdg -g DATA adddisk DATA7=emcpower9
root@mydbsrvr #
root@mydbsrvr # vxprint -htg DATA

dg DATA      default      default  18000    1330684297.33.DATA_old

dm DATA0     emcpower0s2  auto     68863    142690560 -
dm DATA1     emcpower1s2  auto     68863    142690560 -
dm DATA2     emcpower2s2  auto     68863    142690560 -
dm DATA3     emcpower3s2  auto     68863    142690560 -
dm DATA4     emcpower4s2  auto     68863    142690560 -
dm DATA5     emcpower5s2  auto     68863    142690560 -
dm DATA6     emcpower8s2  auto     68863    142690560 -
dm DATA7     emcpower9s2  auto     68863    142690560 -

v  oracle       -            ENABLED  ACTIVE   855638016 SELECT   oracle-01 fsgen
pl oracle-01    oracle       ENABLED  ACTIVE   855638016 STRIPE   2/1024   RW
sd DATA0-01  oracle-01    DATA0 0        142690560 0/0      emcpower0 ENA
sd DATA2-01  oracle-01    DATA2 0        142690560 0/142690560 emcpower2 ENA
sd DATA4-01  oracle-01    DATA4 0        142437888 0/285381120 emcpower4 ENA
sd DATA1-01  oracle-01    DATA1 0        142690560 1/0      emcpower1 ENA
sd DATA3-01  oracle-01    DATA3 0        142690560 1/142690560 emcpower3 ENA
sd DATA5-01  oracle-01    DATA5 0        142437888 1/285381120 emcpower5 ENA
root@mydbsrvr #

root@mydbsrvr # vxdisk -oalldgs list
DEVICE       TYPE            DISK         GROUP        STATUS
c1t0d0s2     auto:none       -            -            online invalid
c1t1d0s2     auto:none       -            -            online invalid
emcpower0s2  auto:sliced     DATA0     DATA      online
emcpower1s2  auto:sliced     DATA1     DATA      online
emcpower2s2  auto:sliced     DATA2     DATA      online
emcpower3s2  auto:sliced     DATA3     DATA      online
emcpower4s2  auto:sliced     DATA4     DATA      online
emcpower5s2  auto:sliced     DATA5     DATA      online
emcpower6s2  auto:sliced     -            (DATA_old)      online
emcpower7s2  auto:sliced     DATA_new0     DATA_new      online
emcpower8s2  auto:sliced     DATA6     DATA      online
emcpower9s2  auto:sliced     DATA7     DATA      online
root@mydbsrvr #

root@mydbsrvr # df -kh /oracle
Filesystem             size   used  avail capacity  Mounted on
/dev/vx/dsk/DATA/oracle
                       408G   386G    22G    95%    /oracle
root@mydbsrvr #

Now we can resize the DG using these newly assigned luns,

root@mydbsrvr # vxassist -g DATA maxsize
Maximum volume size: 285886464 (139593Mb)
root@mydbsrvr #
root@mydbsrvr #
root@mydbsrvr # vxresize -g DATA oracle +130g
root@mydbsrvr #
root@mydbsrvr #
root@mydbsrvr # df -kh /oracle
Filesystem             size   used  avail capacity  Mounted on
/dev/vx/dsk/DATA/oracle
                       538G   386G   151G    72%    /oracle
root@mydbsrvr #

After performing Host Scan luns are visibled to server and thus we increased the size of our DG.

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

Renaming Guest LDOM !!!

If we want to rename our guest ldom, we need to do following things :

We can't straight away change our ldom name with a single command, once a ldom is bind and started all its resources are linked with respect to ldom's name. 

So to rename a ldom , firstly we need to stop, unbind it and then we need to remove it.
Then using it's constraints file we can add the domain with its new name.

Following are the steps :

1. Take a fresh backup of constraints for your ldom. (It should be a xml file)

ldm ls-constraints -x testldm >> /tmp/testldm.xml (where testldm is old LDom)

2. Replace the ldom name with it's new name in the file.

vi /tmp/testldm.xml (Replace the old Ldom with new Ldom)

3. Stop,unbind and remove the domain.

ldm stop testldm

ldm unbind testldm

ldm remove-domain testldm

4. Remove the disks assigned to this particular ldom.

ldm list-bindings | grep -i testldm| more (Will list all vdisk names)

ldm remove-vdsdev testldm_disk_1EF3@primary-vds0

ldm remove-vdsdev testldm-1323@primary-vds0

ldm remove-vdsdev testldm-1264@primary-vds0

5. Now there is no info related to old ldom, so proceed by adding ldom with new name using our bkp of constraints file.

ldm add-domain -i /tmp/testldm.xml

ldm bind myprod (where myprod is the new LDom)

ldm start myprod

root@RRLT5DVQA:~# ldm ls | grep myprod
myprod          active     -t----  5003    16    32G      1.2%  1.6%  6s

Thus we can rename a ldom by following above steps.

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

Hostname Change in Solaris 10 & 11 !!!

In Solaris 10, we all know how to change hostname of server without reboot.
It is so simple, just to edit entry of hostname in few files.

/etc/nodename 
/etc/hostname.*interface 
/etc/inet/hosts or /etc/hosts
/etc/inet/ipnodes 

Then we need to take care regarding crashdump location. Usually we use default location for crash dump location as /var/crash/"hostname". So rename the directory in this location:

# cd /var/crash
# mv oldname newname

Coming to Solaris 11, modifications need to be done in system configuration can be achieved through single command " svccfg ". By Centralizing such management simplifies Configuration and Administration.

Few example like,

# svccfg -s svc:/system/environment:init --- we can modify environmental values like Timezone.

then >setprop TZ=Asia/Calcutta.

Similarly to change hostname, we have svccfg -s svc:/system/identity:node rather than editing individual files like /etc/nodename for hostname and /etc/default/init for Timezone.

To change hostname in Solaris 11 follow these steps :

svccfg -s system/identity:node setprop config/nodename="MyProdServer"

svccfg -s system/identity:node setprop config/loopback="MyProdServer"

svccfg -s system/identity:node refresh

svcadm restart system/identity:node

As shown above, in identity:node service need to change 2 properties " nodename and loopback ". After setting properties just take a restart of the service to reflect modifications.

Take a new session and observe the change in hostname.

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