今天梳理资产发现公司还有2台低端HP存储,之前都没写配置记录,记录一下,拿来做测试机用
主要涉及三块配置
1.博科光纤交换机
2.存储配置划分
3.服务器配置
博科交换机配置:
查看交换机基本配置信息:
swd77:root> switchshow
switchName: swd77
switchType: 71.2
switchState: Online
switchMode: Native
switchRole: Principal
switchDomain: 1
switchId: fffc01
switchWwn: 10:00:00:05:1e:bd:ae:f0
zoning: ON (cfg1)
switchBeacon: OFF
Area Port Media Speed State Proto
=====================================
0 0 id N4 Online L-Port 1 public
1 1 id N4 Online L-Port 1 public
2 2 id N4 No_Light
3 3 id N4 Online F-Port 10:00:00:00:c9:82:4e:88 --服务器的wwn号
4 4 id N4 Online L-Port 1 public
5 5 id N4 Online L-Port 1 public
6 6 id N4 No_Light
7 7 id N4 No_Light
8 8 id N4 No_Light
9 9 id N4 No_Light
10 10 id N4 No_Light
11 11 id N4 No_Light
12 12 id N4 No_Light
13 13 id N4 No_Light
14 14 id N4 No_Light
15 15 id N4 No_Light
16 16 id N4 No_Light
17 17 id N4 No_Light
18 18 id N4 No_Light
19 19 id N4 No_Light
20 20 id N4 No_Light
21 21 id N4 No_Light
22 22 id N4 No_Light
23 23 id N4 No_Light
通过portShow查看端口信息,可以看到wwn号,以便后一步进行zone配置
swd77:root> portShow 0
portName:
portHealth: No Fabric Watch License
Authentication: None
portDisableReason: None
portCFlags: 0x1
portFlags: 0x24b03 PRESENT ACTIVE F_PORT L_PORT U_PORT LOGICAL_ONLINE LOGIN NOELP LED ACCEPT FLOGI
portType: 18.0
POD Port: Port is licensed
portState: 1 Online
portPhys: 6 In_Sync
portScn: 32 F_Port
port generation number: 514
portId: 010000
portIfId: 43020017
portWwn: 20:00:00:05:1e:bd:ae:f0
portWwn of device(s) connected:
25:70:00:c0:ff:10:75:85
Distance: normal
portSpeed: N4Gbps
LE domain: 0
FC Fastwrite: OFF
Interrupts: 0 Link_failure: 0 Frjt: 0
Unknown: 9 Loss_of_sync: 29 Fbsy: 0
Lli: 209 Loss_of_sig: 32 Lip_in: 19
Proc_rqrd: 5149956 Protocol_err: 0 Lip_out: 25
Timed_out: 0 Invalid_word: 324814 Lip_Freq_Cnt: 0
Rx_flushed: 0 Invalid_crc: 0
Tx_unavail: 0 Delim_err: 0
Free_buffer: 0 Address_err: 0
Overrun: 0 Lr_in: 20
Suspended: 0 Lr_out: 16
Parity_err: 0 Ols_in: 15
2_parity_err: 0 Ols_out: 20
CMI_bus_err: 0
Port part of other ADs: No
禁用之前的配置
以下配置可以在web界面,也可以命令行界面
cfgdisable cfgname
如果有之前的alias,zone,cfg,用相应的命令 alias|zone|cfgdelete 删除之,这里注意一定先disable,否则所有操作都还在flash里面,重连还是会看到原来的配置
新建alias,zone,cfg
alicreate msa2012fc_172_16_3_195,"20:70:00:c0:ff:d7:08:c0;20:78:00:c0:ff:d7:08:c0"
alicreate msa2312fc_172_16_3_180,"25:70:00:c0:ff:10:75:85;21:70:00:c0:ff:10:75:85"
zonecreate z1, "host_172_16_3_174;msa2012fc_172_16_3_195;msa2312fc_172_16_3_180"
cfgcreate cfg1,"z1"
cfgenable cfg1
cfgsave
查看下配置完的信息:
root> cfgshow
Defined configuration:
cfg: cfg1 z1
zone: z1 host_172_16_3_174; msa2012fc_172_16_3_195;
msa2312fc_172_16_3_180
alias: host_172_16_3_174
10:00:00:00:c9:82:4e:88
alias: msa2012fc_172_16_3_195
20:70:00:c0:ff:d7:08:c0; 20:78:00:c0:ff:d7:08:c0
alias: msa2312fc_172_16_3_180
25:70:00:c0:ff:10:75:85; 21:70:00:c0:ff:10:75:85
Effective configuration:
cfg: cfg1
zone: z1 10:00:00:00:c9:82:4e:88
20:70:00:c0:ff:d7:08:c0
20:78:00:c0:ff:d7:08:c0
25:70:00:c0:ff:10:75:85
21:70:00:c0:ff:10:75:85
这里是把195的两个光纤口,180的两个光纤口,服务器的一快光纤卡加到一个zone里
存储配置划分:
清理之前划分的信息:
# show disks
ID Serial# Vendor Rev. State Type Size(GB) Rate(Gb/s) SP
------------------------------------------------------------------------------
0 3QP0CY6L000099130ART SEAGATE 0004 AVAIL SAS 300 3.0
1 JTY13ADJ HITACHI A5D0 AVAIL SAS 300 3.0
2 6SJ1BSD40000N139AW2Q SEAGATE 0008 AVAIL SAS 300 3.0
3 6SJ33GFJ0000N205BJUY SEAGATE 0008 AVAIL SAS 300 3.0
4 3LM5T1XM000099091LVA SEAGATE 0002 AVAIL SAS 300 3.0
6 JLX4GU3C HITACHI A570 AVAIL SAS 300 3.0
7 3QP0F2730000991309J0 SEAGATE 0004 AVAIL SAS 300 3.0
8 3QP0H4WE00009917FV0C SEAGATE 0004 AVAIL SAS 300 3.0
------------------------------------------------------------------------------
清理磁盘元数据
# clear disk-metadata 0,1,2,3,4,6,7,8
查看vdisk并删除
# show vd
Name Size Free Own RAID Dsk Spr Chk Stat Jobs Serial#
--------------------------------------------------------------------------------------------------------------
vd02 1198.7GB 732.8MB B RAID5 5 0 64 QTOF 00c0ff106a630000449df84c00000000
vd01 2099.8GB 881.5MB A RAID5 8 0 64 CRIT 00c0ffd70bed0000f715f94c00000000
# delete vdisk vd01
# delete vdisk vd02
清理之后,新建vd,volumes,map volume,这一步可以在web界面操作,也可以命令行
create volume vdisk vd01 size 500GB mapping 0-1.12 vd01vol01
create host-wwn-name wwn 10000000C9824E88 172_16_3_174
map volume access rw lun 1 host 172_16_3_174 vd01vol01
map volume access rw lun 2 host 172_16_3_174 vd01vol02
通过以下命令查看信息
# show hosts
Host ID Name Discovered Mapped Profile
-------------------------------------------------
10000000C9824E88 Yes Yes Standard --这台是服务器光纤卡的id,已经发现并映射
21FD00051EBDAEF0 Yes No Standard
21FD00051ED93251 Yes No Standard
#show host-maps
Host [WWN 10000000C9824E88, Name (172_16_3_174)] Mapping View:
Volume Name Volume SN ID LUN Access Channels
----------------------------------------------------------------------------
vd01vol01 00c0ffd70bed0000c8f73f5801000000 0 1 rw 0,1
vd01vol02 00c0ffd70bed0000f8f73f5801000000 0 2 rw 0,1
#show volume-maps
Volume [SN 00c0ffd70bed0000c8f73f5801000000, Name (vd01vol01)] mapping view:
CH ID LUN Access Host-Port-Identifier Nickname
-------------------------------------------------------------------------------
0,1 0 1 rw 10000000C9824E88 172_16_3_174
Volume [SN 00c0ffd70bed0000f8f73f5801000000, Name (vd01vol02)] mapping view:
CH ID LUN Access Host-Port-Identifier Nickname
-------------------------------------------------------------------------------
0,1 0 2 rw 10000000C9824E88 172_16_3_174
已经将vd01vol01,vd01vol02都映射给172_16_3_174
这里存储只写了一台的配置,另外一台同理
服务器端配置:
查看fc,这里如果是两块光纤卡,可以做多路径,之前的存储映射也要映射到多块卡,这里我只有host2一块
#cat /sys/class/fc_host/host2/port_name
0x10000000c9824e88
fdisk -l 看不到映射的存储
重新扫描
find /sys/class/scsi_host/host*/scan | while read line; do echo - - - > $line; done
cat /proc/partitions | awk '{print $4}' |grep sd
sda
sdb
可以看到新加的设备了