Friday, August 17, 2012

CISCO fabrics -MDS-3

CLI command modes :


Switch #

Exec mode :enables temporary changes to terminal settings ,perform basic tests,display system info.

Changes made in this mode are generally not saved across system resets.

Switch(config)#

configuration mode :enables configuration of features that affect the system as a whole .Chnages made on tis mode are saved acrosssystem resets.

To obtain a list of available commands use ?


NO form of commands :

Issue the no form of any commands to perform the following actions:

1.Undo wrongly issued command

2.Delete a created facility

 eg:delete a previouslt created zone.

eg: # no member pwwn 1:2:3:4:5
    # no zone name test vsan 1


 1. Turn the port on and give it a description:

SAN01# config t

Enter configuration commands, one per line.  End with CNTL/Z.

pacdcmdsa3(config)# interface fc4/30

pacdcmdsa3(config-if)# no shutdown

pacdcmdsa3(config-if)# switchport description deploy01

pacdcmdsa3(config-if)# exit

pacdcmdsa3(config)#

pacdcmdsa3# copy running startup

[########################################] 100%

2 .create VASN &Add the port to a vsan:

pacdcmdsa3# config t

Enter configuration commands, one per line.  End with CNTL/Z.

pacdcmdsa3(config)#vsan database

pacdcmdsa3(config-vsan-db)# vsan 10

pacdcmdsa3(config-vsan-db)# vsan 10 name test_vsan_10

pacdcmdsa3(config-vsan-db)#end

# show vsan 10




pacdcmdsa3# config t

Enter configuration commands, one per line.  End with CNTL/Z.

pacdcmdsa3(config)#vsan database

pacdcmdsa3(config-vsan-db)# vsan 10

pacdcmdsa3(config-vsan-db)# vsan 10 interface fc4/30

Traffic on fc4/30 may be impacted. Do you want to continue? (y/n) y

pacdcmdsa3(config-vsan-db)# exit

pacdcmdsa3(config)#

3 .Make pwwn alias:


pacdcmdsa3# config t

Enter configuration commands, one per line.  End with CNTL/Z.


pacdcmdsa3(config)# fcalias name deploy01 vsan 10


pacdcmdsa3(config-fcalias)# member pwwn 21:00:00:e0:8b:8f:e9:7e


pacdcmdsa3(config-fcalias)# exit

4 .Create the zone:

pacdcmdsa3# config t

Enter configuration commands, one per line.  End with CNTL/Z.


pacdcmdsa3(config)# zone name deploy01 vsan 10

pacdcmdsa3(config-zone)# member fcalias deploy01

pacdcmdsa3(config-zone)# member fcalias nsd05-r1

pacdcmdsa3(config-zone)# member fcalias nsd05-r2

pacdcmdsa3(config-zone)# exit

pacdcmdsa3(config)# exit

pacdcmdsa3#

View the zone:

pacdcmdsa3 # show zone name deploy01              

zone name deploy01 vsan 10
  fcalias name nsd05-r1 vsan 10
    pwwn 20:14:00:a0:b8:11:33:d0
 
  fcalias name nsd05-r2 vsan 10
    pwwn 20:24:00:a0:b8:11:33:d0
 
  fcalias name deploy01 vsan 10
    pwwn 21:00:00:e0:8b:8f:e9:7e


5 .Add the zone to a zoneset:

pacdcmdsa3# config t

Enter configuration commands, one per line.  End with CNTL/Z.

pacdcmdsa3(config)# zoneset name san01_prod10 vsan 10

pacdcmdsa3(config-zoneset)# member deploy01

pacdcmdsa3(config-zoneset)# exit

pacdcmdsa3(config)#

Check the zoneset name. Grab the name from the first line of output from:


pacdcmdsa3# show zoneset

zoneset name san01_prod10 vsan 10

6. Activate the zoneset


pacdcmdsa3# config t
Enter configuration commands, one per line.  End with CNTL/Z.

pacdcmdsa3(config)# zoneset activate name san01_prod10 vsan 10

Zoneset activation initiated. check zone status

pacdcmdsa3(config)# exit

pacdcmdsa3# copy running startup
[########################################] 100%

pacdcmdsa3#


7 .Add a user to the cisco mds with network-admin privileges.


pacdcmdsa3# config t

Enter configuration commands, one per line.  End with CNTL/Z.

pacdcmdsa3(config)# username username password password role network-admin

pacdcmdsa3(config)# snmp-server user username network-admin auth md5 password

pacdcmdsa3(config)# exit

pacdcmdsa3# copy running startup
[########################################] 100%

pacdcmdsa3#

8. When attaching symmetrix to your switches its best practice to hard set the ports to 4gb.


pacdcmdsa3(config-if)# int fc3/18

pacdcmdsa3(config-if)# switchport speed 4000

switchport speed auto

9. Rename Fibre Channel aliases using the fcalias rename command like this:

switch(config)# fcalias rename <old alias> <new alias> vsan 10

You can also rename zones:

switch(config)# zone rename <old zone name> <new zone name> vsan 10

And you can rename zonesets:

switch(config)# zoneset rename <old zoneset name> <new zoneset name> vsan 10

10. Search for  thread

switch# show zone | include server-name

pacdcmdsa3# show flogi database|include 21:00:00:24:ff:06:84:cb  (works like grep)

11. Set mode

mds-switch-1# conf t
Enter configuration commands, one per line. End with CNTL/Z.
mds-switch-1(config)# interface fc 1/1
mds-switch-1(config-if)# switchport mode E
mds-switch-1(config-if)# end

12. configure domain ID :

 Configure the switch in  vsan 10 to request a preffered domain 3 and accept any value assigned by the principal switch.


mds-switch-1(config)# fcdomain domain 3 preffered vsan 10

configure the switch in vsan 10 accept only a specific value and moves the local interfaces in vsan 10 to an isolated state if the requested id is not granted.

mds-switch-1(config)# fcdomain domain 3 static vsan 10

Valid domain IDs are numbers between 1-239


13.Configure priority 25 for the local switch in VSAN 10

mds-switch-1(config)# fcdomain priority 25 vsan 10


14 name server statistics

show fcns statistics

15. Rename switch

   # config t
   # switchname newname
   # exit
   # show switchname

16. set speed auto for 3 interfaces

   # config t
   # interface fc1/1 ,fc1/2,fc1/3
   # switchport speed auto
   # no shutdown
   # exit


Important commands :

show interface fc 1/11
show interface description
show interface brief
show logging info
show logging last 10
show running-config diff
show startup-config
show tech-support brief
show version
show zoneset
show running-config
show license usage
show vsan membership
show environment fan
show environment temperature

Data gathering : show tech-support

To move up one level from config mode or config sub mode type exit

To move up directly to the exec mode type end



Thursday, August 16, 2012

How to find the HOST WWN in CISCO switch?

Assuming you know the pwwn of the HBA you are searching for, you can use the following steps to find the switch it is connected to:
 1) "show fcns database"  - find your pwwn in the output to detemine what FCID is assigned to the device, and note the VSAN.  Also, the first byte of the FCID will indicated the Domain ID of the switch the device is attached to.
 2) "show topology vsan <vsan number from step 1>" search for the switch with the domain id determined in step 1.
 The "show topology" output also includes the IP address of the mgmt port, so you can quickly ssh/telnet to the host switch and than verify that you've identified the right switch with the output of "show flogi database".

Difference between FCAlias & Device-Alias

FC aliases are used to associate 1 or more PWWNs to a user friendly name.  FCaliases are VSAN specific, so if a device is moved from VSAN 1 to VSAN 2, you should delete the FCalias in VSAN 1 and create a new one in VSAN 2.  FCalias will interoperate with some non-Cisco fibre channel switches.FCaliases are propagated via a zoneset  activate.
Device aliases associate 1 PWWN to a user friendly name.  They are not vsan sepcific, and can be used for other features beside zoning.  Device Aliases are configured manually in each switch, or can be propagated via Cisco Fabric Services.There is a Device Alias mode known as enhanced  mode, which is not enabled unless configured.  With enhanced mode device alias, if an HBA is associated with a device alias, and that device alias is placed into 20 zones, then that HBA fails and is replaced so the PWWN changes, you can edit the device alias database and that will push the new PWWN into the 20 zones automatically.


replace XXX with the appropriate VSAN number):

