简体中文版经机器翻译而成,仅供参考。如与英语版出现任何冲突,应以英语版为准。

将 Linux iSCSI 主机从 MetroCluster FC 移动到 MetroCluster IP 节点

提供者

将 MetroCluster 节点从 FC 过渡到 IP 后,您可能需要将 iSCSI 主机连接移动到新节点。

在此过程中,系统将创建操作步骤 IPv4 接口。

这些过程中提供的主机命令和示例专用于 Linux 操作系统。

设置新的 iSCSI 连接

要移动 iSCSI 连接,您必须设置与 MetroCluster IP 节点的新 iSCSI 连接。

  1. 在 MetroCluster IP 节点上创建 iSCSI 接口,并检查从 iSCSI 客户端到 MetroCluster IP 节点上新 IP 接口的 ping 连接。

    iSCSI 客户端应可访问 SVM 中的所有 iSCSI 接口。

  2. 在 iSCSI 主机或客户端上,确定从主机到 MetroCluster FC 节点的现有 iSCSI 连接: iscsiadm -m session

    [root@scspr1789621001 ~]# iscsiadm -m session
    
    tcp: [1] 10.230.68.236:3260,1156 iqn.1992-08.com.netapp:sn.58d7f6df2cc611eaa9c500a098a71638:vs.6 (non-flash)
    
    tcp: [2] 10.230.68.237:3260,1158 iqn.1992-08.com.netapp:sn.58d7f6df2cc611eaa9c500a098a71638:vs.6 (non-flash)
  3. 验证 MetroCluster IP 节点的连接: iscsi session show -vserver svm-name

    node_A_1-IP::*> iscsi session show -vserver vsa_1
    
     Tpgroup Initiator Initiator
    
    Vserver Name TSIH Name ISID Alias
    --------- ------- ---- ------------------------ --------- ---------------------
    vsa_1 iscsi_lf__n1_p1_ 4 iqn.2020-01.com.netapp.englab.gdl:scspr1789621001 00:02:3d:00:00:01 scspr1789621001.gdl.englab.netapp.com
    vsa_1 iscsi_lf__n2_p1_ 4 iqn.2020-01.com.netapp.englab.gdl:scspr1789621001 00:02:3d:00:00:02 scspr1789621001.gdl.englab.netapp.com
    
    2 entries were displayed.
  4. 在ONTAP中列出包含这些接口的SVM的iSCSI接口: iscsi interface show -vserver svm-name

    sti8200mcchtp001htp_siteA::*> iscsi interface show -vserver vsa_1
    
     Logical Status Curr Curr
    
    Vserver    Interface  TPGT Admin/Oper IP Address Node Port Enabled
    ---------- ---------- ---- ---------- --------------- ----------- ---- -------
    
    vsa_1 iscsi_lf__n1_p1_ 1156 up/up 10.230.68.236 sti8200mcc-htp-001 e0g true
    vsa_1 iscsi_lf__n1_p2_ 1157 up/up fd20:8b1e:b255:805e::78c9 sti8200mcc-htp-001 e0h true
    vsa_1 iscsi_lf__n2_p1_ 1158 up/up 10.230.68.237 sti8200mcc-htp-002 e0g true
    vsa_1 iscsi_lf__n2_p2_ 1159 up/up fd20:8b1e:b255:805e::78ca sti8200mcc-htp-002 e0h true
    vsa_1 iscsi_lf__n3_p1_ 1183 up/up 10.226.43.134 sti8200mccip-htp-005 e0c true
    vsa_1 iscsi_lf__n4_p1_ 1188 up/up 10.226.43.142 sti8200mccip-htp-006 e0c true
    
    6 entries were displayed.
  5. 在 iSCSI 客户端上,对 SVM 上的任一 iSCSI IP 地址运行发现以发现新目标: iscsiadm -m discovery -t sendtargets -p iscsi-ip-address

    发现可以在 SVM 的任何 IP 地址上运行,包括非 iSCSI 接口。

    [root@scspr1789621001 ~]# iscsiadm -m discovery -t sendtargets -p 10.230.68.236:3260
    
    10.230.68.236:3260,1156 iqn.1992-08.com.netapp:sn.58d7f6df2cc611eaa9c500a098a71638:vs.6
    10.226.43.142:3260,1188 iqn.1992-08.com.netapp:sn.58d7f6df2cc611eaa9c500a098a71638:vs.6
    10.226.43.134:3260,1183 iqn.1992-08.com.netapp:sn.58d7f6df2cc611eaa9c500a098a71638:vs.6
    10.230.68.237:3260,1158 iqn.1992-08.com.netapp:sn.58d7f6df2cc611eaa9c500a098a71638:vs.6
  6. 在 iSCSI 客户端上,登录到所有已发现的地址: iscsiadm -m node -L all -T node-address -p portal-address -l

    [root@scspr1789621001 ~]# iscsiadm -m node -L all -T iqn.1992-08.com.netapp:sn.58d7f6df2cc611eaa9c500a098a71638:vs.6 -p 10.230.68.236:3260 -l
    
    Logging in to [iface: default, target: iqn.1992-08.com.netapp:sn.58d7f6df2cc611eaa9c500a098a71638:vs.6, portal: 10.226.43.142,3260] (multiple)
    Logging in to [iface: default, target: iqn.1992-08.com.netapp:sn.58d7f6df2cc611eaa9c500a098a71638:vs.6, portal: 10.226.43.134,3260] (multiple)
    Login to [iface: default, target: iqn.1992-08.com.netapp:sn.58d7f6df2cc611eaa9c500a098a71638:vs.6, portal: 10.226.43.142,3260] successful.
    Login to [iface: default, target: iqn.1992-08.com.netapp:sn.58d7f6df2cc611eaa9c500a098a71638:vs.6, portal: 10.226.43.134,3260] successful.
  7. 在 iSCSI 客户端上,验证登录和连接: iscsiadm -m session

    [root@scspr1789621001 ~]# iscsiadm -m session
    
    tcp: [1] 10.230.68.236:3260,1156 iqn.1992-08.com.netapp:sn.58d7f6df2cc611eaa9c500a098a71638:vs.6 (non-flash)
    tcp: [2] 10.230.68.237:3260,1158 iqn.1992-08.com.netapp:sn.58d7f6df2cc611eaa9c500a098a71638:vs.6 (non-flash)
    tcp: [3] 10.226.43.142:3260,1188 iqn.1992-08.com.netapp:sn.58d7f6df2cc611eaa9c500a098a71638:vs.6 (non-flash)
  8. 从 MetroCluster 节点上,验证登录情况以及与客户端的连接: iscsi initiator show -vserver vsa_1

    sti8200mcchtp001htp_siteA::*> iscsi initiator show -vserver vsa_1
    
     Tpgroup Initiator
    
    Vserver Name             TSIH Name                  ISID              Igroup Name
    ------- --------         ---- --------------------- ----------------- -----------------
    vsa_1 iscsi_lf__n1_p1_ 4 iqn.2020-01.com.netapp.englab.gdl:scspr1789621001 00:02:3d:00:00:01 igroup_linux
    vsa_1 iscsi_lf__n2_p1_ 4 iqn.2020-01.com.netapp.englab.gdl:scspr1789621001 00:02:3d:00:00:02 igroup_linux
    vsa_1 iscsi_lf__n3_p1_ 1 iqn.2020-01.com.netapp.englab.gdl:scspr1789621001 00:02:3d:00:00:04 igroup_linux
    vsa_1 iscsi_lf__n4_p1_ 1 iqn.2020-01.com.netapp.englab.gdl:scspr1789621001 00:02:3d:00:00:03 igroup_linux
    
    4 entries were displayed.

