Thursday, 1 December 2011

SAN - Switch configuration backup and restore

Login as admin on switch by using ssh and run following command to backup switch configuration:


admin> configupload -all -p scp 192.168.1.50,root,/tmp/switch_backup.txt

This command will backup switch configuration and scp config file to 192.168.1.50 server under /tmp directory
Restore configuration:

Login as admin on switch by using ssh and run following command:

admin> configdownload -all -p scp 192.168.1.50,root,/tmp/switch_backup.txt

REDHAT - Configure channel bonding


  • Create a file in the /etc/sysconfig/network-scripts/ directory called ifcfg-bond0 with following contents

DEVICE=bond0
BOOTPROTO=none
BROADCAST=192.168.1.255
IPADDR=192.168.1.115
NETMASK=255.255.255.0
NETWORK=192.168.1.0
ONBOOT=yes
GATEWAY=192.168.1.1
TYPE=Ethernet
PEERDNS=yes
USERCTL=no

  • update /etc/sysconfig/network-scripts/ifcfg-eth0 file:
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no

  • - update /etc/sysconfig/network-scripts/ifcfg-eth1 file:

DEVICE=eth1
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no

  • Update /etc/modules.conf file and add the following line:
alias bond0 bonding

  • Once /etc/modules.conf is configured run ifup command to bring up the bonding interface
# ifup eth1

HPUX - Replace mirrored root disk on PA RISC server


Before shutdown the machine and physically replace the disk

1. Check for a successful make_recovery tape

2. Find the defective drive:

>ioscan -fnC disk
> lvlnboot –v vg00 ( capture the output to a file for comparison )
>vgdisplay -v
>ll /dev/dsk | grep “Minor #”
Note: in this particular case the defective drive is /dev/dsk/c1t2d0, root secondary pv

NOTE: If disk is showing no H/W or has a lot of stale extend, do not try dd or diskinfo on it, it may hang
3. Find the lvols on defective pv and make sure all are mirrored (ex: check free extent on both and compare).

>pvdisplay –v /dev/dsk/ c1t2d0
Note: in this particular case lvol1 to lvol9

4. Reduce the mirrors:
  
   >lvreduce -m 0 /dev/vg00/lvol1 /dev/dsk/c1t2d0 up to lvol9

5. Check the successful mirror reduction:
  
    >lvdisplay -v /dev/vg00/lvol1 up to lvol9

6. Remove the physical volume from the volume group:

    >vgreduce vg00 /dev/dsk/c1t2d0

7. Check with:

    # vgdisplay -v vg00


Shutdown the machine and physically replace the disk

8. Replace the disk. (You can use dd if=/dev/rdsk/cXtYdZ of=/dev/null bs=1204k count=100 to identify disk if it is claimed or, if NOH/W, to isolate the disk by issuing this command on disk on the same path with an scid+1 or -1)

9. Check connectivity with disk and create device files:

    >ioscan -fnC disk

10. Initialize the raw device as a boot disk:

    >pvcreate -B /dev/rdsk/c1t2d0

11. Extend the volume group by adding the physical volume:

    > vgextend /dev/vg00 /dev/dsk/c1t2d0
    > mkboot -l /dev/rdsk/c1t2d0
    > mkboot -a "hpux -lq" /dev/rdsk/c1t2d0

12. Mirror all logical volumes, which have been previously reduced:
   
   >lvextend -m 1 /dev/vg00/lvol1 /dev/dsk/c1t2d0 up to lvol9

NOTE: make sure lvol1, lvol2 and lvol3 are FIRST mirrored in this exact sequence

13. Do:

> lvlnboot –Rv vg00

NOTE: check with lvlboot –v pay close attention to boot: lvol1, you can compare to previous lvlnboot –v if you kept an output

14. Check that you have successfully increased the number of mirror copies:

    >lvdisplay -v /dev/vg00/lvol1 up to lvol9


15. Finally, check the status of the volume group:

    # vgdisplay -v vg00 | more


If hard drive showing NO_HW then no need to split the mirror physically changes the disk and then:

  • vgcfgrestore -n /dev/vg00 /dev/rdsk/c1t2d0
  • vgchange -a y /dev/vg00
  • vgsync /dev/vg00
  • mkboot -l /dev/rdsk/c1t2d0
  • mkboot -a "hpux -lq" /dev/rdsk/c1t2d0
  • lvlnboot –Rv vg00
  • lvdisplay -v /dev/vg00/lvol1 up to lvol9
  • vgdisplay -v vg00 | more

Solaris - Configure MPxIO


In general, multipathing is a method for redundancy and automatic fail-over that provides at least two physical paths to a target resource. Multipathing allows for re-routing in the event of component failure, enabling higher availability for storage resources. Multipathing also allows for the parallel routing of data, which can result in faster throughput and increased scalability.

The Solaris I/O multipathing feature is a multipathing solution for storage devices that is part of the Solaris operating environment. This feature was formerly known as Sun StorEdge Traffic Manager (STMS) or MPxIO.