switch(config)# fcalias name stor-array-processor-a vsan XXX
switch(config-fcalias)# member pwwn AA:BB:CC:DD:EE:FF:00:11
switch(config-fclias)# exit
switch(config)#


To create a device alias, you’ll use the device-alias database command in global configuration mode. Once you are in database configuration mode, you can create device aliases using the device-alias command, like this:


mds(config)# device-alias database
mds(config-device-alias-db)# device-alias name <Friendly name> pwwn <Fibre Channel WWPN>
mds(config-device-alias-db)# exit
mds(config)# end

There is an additional step required after defining the device aliases. You must also commit the changes to the device alias database, like this:

mds(config)# device-alias commit


This commits the changes to the device alias database and makes the device aliases active in the switch.

Once a device alias is created, it applies to that WWPN regardless of VSAN. This means that you only have to define a single device alias for any given WWPN, whereas with the fcalias command a different alias needed to be defined for each VSAN.

Using device aliases also provides a couple other key benefits:

    Device aliases are automatically distributed to other Cisco-attached switches. For example, I defined the device aliases on a Cisco MDS 9134 that was attached to the Fibre Channel expansion port of a Cisco Nexus 5010 switch. The Nexus switch automatically picked up the device aliases. As best I can tell, this is controlled by the device-alias distribute global configuration command (or its reverse, the no device-alias distribute, which would disable device alias distribution).
    Once a device alias is defined for a WWPN, anytime the WWPN is displayed the device alias is also displayed. So in the output of various commands like show flogi database, show fcns database, or show zone you will see not only the WWPN, but also that WWPN’s associated device alias.

