All Products
Search
Document Center

Elastic Compute Service:Redeploy an instance to which local disks are attached

Last Updated:Dec 04, 2024

If you receive a Local Disk-based Instance Event, which can be an Instance Redeployment Due to System Maintenance (SystemMaintenance.Redeploy) or Instance Redeployment Due to System Error (SystemFailure.Redeploy) event, for an Elastic Compute Service (ECS) to which local disks are attached, you can redeploy the instance to handle the event. This topic describes how to redeploy an instance to which local disks are attached in the ECS console.

For more information, see O&M scenarios and system events for instances equipped with local disks.

Important

After an instance to which local disks are attached is redeployed, the instance is migrated to a different host and new local disks are attached to the instance. Before you redeploy an instance to which local disks are attached, we recommend that you back up data stored on the local disks. For more information, see Back up data on a local disk.

Prerequisites

  • A Local Disk-based Instance Event is received for an instance to which local disks are attached.

  • (Recommended) Preparations are made to isolate read/write operations on the local disks that are attached to the instance and modify the /etc/fstab configuration file to improve system availability.

    Preparations

    1. Connect to an ECS instance.

      For information about the connection methods, see Connection method overview.

    2. (Optional) Isolate the read/write operations on the local disks at the application layer.

      Note

      You can isolate read/write operations at the application layer to improve data security and system stability. In specific scenarios, you can isolate read/write operations to reduce data conflicts and prevent data corruption caused by accidental operations. In high-concurrency scenarios, you can isolate read/write operations to increase system performance.

    3. If the instance runs a Linux operating system, add the nofail parameter to the /etc/fstab configuration file for all data disks. This way, the operating system can start as expected even if an issue occurs on a specific local disk, such as when the local disk is incorrectly attached.

      In this example, the nofail parameter is added to the /etc/fstab configuration file for the local disk /dev/vdd.

      /dev/vdd /mnt/vdd ext4 defaults,barrier=0,nofail 0 0

      Parameter

      Description

      /dev/vdd

      The device name of the local disk, which is the Device value returned by the DescribeInstanceHistoryEvents operation.

      /mnt/vdd

      The mount point of the local disk, which can be queried by using the mount | grep "/dev/vdd" command.

      ext4

      The file system type of the local disk, which can be queried by using the blkid /dev/vdd1 command.

      barrier=0

      The mount option used to disable barriers in the file system.

      nofail

      Indicates that the boot sequence of the ECS instance is not interrupted even if the local disk specified in the file system does not exist.

Procedure

  1. Log on to the ECS console.

  2. In the left-side navigation pane, click Events.

  3. In the left-side navigation pane of the Events page, click Local Disk-based Instance Events.

  4. On the Local Disk Damaged Events tab, find the instance that you want to redeploy and click Redeploy in the Actions column.

  5. In the Redeploy Instance dialog box, confirm the impacts of the instance redeployment, select I am aware of the risk of data loss, and then click OK.

What to do next

  • Local disks

    1. Initialize the new local disks that are attached to the instance. For more information, see Initialize a data disk whose size does not exceed 2 TiB on a Linux instance, Initialize a data disk whose size does not exceed 2 TiB on a Windows instance, or Initialize a data disk whose size exceeds 2 TiB.

    2. Restore the backup data of local disks according to the backup method that you previously chose, based on your business requirements. For more information, see Back up data on a local disk.

  • Data disks

    If data disks are attached to the instance, but the data disks are not configured to automatically mount on instance startup, you must connect to the instance after the instance is redeployed and perform the following steps to mount the data disks.

    Procedure

    • Linux instance

      1. Connect to the ECS instance to which the cloud disk is attached and run the following command to mount a partition to the disk:

        sudo mount <Disk partition name> <Mount point>
        • <Disk partition name>: Specify the name of the partition. Run the sudo fdisk -lu command to query the partition name. Example: /dev/vdc.

        • <Mount point>: Specify an existing directory or run the sudo mkdir -p <New directory> command to create a new directory as the mount point. Example: sudo mkdir -p /data.

        Sample mount command: sudo mount /dev/vdc /data.

      2. Write the new partition information to the /etc/fstab file. This way, the partition is automatically mounted on system startup. For more information, see the Step 4: Configure the disk partition to automatically mount on instance startup section of the "Initialize a data disk whose size does not exceed 2 TiB on a Linux instance" topic.

    • Windows instance

      1. Connect to the ECS instance to which the cloud disk is attached, click the 开始图标 icon, and then select Disk Management.

      2. Find the cloud disk that you want to manage, right-click a blank area, and select Online.image