To swap a disk connected to the netmirror group, 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.6.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.