CISCO fabrics -MDS-2

Major commands to view the details:

show fcns database
show flogi database
show fdmi database
show fcs database

show fcns database  : Gives VASN number: FCID(8bit): Vendor : PWWN details  of all ports in the fabric.- Name server database :
The name server functionality maintains a database containing the attributes for all hosts and storage devices in each VSAN.The name server stores name entries for all hosts in the FCNS database.

show flogi database : Gives interface ,VSAN,fCID,PORT WWN,node wwn of that particular switch
In a Fibre Channel fabric, each host or disk requires an FC ID. Use the show flogi command to verify if a storage device is displayed in the Fabric login (FLOGI). If the required device is displayed in the FLOGI table, the fabric login is successful.

FDMI::

show fdmi database / show fdmi database detail :
Cisco MDS 9000 Family switches provide support for the Fabric-Device Management Interface (FDMI) functionality.FDMI enables management of devices such as Fibre Channel .Host Bus Adapters (HBAs) through in-band communications.Using the FDMI functionality, the SAN-OS software can extract the following management information about attached HBAs and host operating systems without installing proprietary host agents:
•Manufacturer, model, and serial number
•Node name and node symbolic name
•Hardware, driver, and firmware versions
•Host operating system (OS) name and version number

pacdcmdsa1#  show fdmi database
Registered HBA List for VSAN 1
  10:00:00:00:c9:5d:ee:ce
  10:00:00:00:c9:61:1f:05
  21:00:00:1b:32:13:64:ef
  21:00:00:1b:32:82:0e:f4
  21:00:00:1b:32:82:5b:f2
  21:00:00:1b:32:82:66:db
  21:00:00:1b:32:82:8d:f2
  21:00:00:1b:32:82:8f:f5
 pacdcmdsa1#  show fdmi database detail
Registered HBA List for VSAN 1
-------------------------------
HBA-ID: 10:00:00:00:c9:5d:ee:ce
-------------------------------
Node Name                      :20:00:00:00:c9:5d:ee:ce
Manufacturer                     :Emulex Corporation
Serial Num                        :BG65140697
Hardware Ver                    :2057706d
Driver Ver                         :6.10g
ROM Ver                          :1.50a8
Firmware Ver                     :2.50A6 (Z2D2.50A6)
OS Name/Ver                    :SunOS 5.10 Generic_127127-11
CT Payload Len                 :525980
Port-id: 10:00:00:00:c9       :5d:ee:ce
Supported FC4 types         :scsi-fcp fc-gs
Supported Speed                :1G
Current Speed                     :2G
Maximum Frame Size          :2048
OS Device Name                :lpfc

RSCN ::

