To perform hot swap (swap without stopping the system) of a disk connected to the netmirror group in a RHEL6 environment, perform the following procedure.
Make a disk exchangeable.
For shared classes
Execute "Swap Physical Disk" (or the sdxswap -O command) on the node where a disk is to be swapped.
If multiple partitions on the disk to be swapped are the targets of the mirroring among servers, execute "Swap Physical Disk" (or the sdxswap -O command) for iSCSI devices for all the partitions.
For local classes (when object configurations were restored with the sdxconfig Restore command)
Delete the entire object configuration (volumes, groups, and disks) of a local class to delete the local class.
As for the order of deleting disks, delete a disk to be swapped with the sdxdisk -R command first.
If multiple partitions on the disk to be swapped are the targets of the mirroring among servers, delete the object configurations for iSCSI devices for all the partitions.
Note
If a netmirror group exists in a local class, "Swap Physical Disk" (or the sdxswap -O command) cannot be executed.
Stop iSCSI devices for disks to be swapped on both nodes.
If multiple partitions on disks to be swapped are the target of the mirroring among servers, execute it for iSCSI devices for all the partitions.
# echo offline > /sys/block/iSCS_device_name/device/state |
(Example) When iSCSI device name is "sdd"
# echo offline > /sys/block/sdd/device/state |
Confirm the target ID on a node where a disk is swapped.
The following example shows that the target ID of the target name "target-0101" is "1".
# tgt-admin --show
Target 1: target-0101
... |
Delete LUN to be swapped on a node where a disk is swapped.
If multiple partitions on the disk to be swapped are the targets of the mirroring among servers, delete LUN for all the partitions.
# tgtadm --lld iscsi --op delete --mode logicalunit --tid targetID --lun LUN |
Point
Specify the target ID to targetID.
Specify the LUN number to LUN.
(Example) When the target ID is "1" and the LUN number is "1"
# tgtadm --lld iscsi --op delete --mode logicalunit --tid 1 --lun 1 |
Confirm that LUN was deleted on a node where a disk is swapped.
Execute the following command on a node where a disk is swapped to confirm that the deleted number in LUN information is not output.
# tgt-admin --show |
(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:
... |
Swap disks.
For the procedures for swapping disks, refer to the manuals related to the servers and the disks.
If the mirroring among servers is performed not per the physical disk but per partition, create partitions on the swapped disk on the node where the disk was swapped.
The partition size and the order to create the partition must be consistent before and after the disk is swapped.
Modify the /etc/tgt/targets.conf file on the node where the disk was swapped.
Modify the path of the by-id file for the original disk to that for the new disk. (If /dev/vdX that is the path of the virtio block device of KVM guests is described, modify the path to the /dev/vdX path of the virtio block device.)
[Example before modification]
<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> </target> |
[Example after modification]
<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 1
scsi_id SDX01
</backing-store>
</target> |
Create LUN on the node where the disk was swapped.
If the mirroring among servers is performed per partition, create LUN for all the partitions.
# tgtadm --lld iscsi --op new --mode logicalunit --tid targetID --lun LUN --backing-store device |
Point
Specify the target ID to targetID.
Specify the LUN number to LUN.
Specify the path of the device file for the swapped physical disk to device.
(Example) When the target ID is "1", the LUN number is "1", and the swapped device file is /dev/sde
# tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 1 --backing-store /dev/sde |
Set SCSI ID of a new iSCSI device on the node where the disk was swapped.
If the mirroring among servers is performed per partition, set SCSI ID for all the partitions.
# tgtadm --mode logicalunit --op update --tid targetID --lun LUN --params scsi_id=SCSI-ID |
Point
Specify the target ID to targetID.
Specify the LUN number to LUN.
Specify SCSI ID set to the swapped iSCSI device to SCSI-ID.
(Example) When the target ID is "1", the LUN number is "1", and SCSI-ID is "SDX01"
# tgtadm --mode logicalunit --op update --tid 1 --lun 1 --params scsi_id=SDX01 |
Confirm that LUN was created on the node where the disk was swapped.
# tgt-admin --show |
(Example)
# tgt-admin --show
Target 1: target-0101
...
LUN information:
...
LUN: 1 (*1)
Type: disk
SCSI ID: SDX01 (*2)
SCSI SN: beaf11
Size: 10000 MB, Block size: 512
Online: Yes
Removable media: No
Prevent removal: No
Readonly: No
Backing store type: rdwr
Backing store path: /dev/sde (*3)
Backing store flags:
... |
(*1) The number specified to lun in the /etc/tgt/targets.conf file
(*2) The value specifed to scsi_id in the /etc/tgt/targets.conf file
(*3) The path of the device file for the swapped physical disk
Rescan an iSCSI session on both nodes.
# iscsiadm -m session --rescan |
Enable iSCSI device on both nodes.
If the mirroring among servers is performed per partition, enable iSCSI device for all the partitions.
# echo running > /sys/block/iSCSI_device_name/device/state |
(Example)
# echo running > /sys/block/sdd/device/state |
At the time, though the following OS message may be ourput to the system log, no action is required.
kernel: sd X:X:X:X: Warning! Received an indication that the LUN assignments on this target have changed. The Linux SCSI layer does not automatically remap LUN assignments.
Restore the GDS configuration.
For shared classes
On the node where the disk was swapped, execute "Restore Physical Disk" (or the sdxswap -I command). Execute "Restore Physical Disk" (or the sdxswap -I command) for all the iSCSI devices where "Swap Physical Disk" (or the sdxswap -O command) was executed in step 1.
For local classes
Re-create the object configuration (volumes, groups, disks, and classes) of the deleted local class.
When the configuration information file of the class exists
When the class configuration information obtained with the sdxconfig Backup command exits, re-create the object configuration with the sdxconfig Restore command.
When the configuration information file of the class does not exist
Specify a shared class to re-create the object configuration.
To perform cold swap a disk (swap in the stopped system) connected to the netmirror group in a RHEL6 environment, perform the following procedure.
Make a disk exchangeable.
For shared classes
Execute "Swap Physical Disk" (or the sdxswap -O command) on the node where a disk is to be swapped.
If multiple partitions on the disk to be swapped are the targets of the mirroring among servers, execute "Swap Physical Disk" (or the sdxswap -O command) for iSCSI devices for all the partitions.
For local classes (when object configurations were restored with the sdxconfig Restore command)
Delete the entire object configuration (volumes, groups, and disks) of a local class to delete the local class.
As for the order of deleting disks, delete a disk to be swapped with the sdxdisk -R command first.
If multiple partitions on the disk to be swapped are the targets of the mirroring among servers, delete the object configurations for iSCSI devices for all the partitions.
Note
If a netmirror group exists in a local class, "Swap Physical Disk" (or the sdxswap -O command) cannot be executed.
If you swap the disk of the operating node while the service continues, switch the cluster application to make a node, which is not connected to the disk to be swapped, as an operating node.
Modify the /etc/inittab file on the node where the disk is to be swapped so that the system is restarted in single user mode.
# vim /etc/inittab |
[Before change]
id:current_run_level:initdefault: |
[After change]
id:1:initdefault: |
Stop the node where the disk is to be swapped.
Swap the disk.
For the procedures for swapping the disk, refer to the manuals related to the servers and the disks.
Start the node where the disk was swapped.
If the mirroring among servers is performed not per the physical disk but per partition, create partitions on the swapped disk on the node where the disk was swapped.
The partition size and the order to create the partition must be consistent before and after the disk is swapped.
Modify the /etc/tgt/targets.conf file on the node where the disk was swapped.
Modify the path of the by-id file for the original disk to that for the new disk. (If /dev/vdX that is the path of the virtio block device of KVM guests is described, modify the path to the /dev/vdX path of the virtio block device.)
For the description of the /etc/tgt/targets.conf file, see "4.8.3 Creating iSCSI Target."
Description example
<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 1
scsi_id SDX01
</backing-store>
</target> |
Undo the modification of /etc/inittab file performed in step 3 so that the system is restarted in multi-user mode.
Restart the node where the disk was swapped.
Check the target information on the node where the disk was swapped.
# tgt-admin --show |
Execution example
# tgt-admin --show
Target 1: target-0101
...
LUN information:
...
LUN: 1 (*1)
Type: disk
SCSI ID: SDX01 (*2)
SCSI SN: beaf11
Size: 10000 MB, Block size: 512
Online: Yes
Removable media: No
Prevent removal: No
Readonly: No
Backing store type: rdwr
Backing store path: /dev/disk/by-id/scsi-3500000e111c56611 (*3)
Backing store flags:
... |
(*1) The number specified to lun of the /etc/tgt/targets.conf file
(*2) The value specified to scsi_id of the /etc/tgt/targets.conf file
(*3) The path specified to backing-store of the /etc/tgt/targets.conf file
On the node where the disk was swapped, check the state of the iSCSI session.
Check that both the iSCSI connection state and the session state indicate "LOGGED IN".
Execution example
# iscsiadm -m session -P 1
...
Target: target-0101
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
... |
Rescan an iSCSI session on both nodes.
# iscsiadm -m session --rescan |
Restore the GDS configuration.
For shared classes
On the node where the disk was swapped, execute "Restore Physical Disk" (or the sdxswap -I command). Execute "Restore Physical Disk" (or the sdxswap -I command) for all the iSCSI devices where "Swap Physical Disk" (or the sdxswap -O command) was executed in step 1.
For local classes
Re-create the object configuration (volumes, groups, disks, and classes) of the deleted local class.
When the configuration information file of the class exists
When the class configuration information obtained with the sdxconfig Backup command exits, re-create the object configuration with the sdxconfig Restore command.
When the configuration information file of the class does not exist
Specify a shared class to re-create the object configuration.
To perform hot swap (swap without stopping the system) of a disk connected to the netmirror group in a RHEL7 environment, perform the following procedure.
Make a disk exchangeable.
For shared classes
Execute "Swap Physical Disk" (or the sdxswap -O command) on the node where a disk is to be swapped.
If multiple partitions on the disk to be swapped are the targets of the mirroring among servers, execute "Swap Physical Disk" (or the sdxswap -O command) for iSCSI devices for all the partitions.
For local classes (when object configurations were restored with the sdxconfig Restore command)
Delete the entire object configuration (volumes, groups, and disks) of a local class to delete the local class.
As for the order of deleting disks, delete a disk to be swapped with the sdxdisk -R command first.
If multiple partitions on the disk to be swapped are the targets of the mirroring among servers, delete the object configurations for iSCSI devices for all the partitions.
Note
If a netmirror group exists in a local class, "Swap Physical Disk" (or the sdxswap -O command) cannot be executed.
Stop iSCSI devices for disks to be swapped on both nodes.
If multiple partitions on disks to be swapped are the target of the mirroring among servers, execute it for iSCSI devices for all the partitions.
# echo offline > /sys/block/iSCSI_device_name/device/state |
Execution example
# echo offline > /sys/block/sdd/device/state |
Back up the target information on a node where a disk is swapped.
# cp /etc/target/saveconfig.json backup_file |
Execution example
# cp /etc/target/saveconfig.json /var/tmp/targetfile.json |
Confirm storage and LUN for a device to be swapped on a node where a disk is swapped.
If multiple partitions on disks to be swapped are the target of the mirroring among servers, confirm all the partitions.
# targetcli ls |
Output example
# targetcli ls
o- / .............................................................................. [...]
o- backstores ................................................................... [...]
| o- block ....................................................... [Storage Objects: 2]
| | o- storage1 . [/dev/disk/by-id/scsi-3500000e114784363 (8.0GiB) write-thru activated] (*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: 2]
| | | o- mapped_lun0 .................................... [lun0 block/storage1 (rw)] (*2)
| | | o- mapped_lun1 ................................... [lun1 block/storage2 (rw)]
| | o- iqn.1994-05.com.redhat:fa7eb9cf483c ....................... [Mapped LUNs: 2]
| | o- mapped_lun0 .................................... [lun0 block/storage1 (rw)] (*2)
| | o- mapped_lun1 ................................... [lun1 block/storage2 (rw)]
| o- luns ............................................................... [LUNs: 2]
| | o- lun0 .............. [block/storage1 (/dev/disk/by-id/scsi-3500000e114784363)] (*3)
| | 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] |
(*1) Confirm that the storage name for /dev/disk/by-id/scsi-3500000e114784363 is "storage1".
(*2) It is LUN that is mapped to the initiator allowed to connected to. The information related to lun0 was output to the line.
(*3) It shows that the storage name for lun0 is "storage1" and the by-id file of the device is /dev/disk/by-id/scsi-3500000e114784363.
In the example, if you swap the device indicated by /dev/disk/by-id/scsi-3500000e114784363, the storage name is "storage1" and LUN is "lun0".
Delete all the LUNs to be swapped on a node where a disk is to be swapped.
If multiple partitions on disks to be swapped are the target of the mirroring among servers, execute this step for storages for all the partitions.
# targetcli /backstores/block/ delete storage_name |
Point
Specify the storage name confirmed in step 4 to storage_name.
Execution example
# targetcli /backstores/block/ delete storage1 Deleted storage object storage1. |
Delete storage and LUN for a device to be swapped on a node where a disk is to be swapped.
If multiple partitions on disks to be swapped are the target of the mirroring among servers, confirm storage and LUN for all the partitions.
# targetcli ls |
Point
Confirm that the information of the deleted storage and LUN is 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] |
Swap the disk.
For the procedures for swapping disks, refer to the manuals related to the servers and the disks.
If the mirroring among servers is performed not per the physical disk but per partition, create partitions on the swapped disk on the node where the disk was swapped.
The partition size and the order to create the partition must be consistent before and after the disk is swapped.
Edit the target information that was backed up in step 3 and modify the path of the by-id file for the original disk to that for the new disk.
If multiple partitions on the disk to be swapped are the targets of the mirroring among servers, take this step for the path of by-id file for all the partitions.
# vim backup_file { "fabric_modules": [], "storage_objects": [ { ... "dev": "original_disk", (*1) "name": "storage_name", "plugin": "block", "readonly": false, "write_back": false, "wwn": "fae93a41-0d59-4843-9137-9c39854e5388" } ], |
(*1) Modify to the path of the by-id file for the new disk.
Point
Specify the backup file that was backed up in step 3 to backup_file.
[Example before modification]
# vim /var/tmp/targetfile.json { "fabric_modules": [], "storage_objects": [ { ... "dev": "/dev/disk/by-id/scsi-3500000e114784363", "name": "storage1", "plugin": "block", "readonly": false, "write_back": false, "wwn": "279b8505-418f-4449-8987-f3acaad34618" } ], |
[Example after modification]
# vim /var/tmp/targetfile.json { "fabric_modules": [], "storage_objects": [ { ... "dev": "/dev/disk/by-id/scsi-3500000e111c56611", "name": "storage1", "plugin": "block", "readonly": false, "write_back": false, "wwn": "279b8505-418f-4449-8987-f3acaad34618" } ], |
Restore the target information that was edited in step 9 on a node where a disk is to be swapped.
# targetctl restore backup_file |
Point
Specify the backup file that was created in step 9 to backup_file.
Execution example
# targetctl restore /var/tmp/targetfile.json |
Confirm that the storage and LUN was added to a node where a disk is to be swapped.
If multiple partitions on the disk to be swapped are the targets of the mirroring among servers, confirm the storage and LUN for all the partitions.
# targetcli ls |
Point
(*1) Confirm that the device correspond to the storage that was deleted in step 5 is changed to the swapped device.
(*2) Confirm that LUN which was deleted in step 5 is mapped to the initiator allowed to connected to.
(*3) Confirm the following:
- LUN and the storage that were deleted in step 5 are added.
- The path of the device is specified to the device that was swapped.
Output example
# targetcli ls
o- / .............................................................................. [...]
o- backstores ................................................................... [...]
| o- block ....................................................... [Storage Objects: 2]
| | o- storage1 . [/dev/disk/by-id/scsi-3500000e111c56611 (8.0GiB) write-thru activated] (*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: 2]
| | | o- mapped_lun0 .................................... [lun0 block/storage1 (rw)] (*2)
| | | o- mapped_lun1 ................................... [lun1 block/storage2 (rw)]
| | o- iqn.1994-05.com.redhat:fa7eb9cf483c ....................... [Mapped LUNs: 2]
| | o- mapped_lun0 .................................... [lun0 block/storage1 (rw)] (*2)
| | o- mapped_lun1 ................................... [lun1 block/storage2 (rw)]
| o- luns ............................................................... [LUNs: 2]
| | o- lun0 .............. [block/storage1 (/dev/disk/by-id/scsi-3500000e111c56611)] (*3)
| | 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] |
Store the target information that was restored in step 10 on a node where a disk is to be swapped.
# targetctl save |
Rescan an iSCSI session on both nodes.
# iscsiadm -m session --rescan |
Enable iSCSI devices on both nodes.
If the mirroring among servers is performed per partition, enable iSCSI devices for all the partitions.
# echo running > /sys/block/iSCSI_device_name/device/state |
Execution example
# echo running > /sys/block/sdd/device/state |
At the time, the following OS message may be output to the system log. An action is not required.
kernel: sd X:X:X:X: Warning! Received an indication that the LUN assignments on this target have changed. The Linux SCSI layer does not automatically remap LUN assignments.
Restore the GDS configuration.
For shared classes
On the node where the disk was swapped, execute "Restore Physical Disk" (or the sdxswap -I command). Execute "Restore Physical Disk" (or the sdxswap -I command) for all the iSCSI devices where "Swap Physical Disk" (or the sdxswap -O command) was executed in step 1.
For local classes
Re-create the object configuration (volumes, groups, disks, and classes) of the deleted local class.
When the configuration information file of the class exists
When the class configuration information obtained with the sdxconfig Backup command exits, re-create the object configuration with the sdxconfig Restore command.
When the configuration information file of the class does not exist
Specify a shared class to re-create the object configuration.
To perform cold swap (swap in a stopped system) of a disk connected to the netmirror group in a RHEL7 environment, perform the following procedure.
Make a disk exchangeable.
For shared classes
Execute "Swap Physical Disk" (or the sdxswap -O command) on the node where a disk is to be swapped.
If multiple partitions on the disk to be swapped are the targets of the mirroring among servers, execute "Swap Physical Disk" (or the sdxswap -O command) for iSCSI devices for all the partitions.
For local classes (when object configurations were restored with the sdxconfig Restore command)
Delete the entire object configuration (volumes, groups, and disks) of a local class to delete the local class.
As for the order of deleting disks, delete a disk to be swapped with the sdxdisk -R command first.
If multiple partitions on the disk to be swapped are the targets of the mirroring among servers, delete the object configurations for iSCSI devices for all the partitions.
Note
If a netmirror group exists in a local class, "Swap Physical Disk" (or the sdxswap -O command) cannot be executed.
If you swap the disk of the operating node while the service continues, switch the cluster application to make a node, which is not connected to the disk to be swapped, as an operating node.
Modify the settings for starting the system on the node where the disk is to be swapped so that the system is restarted in single user mode.
# systemctl set-default rescue.target |
Stop the node where the disk is to be swapped.
Swap the disk.
For the procedures for swapping the disk, refer to the manuals related to the servers and the disks.
Start the node where the disk was swapped.
If the mirroring among servers is performed not per the physical disk but per partition, create partitions on the swapped disk on the node where the disk was swapped.
The partition size and the order to create the partition must be consistent before and after the disk is swapped.
Back up the setting information of iSCSI target on the node where the disk was swapped.
# cp /etc/target/saveconfig.json backup_file |
Execution example
# cp /etc/target/saveconfig.json /var/tmp/targetfile.json |
Modify the path of the by-id file for the original disk to that for the new disk in the setting information of iSCSI target.
If multiple partitions on the disk to be swapped are the targets of the mirroring among servers, take this step for the path of by-id file for all the partitions.
# vim /etc/target/saveconfig.json { "fabric_modules": [], "storage_objects": [ { ... "dev": "path_for_by-id_file_of_the_disk_before_swap", (*1) "name": "storage_name", "plugin": "block", "readonly": false, "write_back": false, "wwn": "fae93a41-0d59-4843-9137-9c39854e5388" } ], |
(*1) Modify to the path of the by-id file for the new disk.
[Example before modification]
# vim /etc/target/saveconfig.json { "fabric_modules": [], "storage_objects": [ { ... "dev": "/dev/disk/by-id/scsi-3500000e111e68e00", "name": "store1", "plugin": "block", "readonly": false, "write_back": false, "wwn": "4a98bfb0-7d7e-4bc8-962c-0b3cf192b214" } ], |
[Example after modification]
# vim /etc/target/saveconfig.json { "fabric_modules": [], "storage_objects": [ { ... "dev": "/dev/disk/by-id/scsi-3500000e111c56610", * The line to be modified "name": "store1", "plugin": "block", "readonly": false, "write_back": false, "wwn": "4a98bfb0-7d7e-4bc8-962c-0b3cf192b214" } ], |
Undo the settings for starting the system modified in step 3 so that the system is restarted in multi-user mode.
Example) When setting back to multi-user.target
# systemctl set-default multi-user.target |
Restart the node where the disk was swapped.
Check that iSCSI target has been set normally on the node where the disk was swapped.
# targetcli /backstores/block/ ls ; targetcli /iscsi/ ls |
Point
(*1) Confirm that the modified path is effective.
Output example
o- block ........................................................... [Storage Objects: 1] o- store1 ..... [/dev/disk/by-id/scsi-3500000e111c56610 (16.0GiB) write-thru activated] (*1) 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_lun0 ....................................... [lun0 block/store1 (rw)] | o- iqn.1994-05.com.redhat:fa7eb9cf483c ......................... [Mapped LUNs: 1] | o- mapped_lun0 ....................................... [lun0 block/store1 (rw)] o- luns ................................................................. [LUNs: 1] | o- lun0 ................. [block/store1 (/dev/disk/by-id/scsi-3500000e111c56610)] (*1) o- portals ........................................................... [Portals: 2] o- 192.168.56.20:3260 ...................................................... [OK] |
On the node where the disk was swapped, check the state of the iSCSI session.
Check that both the iSCSI connection state and the session state indicate "LOGGED IN".
Execution example
# iscsiadm -m session -P 1
...
Target: iqn.2003-01.org.linux-iscsi.node1.x8664:sn.6e665c7c1be0
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
... |
Rescan an iSCSI session on both nodes.
# iscsiadm -m session --rescan |
Restore the GDS configuration.
For shared classes
On the node where the disk was swapped, execute "Restore Physical Disk" (or the sdxswap -I command). Execute "Restore Physical Disk" (or the sdxswap -I command) for all the iSCSI devices where "Swap Physical Disk" (or the sdxswap -O command) was executed in step 1.
For local classes
Re-create the object configuration (volumes, groups, disks, and classes) of the deleted local class.
When the configuration information file of the class exists
When the class configuration information obtained with the sdxconfig Backup command exits, re-create the object configuration with the sdxconfig Restore command.
When the configuration information file of the class does not exist
Specify a shared class to re-create the object configuration.
Delete the backup file created in step 8.
# rm backup_file |
Execution example
# rm /var/tmp/targetfile.json |