Isolate or repair a damaged local disk on an ECS instance via the console or API after receiving a disk damage event.
Isolating or repairing a disk causes unrecoverable data loss on the damaged local disk. Back up your data in advance.
During disk isolation or repair, you can redeploy the instance with local disks to restore full disk usage, but all disk data will be lost.
Procedure overview
-
Modify configuration files: For Linux instances, log on to the instance, modify the /etc/fstab file, and unmount the damaged local disk to prevent read/write operations on the wrong disk during replacement.
-
Isolate a damaged disk: Isolate the damaged local disk. The instance continues to operate normally after isolation.
-
Replace the disk: Alibaba Cloud replaces the damaged disk.
-
Restore the disk: Log on to the ECS instance, modify the /etc/fstab file, and mount the new local disk.
Only big data instance families d1, d2, and d3, and local SSD instance family i4 support online disk isolation and replacement. Local SSD instance families i3 and i2 support isolation but not replacement. The actual steps displayed on the page depend on the extent of disk damage.
Procedure
Modify configuration files (Linux only)
Skip this step if your instance does not run Linux. For Linux instances, modify the /etc/fstab file and unmount the damaged local disk before isolation:
Isolate a damaged disk
ECS console
-
Visit ECS Console-Events.
-
In the left-side navigation pane of the Event page, click . Click Repair in the Actions column of the target event.
-
In the Configurations Modification step, confirm that you have modified the configuration file, and click Next.
The page indicates that you need to modify the /etc/fstab configuration file in the ECS instance operating system and unmount the disk device to avoid risks associated with the disk replacement operation.
-
In the Isolate Damaged Disk step, click OK. Wait for isolation to complete. If the page shows an Instance Restart step, restart the instance.
NoteIf the next step does not appear after a few minutes, refresh the page.
API operation
-
Query system events.
Call DescribeInstanceHistoryEvents to query system events in the Inquiring (
Inquiring) state in the specified region. Record the returned EventId (EventId) and event name (Name). -
Authorize and execute the isolation of damaged disks.
Call AcceptInquiredSystemEvent to authorize disk isolation.
-
When the event name is
SystemMaintenance.IsolateErrorDisk:-
If only RequestId is returned, no restart is required. Wait for Alibaba Cloud to replace the disk.
-
If
code:SwitchToOffline.OnlineIsolateFailis returned, restart the instance.
-
-
When the event name is
SystemMaintenance.RebootAndIsolateErrorDisk: After calling AcceptInquiredSystemEvent, restart the instance.
-
After restart, the isolated damaged local disk becomes a 1 MiB dummy disk. Continue to isolate read/write operations on the damaged disk at the application layer and keep the nofail and barrier settings in /etc/fstab.
Replace the disk
No action is required. Wait for Alibaba Cloud to replace the damaged local disk. Replacement is expected within five business days. Check progress on the Local Disk Events page.
Restore the disk
ECS console
-
When Disk Repair Progress changes to To Be Restored, indicating that the event is in the Restore stage, click Repair in the Actions column, then click Restore in the dialog box.
-
If the page shows a Restart step, restart the instance.
-
When Disk Repair Progress changes to Handled, the event is fully processed.
API
-
Query system events.
Call DescribeInstanceHistoryEvents to query system events. After disk replacement, Alibaba Cloud publishes a
SystemMaintenance.ReInitErrorDiskorSystemMaintenance.RebootAndReInitErrorDiskevent. -
Authorize disk restoration.
Call AcceptInquiredSystemEvent to authorize disk restoration.
-
When the event name is
SystemMaintenance.ReinitErrorDisk:-
If only RequestId is returned, no restart is required.
-
If
code=SwitchToOffline.OnlineReInitFailis returned, restart the instance.
-
-
When the event name is
SystemMaintenance.RebootAndReinitErrorDisk: After calling AcceptInquiredSystemEvent, restart the instance.
-
Next steps
After repair, check the ECS instance and local disk status. The replaced local disk must be initialized before use. See Initialize Windows data disk or Initialize Linux data disk.