The Registered State Change Notification (RSCN) is a Fibre Channel service that informs hosts about changes in the fabric. Hosts can receive this information by registering with the fabric controller (through SCR). These notifications provide a timely indication of one or more of the following events:

•Disks joining or leaving the fabric.
•A name server registration change.
•A new zone enforcement.
•IP address change.
•Any other similar event that affects the operation of the host.

switch# show rscn scr-table vsan 1
SCR table for VSAN: 1
---------------------------------------------
FC-ID         REGISTERED FOR
--------------------------------------------
0x1b0300      fabric detected rscns
Total number of entries = 1

FCS::
The Fabric Configuration Server (FCS) provides discovery of topology attributes and maintains a repository of configuration information of fabric elements. A management application is usually connected to the FCS on the switch through an N port. The FCS views the entire fabric

pacdcmdsa1# show fcs database
FCS Local Database in VSAN: 1
------------------------------
Switch WWN               : 20:01:00:0d:ec:2a:65:41
Switch Domain Id         : 0x33(51)
Switch Mgmt-Addresses    : snmp://24.40.61.82/eth-ip
                                            http://24.40.61.82/eth-ip
                                            snmp://24.40.61.82/eth-ip
                                            http://24.40.61.82/eth-ip
Fabric-Name              : 20:01:00:0d:ec:2a:65:41
Switch Logical-Name      : pacdcmdsa1
Switch Information List  : [Cisco Systems, Inc.*DS-C9509*3.1(2)*20:00:00:0d:ec:2a:65:40]
Switch Ports:
-------------------------------------------------------------------
Interface  fWWN                     Type     Attached-pWWNs
-------------------------------------------------------------------
fc1/1      20:01:00:0d:ec:2a:65:40  TE       20:01:00:0d:ec:2d:33:c0
fc1/2      20:02:00:0d:ec:2a:65:40  F        50:06:04:82:d5:2d:b8:86
fc1/3      20:03:00:0d:ec:2a:65:40  Unknown  None
fc1/4      20:04:00:0d:ec:2a:65:40  Unknown  None
fc1/5      20:05:00:0d:ec:2a:65:40  TE       20:05:00:0d:ec:2d:33:c0
fc1/6      20:06:00:0d:ec:2a:65:40  F        50:06:04:82:d5:2d:b8:97
fc1/7      20:07:00:0d:ec:2a:65:40  Unknown  None
fc1/8      20:08:00:0d:ec:2a:65:40  Unknown  None
fc1/9      20:09:00:0d:ec:2a:65:40  F        50:06:04:8a:d5:2d:b8:86
fc1/10     20:0a:00:0d:ec:2a:65:40  F        50:06:01:60:3b:20:10:06
fc1/11     20:0b:00:0d:ec:2a:65:40  Unknown  None
fc1/12     20:0c:00:0d:ec:2a:65:40  Unknown  None
fc1/13     20:0d:00:0d:ec:2a:65:40  F        50:06:04:8a:d5:2d:b8:97
fc1/14     20:0e:00:0d:ec:2a:65:40  TE       21:41:00:0d:ec:a2:40:00
fc1/15     20:0f:00:0d:ec:2a:65:40  TE       21:4d:00:0d:ec:a2:40:00
fc1/16     20:10:00:0d:ec:2a:65:40  F        50:03:08:c0:01:c4:60:68
fc2/1      20:41:00:0d:ec:2a:65:40  F        21:00:00:1b:32:0b:8e:19
fc2/2      20:42:00:0d:ec:2a:65:40  F        21:00:00:1b:32:14:10:f5
fc2/3      20:43:00:0d:ec:2a:65:40  F        50:01:43:80:00:c2:82:80
fc2/4      20:44:00:0d:ec:2a:65:40  F        50:01:43:80:00:c2:83:66
fc2/5      20:45:00:0d:ec:2a:65:40  F        50:01:43:80:00:c2:82:14
fc2/6      20:46:00:0d:ec:2a:65:40  F        50:01:43:80:00:c2:82:4e

CISCO fabrics -MDS-1

Important terms to understand.

Fabric Manger  is a  single tool used to configure ,monitor and manage an entire fabric of switches,directors .With in fabric manager,an overview of the fabric and its topology can be obtained.

