DS8K儲存分配空間給主機方案

liaowenyong發表於2017-11-10

環境IBM DS8K + SAN192 + Redhat6.1+Multipath軟體

分為三大步,先劃zone,後劃儲存,最後在主機端繫結多路徑

一.劃zone
為了以後透過tsm備份,將手機POS與DS8700,TS3500都劃zone,同時為了保證生產安全,兩臺交換機分別劃zone。

1.連線到SAN384交換機,備份原來的config
本機IP設定為10.77.77.88/255.255.255.0

telnet 10.77.77.77
使用者名稱:admin  密碼:xxxx

交換機1備份檔名:config-san.txt
交換機2的備份檔名:config-san2.txt

IBM_2499_192:FID128:admin> configupload
Protocol (scp, ftp, local) [ftp]: ftp
Server Name or IP Address [host]: 10.77.77.88
User Name [user]: ftp
Path/Filename [<home dir>/config.txt]: /upload/config-san.txt
Section (all|chassis|FID# [all]): all
Password:

configUpload complete: All selected config parameters are uploaded

2.手機pos劃zone
(1)交換機1實施
zonecreate "MPOS_SW1_GZDS8K" "1,2; 1,3; 1,4; 1,5; 1,6; 1,7; 1,8; 1,9; 2,0; 2,1; 2,2; 2,3"
@linlf -- 後面這四個2是什麼意義?2 --表示SAN交換機的domain

--註釋:
1 --表示Domain
0 --連磁帶庫
2 --表示domain
1,2; 1,3;...1,9 -- 儲存連線SAN交換機的PortIndex(switchshow檢視到的Portindex,不是Port)
2,0;2,1;2,2;2,3; -- 新上主機連線SAN交換機的Port


zonecreate "TS35a_MPOS1_R1","1,0;2,1"
zonecreate "TS35a_MPOS2_R1","1,0;2,3"

zonecreate "TS35b_MPOS1_R1","1,1;2,1"
zonecreate "TS35b_MPOS2_R1","1,1;2,3"

cfgadd "TYZF_SW1","MPOS_SW1_GZDS8K"
cfgadd "TYZF_SW1","TS35a_MPOS1_R1"
cfgadd "TYZF_SW1","TS35a_MPOS2_R1"
cfgadd "TYZF_SW1","TS35b_MPOS1_R1"
cfgadd "TYZF_SW1","TS35b_MPOS2_R1"

配置完成後,儲存並且enable
cfgsave
cfgenable "TYZF_SW1"

查詢狀態是否正常
switchshow
查詢是否是online,各個口是否已經連線

(2)交換機2實施
zonecreate "MPOS_SW2_GZDS8K" "1,2; 1,3; 1,4; 1,5; 1,6; 1,7; 1,8; 1,9; 2,0; 2,1; 2,2; 2,3"

zonecreate "TS35c_MPOS1_L2","1,0;2,1"
zonecreate "TS35c_MPOS2_L2","1,0;2,3"

zonecreate "TS35d_MPOS1_L2","1,1;2,1"
zonecreate "TS35d_MPOS2_L2","1,1;2,3"

cfgadd "TYZF_SW2","MPOS_SW2_GZDS8K"
cfgadd "TYZF_SW2","TS35c_MPOS1_L2"
cfgadd "TYZF_SW2","TS35c_MPOS2_L2"
cfgadd "TYZF_SW2","TS35d_MPOS1_L2"
cfgadd "TYZF_SW2","TS35d_MPOS2_L2"

配置完成後,enable
cfgsave
cfgenable "TYZF_SW2"

查詢狀態是否正常
switchshow
查詢是否是online,各個口是否已經連線

 

3.回退方案

恢復配置檔案
admin>switchdisable
admin>configdownload

按照提示輸入使用者名稱,及備份檔名
config-san.txt

admin>switchenable

admin>switchshow
查詢是否是online,各個口是否已經連線
@linlf One by one

二.在DS8700根據手機pos的主機HBA卡的wwid號建立group,新劃的lun對映到這個group

(1)登入到DS8700

兩臺控制器的ip分別是172.16.0.3和172.17.0.4

主機ip透過自動DHCP方式連通DS8700陣列,然後再查到陣列管理IP,供下面登入使用(ping 172.17.0.4)

用客戶端軟體進入控制檯,然後輸入命令>dscli,會彈出
dscli>
C:\Program Files\IBM\dscli>dscli
Enter the primary management console IP address:172.17.0.4

使用者名稱:admin 密碼:xxx

(2)建立volumegroup

mkvolgrp -type scsimap256 mpos
--反向操作:rmvolgrp v9

查詢新建立的volume group
dscli> lsvolgrp
新建的volume group的ID應該是v9

(3)劃lun

共需要劃5個200G的lun,4個5G的lun(具體劃分到哪個extpool裡待定)
DS8700共有P0-P7,8個extent pool
剩餘空間如下:
Name   ID stgtype rankgrp status availstor (2^30B) %allocated available reserved numvols
========================================================================================
ext_P0 P0 fb            0  below              1199         62      1199        0      14
ext_P1 P1 fb            1  below              1199         62      1199        0      14
ext_P2 P2 fb            0  below              1199         62      1199        0      14
ext_P3 P3 fb            1  below              1149         64      1149        0      24
ext_P4 P4 fb            0  below              1732         53      1732        0      14
ext_P5 P5 fb            1  below              1732         53      1732        0      14
ext_P6 P6 fb            0  below              1732         53      1732        0      14
ext_P7 P7 fb            1  below              1732         53      1732        0      14

根據分散IO的原則從P3-P7分別劃一個200G的lun,從P4-P7分別劃一個5G的lun
根據之前的命名規則,以及vol的順序

mkfbvol -extpool P3 -cap 200 -name vol_#h 1321
mkfbvol -extpool P4 -cap 200 -name vol_#h 1417
mkfbvol -extpool P5 -cap 200 -name vol_#h 1514
mkfbvol -extpool P6 -cap 200 -name vol_#h 1614
mkfbvol -extpool P7 -cap 200 -name vol_#h 1714

mkfbvol -extpool P4 -cap 5 -name vol_#h 1418
mkfbvol -extpool P5 -cap 5 -name vol_#h 1515
mkfbvol -extpool P6 -cap 5 -name vol_#h 1615
mkfbvol -extpool P7 -cap 5 -name vol_#h 1715

--反向操作:rmfbvol -safe 1321
           rmfbvol -safe 1417
           rmfbvol -safe 1514
           rmfbvol -safe 1614
           rmfbvol -safe 1714
          
           rmfbvol -safe 1418
           rmfbvol -safe 1515
           rmfbvol -safe 1615
           rmfbvol -safe 1715

在P3-P7的POOL裡劃分了1321,1417,1514,1614,1714共5個200G的lun
在P4-P7的POOL裡劃分了1418,1515,1615,1715共4個5G的lun

 

(4)將lun對映到主機的group

chvolgrp -action add -volume 1321,1417,1514,1614,1714,1418,1515,1615,1715 v9
--反向操作:chvolgrp -action remove -volume 1321,1417,1514,1614,1714,1418,1515,1615,1715 v9

建立陣列與主機的Map連線。    
mkhostconnect -wwname 21000024ff50ce3c  -profile "Intel - Linux RHEL" -volgrp v9 -ioport all mpos1_fc0
mkhostconnect -wwname 21000024ff50ce3d  -profile "Intel - Linux RHEL" -volgrp v9 -ioport all mpos1_fc1
mkhostconnect -wwname 21000024ff50c9dc  -profile "Intel - Linux RHEL" -volgrp v9 -ioport all mpos1_fc2 
mkhostconnect -wwname 21000024ff50c9dd  -profile "Intel - Linux RHEL" -volgrp v9 -ioport all mpos1_fc3

mkhostconnect -wwname 21000024ff50cada  -profile "Intel - Linux RHEL" -volgrp v9 -ioport all mpos2_fc0
mkhostconnect -wwname 21000024ff50cadb  -profile "Intel - Linux RHEL" -volgrp v9 -ioport all mpos2_fc1
mkhostconnect -wwname 21000024ff50cb78  -profile "Intel - Linux RHEL" -volgrp v9 -ioport all mpos2_fc2 
mkhostconnect -wwname 21000024ff50cb79  -profile "Intel - Linux RHEL" -volgrp v9 -ioport all mpos2_fc3 

--反向操作:lshostconnect -volgrp v9獲取host_connect_id
            rmhostconnect <host_connect_id>
           

檢視v9對映的lun
showvolgrp v9

三.繫結多路徑
1.安裝multipath,及生成/etc/multipath.conf檔案

#fdisk -l | grep sd檢視硬碟,對於linux並不能看到新增的儲存裝置,需要重啟主機
利用scsi_id -g -u看檢視新劃的lun的wwid號

#yum install device-mapper-multipath.x86_64

生成multipath.conf檔案
#cp /usr/share/doc/device-mapper-multipath-0.4.9/multipath.conf /etc/multipath.conf

2.配置/etc/multipath.conf檔案

根據查詢到的wwid號配置/etc/multipath.conf檔案,並且根據生產上別的主機的/etc/multipath.conf檔案編輯
blacklist_exceptions {
                devnode "^(sd)[b-z]"
                devnode "^(dm-)[0-9]"
}

defaults {
        user_friendly_names yes
        path_grouping_policy    group_by_prio
        features                "1 queue_if_no_path"
        path_checker            tur
}

multipaths {

        multipath {
                wwid            <wwid>
                alias           mpathdsk1
        }
        multipath {
                wwid            <wwid>
                alias           mpathdsk2
        }
        multipath {
                wwid            <wwid>
                alias           mpathdsk3
        }
        multipath {
                wwid            <wwid>
                alias           mpathdsk4
        }
        multipath {
                wwid            <wwid>
                alias           mpathdsk5
        }
        multipath {
                wwid            <wwid>
                alias           crsdsk1
        }
        multipath {
                wwid            <wwid>
                alias           crsdsk2
        }
        multipath {
                wwid            <wwid>
                alias           crsdsk3
        }
        multipath {
                wwid            <wwid>
                alias           crsdsk4
        }
}

配置完/etc/multipath.conf

#/etc/init.d/multipathd start,
#multipath –ll命令查詢多路徑盤,並重啟伺服器,確定伺服器沒問題

#ll /dev/mapper/檢視該路徑下的多路徑盤


磁碟裸裝置繫結,資料庫安裝工作由整合商完成.

 

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31382115/viewspace-2147070/,如需轉載,請註明出處,否則將追究法律責任。

相關文章