Redeploy a local disk instance

更新时间:
复制 MD 格式

If you receive a system event for a local disk-based instance, such as an Instance Redeployment Due to System Maintenance event (SystemMaintenance.Redeploy) or an Instance Redeployment Due to System Error event (SystemFailure.Redeploy), you can address the event by redeploying the instance. This topic explains how to redeploy an ECS instance in the ECS console.

For more information, see O&M scenarios and system events for local disk-based instances.

Important

When you redeploy an ECS instance, the instance is migrated to a different host, and new local disks are attached. Data on the original local disks is lost. We strongly recommend that you back up data from the original local disks before you proceed. For more information, see Back up files on a local disk.

Prerequisites

  • You have received a system event for your local disk-based instance.

  • Before you redeploy the local disk-based instance, we recommend that you configure read/write isolation at the application layer and modify the /etc/fstab file to improve system availability.

    Preparations

    1. Connect to an ECS instance.

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

    2. (Optional) Configure read/write isolation for the local disks at the application layer.

      Note

      This practice improves data security and system stability by reducing data conflicts and preventing data corruption caused by incorrect operations. It also enhances system performance in high-concurrency environments.

    3. For Linux instances only: In the /etc/fstab configuration file of the ECS instance, add the nofail parameter for all local disk entries. This allows the system to start even if a specified local disk fails to mount correctly.

      For example, add the nofail parameter for the local disk /dev/vdd:

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

      Parameter

      Description

      UUID

      The UUID of the local data disk. You can run the blkid command to query the UUID.

      /path/to/mountpoint

      The mount point of the local disk. You can run the blkid command to query the mount point.

      fstype

      The file system type. You can run the blkid command to query the type.

      barrier

      Specifies whether to enable the write barrier feature. A value of 0 disables the feature; 1 enables it.

      nofail

      Ensures the instance can start even if the disk fails to mount.

Procedure

  1. Log in to the ECS console.

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

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

  4. On the Local Disk Damage Events tab, find the instance and click Redeploy in the Actions column.

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

Next steps

  • Local disk

    1. Initialize the newly attached local disks. For more information, see Initialize a data disk on a Linux instance and Initialize a data disk on a Windows instance.

    2. Restore data from the backups of the original local disks. For more information, see Back up files on a local disk.

  • Data disk

    If a data disk is attached to the instance but not configured to mount automatically on startup, you must connect to the instance after redeployment and manually mount the data disk.

    Procedure

    1. Perform the mount or online operation.

      • Linux instances

        1. Remotely connect to the ECS instance to which the cloud disk is attached, and run the following command to perform the mount operation.

          sudo mount <cloud-disk-partition-name> <mountpoint>
          • <cloud disk partition name>: The name of the cloud disk partition. You can obtain the name by running the sudo fdisk -lu command. For example, /dev/vdc.

          • <mountpoint>: The mountpoint can be an existing directory or a new directory created by running the sudo mkdir -p <new_directory> command, such as sudo mkdir -p /data.

          mount command example: sudo mount /dev/vdc /data

        2. Add the new partition information to /etc/fstab to automatically mount the partition at startup. For more information, see Initialize a data disk (Linux).

      • Windows instances

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

        2. Find the disk, right-click it, and then select Online.image

    2. (Conditional) If you create a new cloud disk from a snapshot and attach it to the snapshot's source Linux instance, its UUID will conflict with that of the original disk. You must change the new disk's UUID. For more information, see Change the UUID of a cloud disk.

    3. (Conditional) If the capacity of a new cloud disk that you create from a snapshot is larger than the capacity of the original cloud disk, you must extend the partition and file system to use the additional space.

    4. (Optional) Configure the cloud disk partition to mount automatically on startup. For more information, see Initialize a data disk on a Linux instance.