Device manager  is used to manage an individual switch/director including the installed switching modules,the supervisor modules ,the status of each port within each module,the power supplies and the fan assemblies. While fabric manager tables show values for one more switches ,device manager just can show values for single switch.

VSAN
Physical topology is divided into logical fabrics called VSANs.Zoning is assigned per VSAN.Switch ports are assigned to only one VSAN.By default all switch ports are assigned to VSAN 1.(One physical switch to be carved into several virtual fabrics).Default VSAN;VSAN 1 cant be deleted however it can be suspended
.
Isolated VSAN:

VSAN 4096 is the isolated VSAN.All non trunking ports are transferred to this VSAN when the VSAN to which they belong to is deleted. This avoids an implicit transfer of posts to the default VSAN or to another configured VSAN.

Domain Parameters:

The fcdomain feature performs principal switch selection ,domain id distribution ,FCID allocation and fabric reconfiguration function as described in the FC-SW2 standards.The domains are configured on a per VSAN basis.When a switch boots up or joins a new fabric, it can request a specific domain ID or take any available domain ID.The configured domain ID can be preffered or static .Bydefault the configured domain is 0 and the configured type is preferred. If a domain ID is not configured, the local switch sends a random ID in its request. If the configured type is preferred, the local switch accepts the domain ID assigned by the principal switch and the assigned domain ID becomes the runtime domain ID.If the configured type is static ,the assigned domain ID is discarded, all local interfaces are isolated and the local switch assigns itself the configured domain ID which becomes the runtime domain ID.After obtaining the domain ID from the principal switch in the VSAN, the local switch assigns Fibre Channel Identifiers (FC IDs) to each end device as they log into the fabric. This process is known as FLOGI.Domain ID uniquely identify a switch in VSAN.A switch may have different domain IDs in different VSANs. The domain ID is part of over all FCID.



Set switch priority:
By default ,the configured priority is 128.The valid range is between 1 and 254.Priority 1 has the highest Priority. Value 255 is accepted from other switches but cannot be locally configured. Any new switch can become the principal switch when it joins a stable fabric. During  the principal switch selection phase, the switch with highest priority becomes the principal switch. If two switches have same configured priority, the switch with lowest WWN becomes the principal switch.

Name server:
The nameserver  functionality maintains a database containing  the attributes for all hosts and storage devices in each VSAN.

G_port or generic port on a switch can operate as an E_port or F_port. Found on Brocade, McData, and QLogic switches.

N_port is a port on the node (e.g. host or storage device) used with both FC-P2P or FC-SW topologies. Also known as node port.
E_port-The port can be either a trunking or non trunking port depending on the trunking mode port mode.E port is used when the port talks to another port of different switch forming an ISL.


Scanning for New LUNS and add it to Veritas Volume manager:Solaris

format

cfgadm -al (scanning controller)

devfsadm -Cv (scanning new disk)

format

format -d c3t50060E8005B20241d55

partition -p


print current table -p

2nd wud be the full disk

l -label

q
q

==================================================================================


# vxdisk list
DEVICE       TYPE            DISK         GROUP        STATUS
disk_0       auto:none       -            -            online invalid
disk_1       auto:none       -            -            online invalid
xp24k0_0003  auto:cdsdisk    -            -            online
xp24k0_0004  auto:cdsdisk    -            -            online
xp24k0_0212  auto:cdsdisk    xp24k0_0212  clds2bdg     online
xp24k0_0213  auto:cdsdisk    xp24k0_0213  clds2bdg     online
xp24k0_0800  auto:simple     -            -            online invalid
xp24k0_0801  auto:simple     -            -            online invalid

====================================================================================

# vxdiskunsetup xp24k0_0800
# vxdiskunsetup xp24k0_0801

=====================================================================================


