2013. 12. 19. 23:24

SAN,

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

# SAN Configuration

#     - SAN Switch, Storage(RAID group, LUN, Storage Group)

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



== EMC SAN switch Overview ==
a. 2 type of Switch
* Brocade 계열 OEM : B-series
* Cisco 계열 OEM product : MDS series

-- --
== B-series SAN switch command ==
=== GUI/CLI tools ===
a. CMCNE : 여러 스위치 통합관리 가능하며 별도 license 필요
a. Element Manager : web으로 접속 가능하며 pc에 java 설치되어 있어야 ...

-- --
=== Initial Configuration ===
a. ipaddrset
- ip/netmask/gw등 설정
a. 기본 계정에 대한 password 변경
- admin/root/factory/user
a. set the switch name
- switchname <name>
a. date
a. Set Fabric Parameters
: switch를 disable하고 설정하고 다 끝난다음 enable 해줘야 적용된다.
* Fabric parameter : 2개 이상의 스위치를 연동하고자 할때는 아래 3개 parameter를 같게 설정해 줘야 한다.
- Domain ID : 연동하는 스위치는 서로 다른 값을 가져야 한다.
- BB_Credit : Buffer to buffer credit으로 통신 buffer 크기 설정
- R_A_TOV : Reallocation Timeout
- E_D_TOV : Error Detection Timeout
- Switch PID format : FC-address 포맷
a. License 관련
* 6개 이상 포트 사용하고자 할때는 License 필요
a. Verify Inittial Setup
* configshow

-- --
=== CLI command list ===
a. Overall Switch information and configuration
* switchshow / fabricshow / firmwareshow / version / ipaddrshow
* supportshow
- full detailed switch info
* nsshow/nsallshow
- 해당 port에 host나 storage가 연결되어 있으면 해당 정보가 보여진다.
* configure
- change switch parameters
* switchdisable/switchenable
* reboot/fastreboot(without POST)
* diagsshow
- POST result - last bootup

a. Port management
a. portshow/portcfgshow/portdisable/portenable/Portcfg
a. port type : F-port/E-port(ISL용 port)/L-port(tape library처럼
cascade된 장치용)

a. ftp support information
* supportsave
* supportftp
- supportftp -s -h <ip> -u <id> -p <password> -d <path>

a. help command
* help, licensehelp, diaghelp, routehelp

a. Backup and Restore a Swtich configuration
* configupload
* configdownload

-- --
=== Virtual Fabric command ===
a. Concept Overview
* B-series는 Virtual fabric은 일반적으로 사용하지 않는다. 하지만 MDS series는 virtual SAN 기반위에 동작하므로 반드시 사용해야 한다.
* FID가 같은 포트끼리만 통신 가능하다. default FID=128이다.
* 두개 switch를 연동할때는 ISL로 연동할수 있다.
* Virtual Fabric 끼리 DISL(Dedicated ISL)로 각각 cable을 연결하여 연동할 수도 있지만 두개 switch에 XISL(Extended ISL)을 1개 이상 구성해서 여러 virtual Fabric이 함께 연동할 수 있다. Redundancy를 생각해서 보통 2개 이상 cable로 연결한다.
* 두개 switch를 연동하기 위해 별도 ICL interface로 연동할 수 있다.

a. Enable Virtual Fabrics
: Virtual Fabric을 enble해줘야 사용가능 하며 이때 switch는 reboot된다.
* foscondfig --show
* fosconfig --enable vf

a. Virtual Fabric Create
* lscfg --create 50
* lscfg --config 11 -port 0-3 -force
* lscfg --config 50 -s 8 -p 2-6
: slot(-s) 8/port2-6을 fid50에 할당
* lscfg --show

a. Virtual Fabric Delete or Move
* port를 default FID(128)로 옮긴 후 해당 FID를 삭제할수 있다.
- lscfg --config 128 -p 1-5
- lscfg --delete <fid>

