Saturday, February 4, 2012

5 . Find the HBA details of a Solaris machine.


 mdu-wc-2p.cable.comcast.com:/# fcinfo hba-port


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

root@ sunserver:/root# fcinfo hba-port | grep WWN

root@ sunserver:/root# fcinfo hba-port

root@ sunserver:/root# prtconf -vp | grep -i wwn

root@ sunserver:/root# prtpicl -v | grep wwn

Run the following command to obtain the physical path to the HBA Ports

    root@ sunserver:/root$ luxadm -e port
    /devices/pci@400/pci@0/pci@9/SUNW,qlc@0/fp@0,0:devctl              CONNECTED
    /devices/pci@400/pci@0/pci@9/SUNW,qlc@0,1/fp@0,0:devctl            NOT CONNECTED


With the physical path obtained from the above command, we can trace the WWN numbers as follows. here I use the physical path to the one that is connected:

    root@ sunserver:/root$ luxadm -e dump_map /devices/pci@400/pci@0/pci@9/SUNW,qlc@0/fp@0,0:devctl
    Pos  Port_ID Hard_Addr Port WWN         Node WWN         Type
    0    123456  0         1111111111111111 2222222222222222 0×0  (Disk device)
    1    789123  0         1111111111111111 2222222222222222 0×0  (Disk device)
    2    453789  0         2100001b32xxxxxx 2000001b32xxxxxx 0x1f (Unknown Type,Host Bus Adapter

4 . Find the HBA details of a Linux machine.


[root@obiapp-po-1p tmp]# cat /etc/redhat-release / uname –a

[root@obiapp-po-1p tmp]# lspci | grep -i fibre

On  Red Hat Enterprise Linux 5 (5.x)
  (X is your device 1,2,3,…N)

[root@obiapp-po-1p tmp]# cat /sys/class/scsi_host/host*/device/fc_host:host*/port_name

[root@obiapp-po-1p tmp]# cat /sys/class/fc_host/host*/port_name

Sample with multiple HBA (Fibre) QLogic

[root@obiapp-po-1p tmp]# # ls /sys/class/fc_host/

host3  host4  host5  host6

[root@obiapp-po-1p tmp]# # cat /sys/class/fc_host/host[3-6]/port_name



0x2100001b32936e24
0x2101001b32b36e24
0x2100001b32932821
0x2101001b32b32821


On Red Hat Enterprise Linux 4 (AS/ES) is on /proc/scsi/qla2xxx/1 (1,2,3,..N)

Sample:
[root@obiapp-po-1p tmp]# # egrep [node|port] /proc/scsi/qlx2xxx/0

scsi-qla0-adapter-node=200000e08b1c19f2;
scsi-qla0-adapter-port=210000e08b1c19f2;

[root@obiapp-po-1p tmp]# systool -c fc_host -v

3 .Extend the FS using LVM method.


[root@obiapp-po-1p tmp]# df -h
Filesystem                                                     Size  Used Avail Use%   Mounted on
/dev/mapper/RootVolGroup00-lv_root           7.8G  5.2G  2.2G  71%         /
 /dev/mapper/RootVolGroup00-lv_var           9.7G  790M  8.5G   9%        /var
/dev/mapper/RootVolGroup00-lv_opt           20G   17G  2.3G  88%         /opt
                                          /dev/sda1              494M   18M  451M   4%    /boot
                                              tmpfs                 16G     0   16G   0%        /dev/shm
                                               tmpfs                4.0K     0  4.0K   0%       /dev/vx
      /dev/vx/dsk/clstrdg/datavol01                   511G   20G  461G   5%       /data
 [root@obiapp-po-1p tmp]#  vgdisplay
  --- Volume group ---
  VG Name               RootVolGroup00
  System ID
  Format                lvm2
====================================
====================================
  Alloc PE / Size       1344 / 42.00 GB
  Free  PE / Size       2975 / 92.97 GB 
  ===================================
   ==================================
[root@obiapp-po-1p tmp]# lvextend  –L   +20G  /dev/RootVolGroup00/lv_opt

  Extending logical volume lv_opt to 40.00 GB
  Logical volume lv_opt successfully resized

[root@obiapp-po-1p tmp]# resize2fs  /dev/RootVolGroup00/lv_opt
resize2fs 1.39 (29-May-2006)
Filesystem at /dev/RootVolGroup00/lv_opt is mounted on /opt; on-line resizing required
Performing an on-line resize of /dev/RootVolGroup00/lv_opt to 10485760 (4k) blocks.
The filesystem on /dev/RootVolGroup00/lv_opt is now 10485760 blocks long.
[root@obiapp-po-1p tmp]# df -h
Filesystem                                                                   Size  Used Avail Use% Mounted on
/dev/mapper/RootVolGroup00-lv_root                        7.8G  5.2G  2.2G  71% /
/dev/mapper/RootVolGroup00-lv_var                          9.7G  790M  8.5G   9% /var
/dev/mapper/RootVolGroup00-lv_opt                      39G   17G   21G  44% /opt
                          /dev/sda1                                           494M   18M  451M   4% /boot
                               tmpfs                                            16G     0   16G   0% /dev/shm
                                tmpfs                                             4.0K     0  4.0K   0% /dev/vx
 /dev/vx/dsk/clstrdg/datavol01                                       511G   20G  461G   5% /data

  [root@obiapp-po-1p tmp]#

2 .Create the FS using LVM method (Through script)


[root@cmptrn-wc-31p home]# cat lvm_unix
pvcreate /dev/sdam
pvcreate /dev/sdan
pvcreate /dev/sdal
pvcreate /dev/sdai
pvcreate /dev/sdah
pvcreate /dev/sdag
pvcreate /dev/sdaf
sleep 3
#
vgextend  RootVolGroup00  /dev/sdam  /dev/sdan  /dev/sdal  /dev/sdai  /dev/sdah  /dev/sdag /dev/sdaf
sleep2
#
lvcreate -L 20G /dev/RootVolGroup00 -n lv_home_uc4
lvcreate -L 250G /dev/RootVolGroup00 -n lv_var_archive
lvcreate -L 20G /dev/RootVolGroup00 -n lv_var_cemp
lvcreate -L 150G /dev/RootVolGroup00 -n lv_var_cemp_data1
lvcreate -L 150G /dev/RootVolGroup00 -n lv_var_cemp_data2
lvcreate -L 100G /dev/RootVolGroup00 -n lv_var_cemp_logs
sleep2
#
mkfs -t ext3 /dev/RootVolGroup00/lv_home_uc4
mkfs -t ext3 /dev/RootVolGroup00/lv_var_archive
mkfs -t ext3 /dev/RootVolGroup00/lv_var_cemp
mkfs -t ext3 /dev/RootVolGroup00/lv_var_cemp_data1
mkfs -t ext3 /dev/RootVolGroup00/lv_var_cemp_data2
mkfs -t ext3 /dev/RootVolGroup00/lv_var_cemp_logs
sleep5
#
mkdir /home/uc4
mkdir /var/cemp
mkdir /var/cemp/data1
mkdir /var/cemp/data2
mkdir /var/cemp/logs
mkdir /var/archive
[root@cmptrn-wc-31p home]#  sh -x lvm_unix

1. Create the FS using LVM method.



 1.  From    fdisk –l                 identify the disk you need to add to the FS

 2.  pvcreate /dev/sdai        [pvcreate initializes PhysicalVolume for later use by the Logical Volume      Manager (LVM). Each PhysicalVolume can be a disk partition,   whole disk, meta device, or loopback file)

 3.  vgextend RootVolGroup00  /dev/sdai   -It would extend the volume group with the new disk

 4. vgdisplay RootVolGroup00     verify the volume group size again

 5. lvcreate -L  50G /dev/RootVolGroup00  -n  lv_home_cemp    Create a logical volume under the   volume group

 6. lvdisplay  /dev/RootVolGroup00/lv_home_cemp         verify the new logical  volume created

 7.  mkfs -t ext3 /dev/RootVolGroup00/lv_home_cemp     Format the FS in ext3

 8.  mount   /dev/RootVolGroup00/lv_home_cemp    /home/cemp  Mount the FS in a mountpoint

 9.  cat /etc/fstab

 9.  cp -p fstab fstab.bkp.01022012  Taking backup of fstab

10 .  vi  /etc/fstab   Edit the  file for the new Mount points

11.  echo " command " >> /etc/fstab    ( to append a command)
         Eg  : echo "/dev/RootVolGroup00/lv_home_nagios      /home/nagios    ext3    defaults        1 2" >>   /etc/fstab

12. df  –k   Verify the new FS

Thursday, January 19, 2012

VMAX Thin LUN provisioning

VMAX LUN provisioning includes the following steps:

Create a Thin Device
Create a storage group with the device created
Create an initiator group with host WWNs
Create a port group with array controller (follow rule of 17)
Create a masking view with storage group, initiator group and port group

Create a VMAX Thin Device

A. Create a text file:

create dev count=1, size=350GB, emulation=FBA,
config=TDEV,device_attr=SCSI3_persist_reserv ,binding to pool=Silver_FC_P2;

symconfigure -sid 4328 -f command_file.txt prepare

symconfigure -sid 4328 -f command_file.txt commit

Or

C:\>symconfigure -sid xxxx -cmd "create dev count=10, size=109227, emulation=fba,

config=TDEV, device_attr = SCSI3_persist_reserv, binding to pool=Silver_FC_P2"; commit

Create a Meta thin device.

C:\>symconfigure -sid xxxx -cmd "create dev count=10, size=109227, emulation=fba

, config=TDEV, device_attr = SCSI3_persist_reserv"; commit

Note down the new Devices created : eg : New symdevs : 1604:160D

C:\>symconfigure -sid xxxx -cmd "form meta from dev 1604, config=concatenated;
add dev 1605:160D to meta 1604"; commit

C:\>symconfigure -sid xxxx -cmd "bind tdev 1604 to pool Silver_FC_P2"; commit

Create a storage group

symaccess -sid XXXX -type storage -name TTTT create devs 1604

symaccess -sid xxxx -type storage -name TTTT add devs 160E

or

symaccess -sid xxxx -type storage -name TTTT create devs 1604:1605

symaccess -sid xxx -name TTTT -type storage create devs 0050, 0055

Create an initiator group

symaccess -sid xxxx -type initiator -name yyyy create -wwn 21000024FF31EA98

symaccess -sid xxxx -type initiator -name yyyy add -wwn 21000024FF31EA99

 It is also possible to create the group and add in one command as follows:

symaccess -sid xxxx create -name <init_group_name> -type initiator -f <filename>

where the file <filename> contains WWN entries,

eg: 2000000000000001, 2000000000000002, 2000000000000003

Create a Port Group.

symaccess -sid xxxx create -name hhhh -type port -dirport 9e:0,11e:0.

  Create a Masking view

symaccess -sid xxxx create view -name ZZZZ-sg TTTT -pg hhhh -ig YYYY

To verify the Configurations:

symaccess -sid xxxx list -type initiator / symaccess -sid xxx -type initiator show YYYY

symaccess -sid xxxx list -type storage

symaccess -sid xxxx list -type port symaccess -sid xxxx list view

C:\>symaccess -sid xxx show view zzzz

Adding LUNs to DMX-4

Adding LUNs to existing Symmetri x Configuration

[From host WWN /host name , find the zoning information from the fabric switch. From zone
name We can find the symmetrix array and controller details (if its named accordingly)]

1. symmask -sid xxxx -wwn 2100001b328exxxx list logins

It will give the symmetrix array details, director , director port it is mapped to ,
node name etc

2. symmaskdb -sid xxx list -host hostname capacity

It would give all the device attached, total capacity etc

3. Pick any device from the above list and issue

symdev -sid xxx show 1270

It would give mirror/hyper type , meta configuration ,meta stripe size etc.

Keep the same configuration for  new LUNS as well

4. Symdev -sid xxxx list –noport

Select appropriate device based on the requirement(size, meta config)

5. symconfigure –sid xxxx –cmd “form meta from dev 1270 config=striped,
stripe=size=1920; add dev 1271;1273 to meta 1270”; commit

6. symcfg -sid xxxx –FA 13C –p 1 list –address –available (command 1 will give
director ,port info).Do it for both the ports. Select the one with available (*)

7. symconfigure –sid xxxx –cmd “ map dev 1270 to dir 4C:1,target=0,lun=005”; commit

LUN number would get from previous command
8. symmask –sid xxxx –wwn wwn -dir 13C p1 add devs 1270 (do the same for another
initiator)
9. symmask –sid xxxx refresh.