# vxdctl enable
# vxdisksetup -if xp24k0_0800 format=cdsdisk
# vxdisksetup -if xp24k0_0801 format=cdsdisk
=====================================================================================
# vxdisk list
DEVICE       TYPE            DISK         GROUP        STATUS
disk_0       auto:none       -            -            online invalid
disk_1       auto:none       -            -            online invalid
xp24k0_0003  auto:cdsdisk    -            -            online
xp24k0_0004  auto:cdsdisk    -            -            online
xp24k0_0212  auto:cdsdisk    xp24k0_0212  clds2bdg     online
xp24k0_0213  auto:cdsdisk    xp24k0_0213  clds2bdg     online
xp24k0_0800  auto:cdsdisk    -            -            online thin
xp24k0_0801  auto:cdsdisk    -            -            online thin
==================================================================================================
# vxdg -g clds2bdg adddisk xp24k0_0800=xp24k0_0800  (1. vgname 2.next available group name=disk name)
# vxdg -g clds2bdg adddisk xp24k0_0801=xp24k0_0801

=============================================================================================
# vxdisk list
DEVICE       TYPE            DISK         GROUP        STATUS
disk_0       auto:none       -            -            online invalid
disk_1       auto:none       -            -            online invalid
xp24k0_0003  auto:cdsdisk    -            -            online
xp24k0_0004  auto:cdsdisk    -            -            online
xp24k0_0212  auto:cdsdisk    xp24k0_0212  clds2bdg     online
xp24k0_0213  auto:cdsdisk    xp24k0_0213  clds2bdg     online
xp24k0_0800  auto:cdsdisk    xp24k0_0800  clds2bdg     online thin
xp24k0_0801  auto:cdsdisk    xp24k0_0801  clds2bdg     online thin

=============================================================================
# vxdg -g clds2bdg free
DISK         DEVICE       TAG          OFFSET    LENGTH    FLAGS
xp24k0_0213  xp24k0_0213  xp24k0_0213  102844160 1929728   -
xp24k0_0800  xp24k0_0800  xp24k0_0800  0         104773888 -
xp24k0_0801  xp24k0_0801  xp24k0_0801  0         104773888 -       50GB

=============================================================================
# hostname
cldsapp-nb-8p.cable.comcast.com
#
#vxdg -g cho-oyudg free  in bytes---divide bye 2 ..........

=============================================================================


# /usr/lib/vxvm/bin/vxresize -g cho-oyudg datavol90 +30G

        vxresize -g t1-clrdg-dr clr2-data8-dg +50G

==============================================================================


# df -k

Filesystem            kbytes    used   avail capacity  Mounted on
/dev/dsk/c0t0d0s0    8267957 3932739 4252539    49%    /
/devices                   0       0       0     0%    /devices
ctfs                       0       0       0     0%    /system/contract
proc                       0       0       0     0%    /proc
mnttab                     0       0       0     0%    /etc/mnttab
swap                 13431048    1544 13429504     1%    /etc/svc/volatile
objfs                      0       0       0     0%    /system/object
sharefs                    0       0       0     0%    /etc/dfs/sharetab
fd                         0       0       0     0%    /dev/fd
/dev/dsk/c0t0d0s4    13479123 2134137 11210195    16%    /var
swap                 18897080 5467576 13429504    29%    /tmp
swap                 13429576      72 13429504     1%    /var/run
/dev/dsk/c0t0d0s5    115081722 14689916 99240989    13%    /opt
/dev/vx/dsk/clds2bdg/vol01
                     103809024 78294764 23934633    77%    /u02
=============================================================================
# vxresize -g clds2bdg vol01 +100G
=============================================================================
# df -h
Filesystem             size   used  avail capacity  Mounted on
/dev/dsk/c0t0d0s0      7.9G   3.8G   4.1G    49%    /
/devices                 0K     0K     0K     0%    /devices
ctfs                     0K     0K     0K     0%    /system/contract
proc                     0K     0K     0K     0%    /proc
mnttab                   0K     0K     0K     0%    /etc/mnttab
swap                    13G   1.5M    13G     1%    /etc/svc/volatile
objfs                    0K     0K     0K     0%    /system/object
sharefs                  0K     0K     0K     0%    /etc/dfs/sharetab
fd                       0K     0K     0K     0%    /dev/fd
/dev/dsk/c0t0d0s4       13G   2.0G    11G    16%    /var
swap                    18G   5.2G    13G    29%    /tmp
swap                    13G    72K    13G     1%    /var/run
/dev/dsk/c0t0d0s5      110G    14G    95G    13%    /opt
/dev/vx/dsk/clds2bdg/vol01
                       199G    75G   117G    40%    /u02

===================================================================================