完成此任务后,客户端可以查看所有 iSCSI 接口(位于 MetroCluster FC 和 MetroCluster IP 节点上),并登录到所有这些接口。

LUN 和卷仍以物理方式托管在 FC 节点上。由于 LUN 仅在 MetroCluster FC 节点接口上报告,因此客户端将仅显示 MetroCluster FC 节点上的路径。在 sanlun lun show -p 和 multipath -ll -d 命令输出中可以看到这种情况。下一步是将 IP 节点添加为报告节点。

[root@scspr1789621001 ~]# sanlun lun show -p
ONTAP Path: vsa_1:/vol/vsa_1_vol6/lun_linux_12
 LUN: 4
 LUN Size: 2g
 Product: cDOT
 Host Device: 3600a098038304646513f4f674e52774b
 Multipath Policy: service-time 0
 Multipath Provider: Native
--------- ---------- ------- ------------ ----------------------------------------------
host vserver
path path /dev/ host vserver
state     type       node     adapter     LIF
--------- ---------- ------- ------------ ----------------------------------------------
up        primary    sdk     host3        iscsi_lf__n2_p1_
up        secondary  sdh     host2        iscsi_lf__n1_p1_

[root@scspr1789621001 ~]# multipath -ll -d
3600a098038304646513f4f674e52774b dm-5 NETAPP ,LUN C-Mode
size=2.0G features='4 queue_if_no_path pg_init_retries 50 retain_attached_hw_handle' hwhandler='1 alua' wp=rw
|-+- policy='service-time 0' prio=50 status=active
| `- 3:0:0:4 sdk 8:160 active ready running
`-+- policy='service-time 0' prio=10 status=enabled
 `- 2:0:0:4 sdh 8:112 active ready running

将 MetroCluster IP 节点添加为报告节点

设置与新 MetroCluster IP 节点的连接后,必须添加新的报告节点。

  1. 在 MetroCluster 节点上,列出 SVM 上 LUN 的报告节点: lun mapping show -vserver vsa_1 -fields reporting-nodes -ostype linux

    以下报告节点是本地节点,因为 LUN 实际位于 FC 节点 node_A_1-FC 和 node_A_2-FC 上。

    node_A_1-IP::*> lun mapping show -vserver vsa_1 -fields reporting-nodes -ostype linux
    
    vserver path igroup reporting-nodes
    ------- --------------------------- ------------ -------------------------------------
    vsa_1 /vol/vsa_1_vol1/lun_linux_2 igroup_linux node_A_1-FC,node_A_2-FC
    .
    .
    .
    vsa_1 /vol/vsa_1_vol9/lun_linux_19 igroup_linux node_A_1-FC,node_A_2-FC
    12 entries were displayed.
  2. 在 MetroCluster 节点上,添加报告节点: lun mapping add-reporting-nodes -vserver svm-name -path /vol/vsa_1_vol* /lun_linux_* -nodes node1 , node2 -igroup igroup_linux

    node_A_1-IP::*> lun mapping add-reporting-nodes -vserver vsa_1 -path /vol/vsa_1_vol*/lun_linux_* -nodes node_A_1-IP,node_A_2-IP
    -igroup igroup_linux
    
    12 entries were acted on.
  3. 在 MetroCluster 节点上,验证新添加的节点是否存在: lun mapping show -vserver svm-name -fields reporting-nodes -ostype linux vserver path igroup reporting-nodes

    node_A_1-IP::*> lun mapping show -vserver vsa_1 -fields reporting-nodes -ostype linux vserver path igroup reporting-nodes
    ------- --------------------------- ------------ -------------------------------------------------------------------------------
    
    vsa_1 /vol/vsa_1_vol1/lun_linux_2 igroup_linux node_A_1-FC,node_A_2-FC,node_A_1-IP,node_A_2-IP
    vsa_1 /vol/vsa_1_vol1/lun_linux_3 igroup_linux node_A_1-FC,node_A_2-FC,node_A_1-IP,node_A_2-IP.
    .
    .
    .
    
    12 entries were displayed.
  4. 验证是否已 sg3-utils 软件包安装在Linux主机上。这样可以避免 rescan-scsi-bus.sh utility not found 使用重新扫描Linux主机以查找新映射的LUN时出错 rescan-scsi-bus 命令:

  5. 在主机上、问题描述执行以下命令以重新扫描主机上的SCSI总线并发现新添加的路径: /usr/bin/rescan-scsi-bus.sh -a

    [root@stemgr]# /usr/bin/rescan-scsi-bus.sh -a
    Scanning SCSI subsystem for new devices
    Scanning host 0 for SCSI target IDs 0 1 2 3 4 5 6 7, all LUNs
    Scanning host 1 for SCSI target IDs 0 1 2 3 4 5 6 7, all LUNs
    Scanning host 2 for SCSI target IDs 0 1 2 3 4 5 6 7, all LUNs
     Scanning for device 2 0 0 0 ...
    .
    .
    .
    OLD: Host: scsi5 Channel: 00 Id: 00 Lun: 09
     Vendor: NETAPP Model: LUN C-Mode Rev: 9800
     Type: Direct-Access ANSI SCSI revision: 05
    0 new or changed device(s) found.
    0 remapped or resized device(s) found.
    0 device(s) removed.
  6. 在主机上,问题描述以下命令以列出新添加的路径: sanlun lun show -p

    每个 LUN 显示四个路径。

    [root@stemgr]# sanlun lun show -p
    ONTAP Path: vsa_1:/vol/vsa_1_vol6/lun_linux_12
     LUN: 4
     LUN Size: 2g
     Product: cDOT
     Host Device: 3600a098038304646513f4f674e52774b
     Multipath Policy: service-time 0
     Multipath Provider: Native
    --------- ---------- ------- ------------ ----------------------------------------------
    host vserver
    path path /dev/ host vserver
    state type node adapter LIF
    --------- ---------- ------- ------------ ----------------------------------------------
    up primary sdk host3 iscsi_lf__n2_p1_
    up secondary sdh host2 iscsi_lf__n1_p1_
    up secondary sdag host4 iscsi_lf__n4_p1_
    up secondary sdah host5 iscsi_lf__n3_p1_
  7. 在 MetroCluster 上,将包含 LUN 的卷从 FC 移动到 IP 节点。

    node_A_1-IP::*> vol move start -vserver vsa_1 -volume vsa_1_vol1 -destination-aggregate sti8200mccip_htp_005_aggr1
    [Job 1877] Job is queued: Move "vsa_1_vol1" in Vserver "vsa_1" to aggregate "sti8200mccip_htp_005_aggr1". Use the "volume move show -vserver
    vsa_1 -volume vsa_1_vol1" command to view the status of this operation.
    node_A_1-IP::*> vol move show
    Vserver    Volume     State       Move       Phase            Percent-Complete  Time-To-Complete
    ---------  ---------- --------    ---------- ---------------- ----------------  ----------------
    vsa_1     vsa_1_vol1  healthy                initializing     -                 -
  8. 卷移动完成后,在 MetroCluster 上使用 volume show 命令确认卷或 LUN 已联机。

  9. LUN 现在所在的 MetroCluster IP 节点上的 iSCSI 接口将更新为主路径。如果在卷移动后未更新主路径,请运行 /usr/bin/rescan-scsi-bus.sh -a 和 multipath -v3 ,或者等待多路径重新扫描发生。

    在以下示例中,主路径是 MetroCluster IP 节点上的 LIF 。

    [root@stemgr]# sanlun lun show -p
    ONTAP Path: vsa_1:/vol/vsa_1_vol6/lun_linux_12
     LUN: 4
     LUN Size: 2g
     Product: cDOT
     Host Device: 3600a098038304646513f4f674e52774b
     Multipath Policy: service-time 0
     Multipath Provider: Native
    --------- ---------- ------- ------------ -----------------------
    host vserver
    path path /dev/ host vserver
    state     type       node    adapter      LIF
    --------- ---------- ------- ------------ ------------------------
    up        primary    sdag    host4        iscsi_lf__n4_p1_
    up        secondary  sdk     host3        iscsi_lf__n2_p1_
    up        secondary  sdh     host2        iscsi_lf__n1_p1_
    up        secondary  sdah    host5        iscsi_lf__n3_p1_

删除报告节点并重新扫描路径

您必须删除报告节点并重新扫描路径。

  1. 从 MetroCluster IP 节点中,删除 Linux LUN 的远程报告节点( MetroCluster IP 节点): lun mapping remove-reporting-nodes -vserver vsa_1 -path * -igroup igroup_linux -remote-nodes true

    在这种情况下,远程节点为 FC 节点。

    node_A_1-IP::*> lun mapping remove-reporting-nodes -vserver vsa_1 -path * -igroup igroup_linux -remote-nodes true
    
    12 entries were acted on.
  2. 从 MetroCluster IP 节点中,检查 LUN 的报告节点: lun mapping show -vserver vsa_1 -fields reporting-nodes -ostype linux

    node_A_1-IP::*> lun mapping show -vserver vsa_1 -fields reporting-nodes -ostype linux
    
    vserver  path                        igroup      reporting-nodes
    ------- --------------------------- ------------ -----------------------------------------
    
    vsa_1 /vol/vsa_1_vol1/lun_linux_2   igroup_linux  node_A_1-IP,node_A_2-IP
    vsa_1 /vol/vsa_1_vol1/lun_linux_3   igroup_linux  node_A_1-IP,node_A_2-IP
    vsa_1 /vol/vsa_1_vol2/lun_linux_4   group_linux   node_A_1-IP,node_A_2-IP
    .
    .
    .
    
    12 entries were displayed.
  3. 验证是否已 sg3-utils 软件包安装在Linux主机上。这样可以避免 rescan-scsi-bus.sh utility not found 使用重新扫描Linux主机以查找新映射的LUN时出错 rescan-scsi-bus 命令:

  4. 在iSCSI主机上、重新扫描SCSI总线: /usr/bin/rescan-scsi-bus.sh -r

    删除的路径是 FC 节点的路径。

    [root@scspr1789621001 ~]# /usr/bin/rescan-scsi-bus.sh -r
    Syncing file systems
    Scanning SCSI subsystem for new devices and remove devices that have disappeared
    Scanning host 0 for SCSI target IDs 0 1 2 3 4 5 6 7, all LUNs
    Scanning host 1 for SCSI target IDs 0 1 2 3 4 5 6 7, all LUNs
    Scanning host 2 for SCSI target IDs 0 1 2 3 4 5 6 7, all LUNs
    sg0 changed: LU not available (PQual 1)
    REM: Host: scsi2 Channel: 00 Id: 00 Lun: 00
    DEL: Vendor: NETAPP Model: LUN C-Mode Rev: 9800
     Type: Direct-Access ANSI SCSI revision: 05
    sg2 changed: LU not available (PQual 1)
    .
    .
    .
    OLD: Host: scsi5 Channel: 00 Id: 00 Lun: 09
     Vendor: NETAPP Model: LUN C-Mode Rev: 9800
     Type: Direct-Access ANSI SCSI revision: 05
    0 new or changed device(s) found.
    0 remapped or resized device(s) found.
    24 device(s) removed.
     [2:0:0:0]
     [2:0:0:1]
     .
    .
    .
  5. 在iSCSI主机上、验证是否仅显示MetroCluster IP节点的路径:

    sanlun lun show -p

    multipath -ll -d