This section describes the procedure to delete the iSCSI devices used for the mirroring among servers.
Perform this procedure after deleting iSCSI devices to be deleted from a class of GDS and the resource database of PRIMECLUSTER.
For details, refer to the steps "Change the device names set in resources of the shared disk device" and "Delete resources of the shared disk device" in the procedure "Deleting a shared disk device" described in "PRIMECLUSTER Installation and Administration Guide."
The procedures are different depending on OS version.
[RHEL6]
Confirm LUN to be deleted on any node.
# iscsiadm -m session -P 3
[Execution example]
# iscsiadm -m session -P 3
iSCSI Transport Class version xxxxxxxx
version xxxxxxxx
Target: target-0201
Current Portal: 192.168.56.10:3260,1
Persistent Portal: 192.168.56.10:3260,1
**********
Interface:
**********
...
iSCSI Connection State: LOGGED IN
iSCSI Session State: LOGGED_IN
Internal iscsid Session State: NO CHANGE
...
************************
Attached SCSI devices:
************************
Host Number: 12 State: running
scsi12 Channel 00 Id 0 Lun: 0
scsi12 Channel 00 Id 0 Lun: 1
Attached scsi disk sdd State: running
...
Target: target-0101 (*1)
Current Portal: 192.168.56.20:3260,1
Persistent Portal: 192.168.56.20:3260,1
**********
Interface:
**********
...
iSCSI Connection State: LOGGED IN
iSCSI Session State: LOGGED_IN
Internal iscsid Session State: NO CHANGE
...
************************
Attached SCSI devices:
************************
Host Number: 13 State: running
scsi13 Channel 00 Id 0 Lun: 0
scsi13 Channel 00 Id 0 Lun: 1 (*2)
Attached scsi disk sde State: running (*3)
...
In the example, when deleting sde of (*3), LUN1 of (*2) is deleted in the target name "target-0101" of (*1).
Modify the /etc/tgt/targets.conf file on a node where the setting of LUN is to be deleted.
Delete the setting of LUN that the LUN number is 1.
[Example before changing]
<target target-0101> initiator-address 192.168.56.20 initiator-address 192.168.56.10 write-cache off <backing-store /dev/disk/by-id/scsi-3500000e114784363>
lun 1
scsi_id SDX01
</backing-store> <backing-store /dev/disk/by-id/scsi-3500000e111c56611> lun 2 scsi_id SDX02 </backing-store> </target>
[Example after changing]
<target target-0101> initiator-address 192.168.56.20 initiator-address 192.168.56.10 write-cache off <backing-store /dev/disk/by-id/scsi-3500000e111c56611> lun 2 scsi_id SDX02 </backing-store> </target>
Stop iSCSI devices to be deleted on both node.
# echo offline > /sys/block/iSCSI_device_name/device/state
[Execution example]
# echo offline > /sys/block/sde/device/state
Delete iSCSI devices to be deleted on both nodes.
# echo 1 > /sys/block/iSCSI_device_name/device/delete
[Execution example]
# echo 1 > /sys/block/sde/device/delete
Confirm the target ID on a node where the setting of LUN is to be deleted.
The following shows that the target ID of the target name "target-0101" is 1.
# tgt-admin --show
Target 1: target-0101
...
Delete LUN on a node where the setting of LUN is to be deleted.
# tgtadm --lld iscsi --op delete --mode logicalunit --tid targetID --lun LUN
Point
Specify the target ID to targetID.
Specify the LUN number to LUN.
[Execution example]
# tgtadm --lld iscsi --op delete --mode logicalunit --tid 1 --lun 1
Confirm that LUN was deleted on a node where the setting of LUN was deleted.
# tgt-admin --show
Point
Confirm that LUN information of the deleted number was not output.
[Execution example]
# tgt-admin --show
...
LUN information:
LUN: 0
Type: controller
SCSI ID: IET 00010000
SCSI SN: beaf10
Size: 0 MB, Block size: 1
Online: Yes
Removable media: No
Prevent removal: No
Readonly: No
Backing store type: null
Backing store path: None
Backing store flags:
...
[RHEL7]
Confirm LUN to be deleted on any node.
# iscsiadm -m session -P 3
[Execution example]
# iscsiadm -m session -P 3
iSCSI Transport Class version xxxxxxxx
version xxxxxxxx
Target: iqn.2003-01.org.linux-iscsi.node2.x8664:sn.c585c8864f22
Current Portal: 192.168.56.10:3260,1
Persistent Portal: 192.168.56.10:3260,1
**********
Interface:
**********
...
iSCSI Connection State: LOGGED IN
iSCSI Session State: LOGGED_IN
Internal iscsid Session State: NO CHANGE
...
************************
Attached SCSI devices:
************************
Host Number: 12 State: running
scsi12 Channel 00 Id 0 Lun: 0
Attached scsi disk sdd State: running
scsi13 Channel 00 Id 0 Lun: 1
...
Target: iqn.2003-01.org.linux-iscsi.node1.x8664:sn.6e665c7c1be0 (*1)
Current Portal: 192.168.56.20:3260,1
Persistent Portal: 192.168.56.20:3260,1
**********
Interface:
**********
...
iSCSI Connection State: LOGGED IN
iSCSI Session State: LOGGED_IN
Internal iscsid Session State: NO CHANGE
...
************************
Attached SCSI devices:
************************
Host Number: 13 State: running
scsi13 Channel 00 Id 0 Lun: 0 (*2)
Attached scsi disk sde State: running (*3)
scsi13 Channel 00 Id 0 Lun: 1
...
In the example, when deleting sde of (*3), LUN0 of (*2) is deleted in the target name "iqn.2003-01.org.linux-iscsi.node1.x8664:sn.6e665c7c1be0" of (*1).
Stop iSCSI devices to be deleted on both node.
# echo offline > /sys/block/iSCSI_device_name/device/state
[Execution example]
# echo offline > /sys/block/sde/device/state
Delete iSCSI devices to be deleted on both node.
# echo 1 > /sys/block/iSCSI_device_name/device/delete
[Execution example]
# echo 1 > /sys/block/sde/device/delete
Confirm the storage for LUN to be deleted on a node where LUN is to be deleted.
# targetcli ls
Point
(*1) Confirm that the target name is same as which was confirmed in step 1.
(*2) Confirm the storage name correspond to the LUN to be deleted.
[Execution example]
# targetcli ls
o- / ................................................................................ [...]
o- backstores ..................................................................... [...]
| o- block ......................................................... [Storage Objects: 2]
| | o- storage1 .. [/dev/disk/by-id/scsi-3500000e114784363 (8.0GiB) write-thru activated]
| | o- storage2 ..[/dev/disk/by-id/scsi-3500000e1109cc830 (16.0GiB) write-thru activated]
| o- fileio ........................................................ [Storage Objects: 0]
| o- pscsi ......................................................... [Storage Objects: 0]
| o- ramdisk ....................................................... [Storage Objects: 0]
o- iscsi ................................................................... [Targets: 1]
| o- iqn.2003-01.org.linux-iscsi.node1.x8664:sn.6e665c7c1be0 .................. [TPGs: 1] (*1)
| o- tpg1 ...................................................... [no-gen-acls, no-auth]
| o- acls ................................................................. [ACLs: 2]
| | o- iqn.1994-05.com.redhat:dee92ff9979d ......................... [Mapped LUNs: 2]
| | | o- mapped_lun0 ..................................... [lun0 block/storage1 (rw)]
| | | o- mapped_lun1 ..................................... [lun1 block/storage2 (rw)]
| | o- iqn.1994-05.com.redhat:fa7eb9cf483c ......................... [Mapped LUNs: 2]
| | o- mapped_lun0 ..................................... [lun0 block/storage1 (rw)]
| | o- mapped_lun1 ..................................... [lun1 block/storage2 (rw)]
| o- luns ................................................................. [LUNs: 2]
| | o- lun0 ............... [block/storage1 (/dev/disk/by-id/scsi-3500000e114784363)] (*2)
| | o- lun1 ............... [block/storage2 (/dev/disk/by-id/scsi-3500000e1109cc830)]
| o- portals ........................................................... [Portals: 1]
| o- 192.168.125.123:3260 .................................................... [OK]
o- loopback ................................................................ [Targets: 0]
Delete the storage for LUN to be deleted on a node where LUN is to be deleted.
# targetcli /backstores/block/ delete storage_name
Point
Specify the storage name that was confirmed in step 4 to storage_name.
[Execution example]
# targetcli /backstores/block/ delete storage1
Confirm that LUN was deleted on a node where LUN is to be deleted.
# targetcli ls
Point
Confirm that the storage and LUN information which were deleted were not output.
[Output example]
# targetcli ls
o- / ................................................................................ [...] o- backstores ..................................................................... [...] | o- block ......................................................... [Storage Objects: 1] | | o- storage2 . [/dev/disk/by-id/scsi-3500000e1109cc830 (16.0GiB) write-thru activated] | o- fileio ........................................................ [Storage Objects: 0] | o- pscsi ......................................................... [Storage Objects: 0] | o- ramdisk ....................................................... [Storage Objects: 0] o- iscsi ................................................................... [Targets: 1] | o- iqn.2003-01.org.linux-iscsi.node1.x8664:sn.6e665c7c1be0 .................. [TPGs: 1] | o- tpg1 ...................................................... [no-gen-acls, no-auth] | o- acls ................................................................. [ACLs: 2] | | o- iqn.1994-05.com.redhat:dee92ff9979d ......................... [Mapped LUNs: 1] | | | o- mapped_lun1 ..................................... [lun1 block/storage2 (rw)] | | o- iqn.1994-05.com.redhat:fa7eb9cf483c ......................... [Mapped LUNs: 1] | | o- mapped_lun1 ..................................... [lun1 block/storage2 (rw)] | o- luns ................................................................. [LUNs: 1] | | o- lun1 ............... [block/storage2 (/dev/disk/by-id/scsi-3500000e1109cc830)] | o- portals ........................................................... [Portals: 1] | o- 192.168.125.123:3260 .................................................... [OK] o- loopback ................................................................ [Targets: 0]
Save the target information on a node where LUN is to be deleted.
# targetctl save