Automatic Drive Replacement
A drive can be automatically replaced after it
- failed (was physically removed from a RAID);
- exceeded the threshold value of I/O errors (the default is 3. To change the threshold, use the command xicli settings faulty-count modify --threshold).
To automatically replace drives on a RAID, create a spare pool, then assign the created spare pool to the RAID. You can only assign one spare pool to each RAID. We recommend creating a sparepool with storage devices of the same type.
If the system has a spare pool, you can assign it to an existing RAID or when creating a new RAID using the commands xicli raid create/modify --sparepool.
Commands for managing spare pools
To add drive(s) to the spare pool, run
# xicli pool add <args>
Required arguments |
||
-n |
--name |
The name of the spare pool. |
-d |
--drives |
The list of block devices (/dev/sd*, /dev/mapper/mpath*, /dev/nvme*, /dev/dm-*) separated by a space. |
To create the spare pool, run
# xicli pool create <args>
Required arguments |
||
-n |
--name |
The name for the spare pool. |
-d |
--drives |
The list of block devices (/dev/sd*, /dev/mapper/mpath*, /dev/nvme*, /dev/dm-*) separated by a space. |
To delete the spare pool, run
# xicli pool delete <arg>
Required argument |
||
-n |
--name |
The name of the spare pool. |
To remove drive(s) from the spare pool, run
# xicli pool remove <args>
Required arguments |
||
-n |
--name |
The name of the spare pool. |
-d |
--drives |
The list of block devices (/dev/sd*, /dev/mapper/mpath*, /dev/nvme*, /dev/dm-*) separated by a space. |
To show info on the spare pool, run
# xicli pool show [optional_args]
Optional arguments |
||
-n |
--name |
The name of the spare pool. Without the argument, show info on all spare pools. |
-f |
--format |
Output format:
The default: table. |
-u |
--units |
Size units:
The default: g. |
Possible drive states:
- ready – the drive is able for replacement;
- absent – drive is missing in the system;
- failed – attempt to replace with this drive from the spare pool failed, the drive will not be used for replacement.
To manage delay timer for the drive replacement from the spare pools, run
# xicli settings pool modify <arg>
When you change any parameter of the xicli settings pool modify command, the xiraid-scanner.service restarts.
Required argument |
||
-rd |
--replace_delay |
Delay time (in seconds) for the drive replacement from the spare pools. Only one delay time is used for all the spare pools. Possible values: integers from 1 to 3600. The default: 180. |
To show delay time used for the drive replacement from the spare pools, run
# xicli settings pool show
Optional argument |
||
-f |
--format |
Output format:
The default: table. |
-
Create a sparepool:
# xicli pool create -n pool1 -d /dev/sda /dev/sdb
-
Assign the created sparepool to the RAID:
# xicli raid modify -n media5 -sp pool1
Example: Setting the replacement timer for the sparepools to 60 seconds:
# xicli settings pool modify -rd 60