-- --
-- --
== Host Configuration ==
== Siwtch Login concept ==
a. SCSI protocol
* Host(HBA with WWN) <--> Switch <--> Target(with LUN)
* SCSI protocol을 통해 Target(storage)의 data를 읽거나 쓰게 되는데 이를 위해서는 각각 아래의 3개 login 과정을 거쳐야 한다.
* 장치들이 Switch에 연결될때 아래 3가지 Login이 제대로 이루어지지 않으면 access가 되지 않는다.
a. Login Types
* FLOGI(Fabric login)
- Host와 Switch간에 이루어지는 Login
- 보통 인증이 생략되기도 하지만 CHAP 인증을 설정할 수도 있다.
- Login이 이루어지면 name server에 등록이 되게 된다. nsshow 명령어로
확인 가능하다.
- 인증이 이루어지면 Switch에서는 이때 Address(FC-Address, DID) mapping이 이루어 진다.
. FC-Address(3bytes) : Domain + Port ID(Area + Port)
- FC-address가 만들어지면 SW에서는 host로 해당 정보를 보내게 된다.
. Solaris의 경우 이 정보를 가지고 device 이름(c0t0d0)을 만든다.
* PLOGI (port login)
- Host와 Target간에 이루어지는 Login
* PRLI (Process Login)
- 특정 LUN은 정해진 Host와만 매핑이 이루어지는데 이를 말한다.

-- --
== Persistent Binding ==
a. Solaris의 경우 Switch의 Port번호와 FC-Address를 이용해서 Device name(ex.
c0t00d0)을 만든다.
a. 따라서 특정 port와 연결이 끊어지면 solaris가 reboot이 발생하면 device
이름이 하나씩 밀리는 문제가 있었다. 하지만 Solaris10 이후부터는 OS에서 이를
지원한다.
.a 또한

-- --
== FAN-in/Fan-Out ==
a. 하나의 storage에 몇개의 Host(HBA)를 붙일수 있는지를 나타낸다.

-- --
== inquiry utility ==
: SCSI의 inquiry command를 응용해서 만든 utility
a. inq
a. inq -hba
* HBA number를 볼수 있다.

-- --
== Host Configuration on Solaris ==
=== HBA Driver Configuration ===
a. 아래 2가지 type이 있다.
* Legacy drivers
: 해당 HBA 회사에서 제공하는 driver
- Emulex lpfc driver
* Solaris Leadville Driver
: Solaris에서 제공하는 driver

-- --
== Solaris Utility ==
a. Verify HBA firmware/model
* fcinfo hba-port

a. Display WWN data for a target device or HBA on the specified fibre
channel port.
: port에 연결되어 있는 device들을 볼수 있다. Switch에 연결되어
있는 모든 host와 storage를 볼수 있다.
* luxadm -e port
- verify the path to the HBAs installed in the host
* luxadm -e dump_map /devices/pci@1e,60000/lpfc@2/fp@0,0:devctl
- display WWN data
a. SCSI target ID와 LUN 정보 출력
* cfgadm -al -o show_FCP_dev
- c3::500604844894dacc(SCSI Target),0(LUN)

a. Tune HBA for EMC storage
* /etc/system

a. Troubleshooting
* /var/adm/messages
- fctl 이나 emlxs 가 있는 정보 출력해 볼것

-- --
-- --
== Host Configuration on Linux ==
=== HBA Driver Configuration ===
a. Useful functions and Utilities
* modprobe, lsmod, insmod, rmod
- 위 명령어들을 실행하면 device를 scanning 하므로 문제가 될 소지가 있다.
따라서 사용자가 사용하지 않는 야간등에 실행해야 한다.
* iscsiadm
* iscsi-ls
* lspci
* lsscsi
* iostat

a. Verify HBA information
: Emulex사에서 제공하는 utility
* lspci | grep "Fibre Channel"
* lsmod |grep lpfc
- lpfcdfc, lpfc 모듈이 load되어 있어야 ...
* /usr/sbin/hbanyware/hbacmd listhbas
* /usr/sbin/hbanyware/hbacmd listhbas <Port WWN>

a. Native iSCSI Driver
* iscsi-sfnet driver
- legacy driver
* open-iscsi driver
- 요즘 많이 쓰인다.

a. Starting and Stopping the iSCSI Driver
* /etc/init.d/iscsid start/stop

a. open-iscsi Driver Configuration
* /etc/iscsi/iscsid.conf