Solaris Fibre Channel and Storage Multipathing software enables FC connectivity for the Solaris hosts. The software resides on the server and identifies the storage and switch devices on your SAN. It allows you to attach either loop or fabric SAN storage devices while providing a standard interface with which to manage them.

Multipathing is disabled by default for FC devices on SPARC based systems, but is enabled by default on x86 based systems.
Note - The multipathing feature is not available for parallel SCSI devices but is available for FC disk devices. Multipathing is not supported on tape drives or libraries or on IP over FC.

Example device name with multipath disabled:
/dev/dsk/c1t1d0s0

Example device name with multipath enabled:

/dev/dsk/c3t2000002037CD9F72d0s0

Enabling MPxIO -

MPxIO has a configuration file located @ /kernel/drv/fp.conf. This file is used to enable MPxIO and if needed exclude the internal disks from MPxIO
stmsboot command is also used to enables/disables/updates MPxIO configuration.

Enable MPxIO in /kernel/drv/fp.conf

1. Edit /kernel/drv/fp.conf file and have below entry uncommented.
mpxio-disable="no"; and change "no" to "yes" and save and exit. In this case you dont need to run stmsboot command, otherwise:

2. After editing fp.conf and having above entry in it active execute below command.

#stmsboot -u
<<<<< Caution: It ask for reboot so to enable MPxIO server needs downtime.

OK. So now after reboot you will have to verify if MPxIO is running or not.


# format
Searching for disks...done

c2t60050768018A8023B80000000000013Ad0: configured with capacity of 12.00GB
c2t60050768018A8023B80000000000013Bd0: configured with capacity of 12.00GB
c2t60050768018A8023B80000000000013Cd0: configured with capacity of 12.00GB
c2t60050768018A8023B80000000000013Dd0: configured with capacity of 16.00GB
c2t60050768018A8023B80000000000013Ed0: configured with capacity of 16.00GB
c2t60050768018A8023B80000000000013Fd0: configured with capacity of 16.00GB

There are various commands by which you can manage your storage disks few of them are as listed -
1. To Display Paths
# mpathadm list lu
/dev/rdsk/c2t60050768018A8023B80000000000013Fd0s2
Total Path Count: 8
Operational Path Count: 8
2. Show detailed information about a disk/LUN
#mpathadm show lu /dev/rdsk/c2t60050768018A8023B80000000000013Fd0s2

<<<<<<< You can find more details of specific LUN >>>>>>>
3. Display world wide port names/Fiber card Firmware level -
# fcinfo hba-port
HBA Port WWN: 10000000c9446e11 <----------- WWPN
OS Device Name: /dev/cfg/c4
Manufacturer: Emulex
Model: LP9002L
Firmware Version: 3.90a7 (C2D3.90A7)
FCode/BIOS Version: Boot:3.20 Fcode:1.40a0
Serial Number: BG50103047
Driver Name: emlxs
Driver Version: 2.31p (2008.12.11.10.30)
Type: N-port
State: online
Supported Speeds: 1Gb 2Gb
Current Speed: 1Gb
Node WWN: 20000000c9446e11
#fcinfo hba-port -l <<<<< Good Comand for debugging >>>>>>
#fcinfo remote-port -sl -p 10000000c9446e11
Lists all remote ports as well as the link statistics and scsi-target information

Solaris - Configure IPMP


  • On Solaris machine check which interfaces currently have IP address configured. In this example we assume that e1000g0 has current IP address. To verify:

#ifconfig -a
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1 inet 127.0.0.1 netmask ff000000
e1000g0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2 inet 192.75.109.50 netmask ffffff00 broadcast 192.75.109.255 ether 0:14:4f:a7:1c:3c

To check what other interfaces you have:

#dladm show-dev
e1000g0 link: up speed: 1000 Mbps duplex: full
e1000g1 link: down speed: 1000 Mbps duplex: full
e1000g2 link: down speed: 0 Mbps duplex: half
e1000g3 link: down speed: 0 Mbps duplex: half

If any of the interfaces has cable connected it will show the speed and duplex.

Add existing interface in IPMP group:

# ifconfig e1000g0 group ipmpgrp

Bring up second interface:

# ifconfig e1000g1 plumb
# ifconfig e1000g1 group ipmpgrp

To make it persistent across reboots:

vi /etc/hostname.e1000g0 and add the following:
<hostname> netmask + broadcast + group ipmpgrp up

NOTE: Please replace <hostname> with actual machine name.

Updated other interface, hostname.e1000g1 file

vi /etc/hostname.e1000g1
group ipmpgrp standby up

To verify that IPMP has been setup, please do the following
[NOT recommended for production servers]

# if_mpadm -d e1000g0 [Detach interface and force failover]

IP address should attach with e1000g1 interface.

# if_mpadm -r e1000g0 [Reattach interface and failback]

IP address should be back on e1000g0 interface

Solaris - Restore non-global zone configuration


global# zonecfg -z my-zone -f /tmp/myzone.config

Solaris - Backup non-global zone backup


global# zonecfg -z my-zone export > /tmp/myzone.config