-- --
-- --
-- --
== SAN Zonning ==
=== Overview ===
a. Concept
* Virtual Fabric과 비슷하게 해당 zonning으로 묶인 놈들끼리만 통신이 가능하다.
* Zone을 만들고 해당 zone을 하나의 group으로 묶어주고 이 group을 enable 해줘야 한다.
- Zone configuration(Brocade), Zone set(MDS)라고 불리운다.
* MDS 계열의 경우 Port단위가 아니라 VSAN마다 zone을 정의해 줘야 한다.
* default zoning이 있으면 기본적으로 모든 포트가 통신 가능하므로 default zone configuration은 반드시 disable 할것
* EMC recommends Single HBA Zoning
- Reduce RSCN resets
- 하나의 HBA와 하나의 Port만을 묶어 하나의 zone으로 설정하는 것을 권장한다.
- 왜냐하면 하나의 HBA와 두개의 port(Storage의)간 zone을 구성할수 있지만 이런 경우 zone member중에 한놈이라도 죽어 있거나 비정상 상태에 빠지면 다른 멤버들이 통신을 할때마다 그 놈의 상태를 체크해야 하므로 성능 저하가 일어난다.

-- --
=== Types of Zones ===
a. WWPN(World wide port name) Zoning
- WWPN으로 zoning을 구성한다. 모든 host/storage의 WWPN을 알아야 하는
번거로움이 있지만 성능이 가장 좋고 여러 부가 기능을 사용할 수 있어
권장하는 모드이다.
a. Domain, Port(D,P) zoning
- port 단위로 zoning 구성 가능

-- --
== B-Series Zonning command ==
a. zoneshow
a. nsshow
a. zoneCreate
a. zoneAdd
a. zoneRemove
a. zoneDelete
a. zoneobjectrename
: Change zone name
a. alicreate
: zone alias
a. cfgAdd
a. configEnable
a. cfgSave
: Saves defined config to all switches in fabric across reboots
a. cfgRemove
a. cfgDelete
a. cfgClear
a. cfgDisable
a. defzone --show
a. defzone --allaccess/--noaccess
a. cfgsize
: Config DB size 확인

-- --
=== Zone, Zone config Creation ===
a. name server 확인
* nsshow
a. Default Zone disable
* defzone --show
* defzone --noaccess/--noaccess
* cfgsave
a. zone aliase creation
* alishow
* alicreate "SUN_HBA0","10:00:00:00:c9:4f:4d:38"
* alicreate "VNX_SPA02","50:06:01:61:47:20:37:b1"
a. zone Create
* zoneCreate SUN_HBA0_VNX_SPA02,"10:00:00:00:c9:4f:4d:38;...."
* zoneCreate SUN_HBA0_VNX_SPA03,"SUN_HBA0;VNX_SPA03"
* zoneshow
a. zone config Create/Enable
* cfgcreate <zone config>, <zone1>; <zone2>
* cfgsave
* cfgEnable <zone config>
* cfgshow
* cfgsize

-- --
-- --
== Storage, CLARiiON ==
=== Overview ===
* CLARiiON은 <Host -- SAN -- SPA/SPB -- DISK> 구조이며
* SPA/SPB는 Active/Active 구조이다.
* SPA,SPB는 하나의 Disk에 ownership을 가지고 한놈만이 access 하게된다.
* SPA/SPB에는 각 Host의 WWN을 등록해줘야 한다. 이후 Process login이 되게 된다.
* 이를 근거로 Storage group에 각 host들을 등록하여 사용하게 된다.
* 이때 CLARiion parameters들을 설정해줘야 한다.(5쪽)

-- --
=== RAID group/LUN/Storage group - Navispherecli GUI ===
a. How to Create RAID Group and Bind the LUN on CLARiiON?
- http://www.emcstorageinfo.com/2008/04/how-to-create-raid-group-and-bind-lun.html

-- --
=== RAID group/LUN/Storage group - Navispherecli command ===
a. reference
* How to Create RAID Group and Bind the LUN on CLARiiON?
a. Storage Pool
* Creating a new storage pool on VNX/Clariion
naviseccli -h [SP_IP] storagepool -create -disks [bus_enc_disk] -rtype [raid_type] -name [pool_name]

* Displaying all configured storage pools on a VNX/Clariion
naviseccli -h [SP_IP] storagepool -list
* Expanding an existing storage pool on a VNX/Clariion
naviseccli -h [SP_IP] storagepool -expand -id [pool_id] -disks [bus_enc_disk] -rtype [raid_type]
* Creating a new storage group on a VNX/Clariion
naviseccli -h [SP_IP] storagegroup -create -gname storagegrp_name]

a. LUNs opoeration
* Display information for all LUNs:
naviseccli -h <SP_IP> getlun -uid -rg -type -drivetype -capacity
* Display information for a particular LUN:
naviseccli -h <SP_IP> getlun <CX_lun_ID> -uid -rg -type -drivetype -capacity
* Create LUN from a Raid Group
naviseccli -h <SP_IP> bind <raid_type> <CX_lun_ID> -rg <rg_number> -sp <SP> -sq <size-qualifier> -cap <capacity>
* Creating a LUN from a storage pool on a VNX/Clariion
naviseccli -h [SP_IP] lun -create -type [lun_type] -capacity [capacity] -sq gb -poolID [pool_id] -sp [owning_SP] -l [lun_id] -name “[lun_name]“
* Adding a LUN to an existing storage group on a VNX/Clariion
naviseccli -h [SP_IP] storagegroup -addhlu -gname [storagegrp_name] -hlu [hlu#] -alu [alu#]

a. Host Operation
* Registering a new Host to the VNX/Clariion array
naviseccli -h [SP_IP] storagegroup -setpath -o -hbauid [hba_wwn] -sp [SP] -spport [SP_port] -type [host_type] -ip [host_IP] -host [hostname] -failovermode [failovermode] -arraycommpath [arraycommpath] -unitserialnumber [unitserialnumber]
* Adding a Host to an existing storage group on a VNX/Clariion
naviseccli -h [SP_IP] storagegroup -connecthost -host [hostname] -gname [storagegrp_name]

* SP Reboot and Shutdown GUI
naviseccli ?h <SP_IP_Address> rebootsp
naviseccli ?h <SP_IP_Address> resetandhold

* SP Collects
naviseccli -h <SP_IP_Address> spcollect

* List SP collect files stored on the storage
naviseccli -h <SP_IP_Address> managefiles -retrieve -path <local_path> -file <file_name> -o

-- --
-- --
== Volume Access ==
=== CLARiiON Storage Provisioning ===
=== Provisioning Steps ===
a. Create Storage Pool
* Create RAID groups
- Disk를 RAID-5로 묶고 고정된 size의 LUN들을 각 host에 할당하는 방식
* Create Thin Pools(CX4)
- Pool을 정의해 놓고 그 안에 RAID-5로 구성된 LUN들이 존재한다.
- Host가 storage를 요청하면 meta_data용으로 3G만 할당하고 나머지는 실제
data가 씌여질때만 pool내에서 사용하므로 실제로 사용하지 않는 공간은
다른 host가 사용 가능하다.
- Pool내에 storage 용량 증설이 쉽다. 일반적으로 Raid-5는 최대 16개의
disk만 추가 가능하다.
a. Create LUNs
a. Create Storage Group
* Overview
- 각 host와 storage를 함께 묶어 storage group으로 묶어야 해당 host에서 storage로 접속이 가능하다. Process login을 할때 사용하게 된다.
- Storage Group을 만들때 LUN을 추가해 주는데 이때 HostID를 '0'으로
만들면 host에서 discovery를 못할수 있다.
* Procedure
- Add LUNs
- Connect Hosts

-- --
=== Device Discovery on Solaris ===
a. command
* devfsadm
* /usr/sbin/update_drv -f sd
a. format
: 아래 결과처럼 해당 device가 보여야 한다.
: Storage Group을 만들어줄때 각 LUN들의 hostID가 아래 device 명의 맨
끝자리인 d8, d9, 처럼 출력된다.
: hostID를 0으로 만들게 되면 host에서 discovery가 안되는 경우가 있다.
11. c3t50060169472037B1d8 <DGC-RAID5-0531 cyl 32766 alt 2 hd 32 sec 10>
/pci@1e,600000/lpfc@3,1/fp@0,0/ssd@w50060169472037b1,8
12. c3t50060169472037B1d9 <DGC-RAID5-0531 cyl 40958 alt 2 hd 256 sec 10>
/pci@1e,600000/lpfc@3,1/fp@0,0/ssd@w50060169472037b1,9
13. c3t50060169472037B1d10 <DGC-RAID5-0531 cyl 40958 alt 2 hd 256 sec 10>
/pci@1e,600000/lpfc@3,1/fp@0,0/ssd@w50060169472037b1,a

-- --
=== ===

-- --
-- --