You cannot shrink system or data disks in Elastic Compute Service (ECS). You can use Alibaba Cloud Server Migration Center (SMC) to shrink disks.

Prerequisites

The preparations for the migration are complete. For more information, see Before you begin.

Background information

SMC is aimed to balance the cloud-based and offline workloads of Alibaba Cloud users. You can also use SMC to shrink ECS disks.

SMC allows you to create a custom image from an ECS instance or migrate the data of an instance to another instance. When you import the migrated data, you can re-specify the size of a disk to shrink the disk. Before you migrate the data of an instance, take note of the following items:
  • If you want to shrink a disk by migrating the data of the instance to which the disk is attached, make sure that the source instance and the destination instance are not the same one. The destination instance must be available and does not contain data or has all data backed up to an image, a snapshot, or a different device.
    Warning After the migration task is created, all original data in the destination instance is deleted. If the destination ECS instance contains important data, we recommend that you do not migrate the data of the source instance to the destination instance. In this case, we recommend that you set Resource Type to ECS Image and then create an ECS instance by using a custom image.
  • Some properties of the ECS instance are changed because the ECS instance is replaced when SMC is used to shrink the disk. For example, the ID (InstanceId) and public IP address of the instance are changed.

    If your source instance resides in a virtual private cloud (VPC), you can convert the public IP address of the instance into an elastic IP address (EIP). This way, you can retain the public IP address. If you have already used EIPs or have less dependence on public IP addresses, we recommend that you use SMC to shrink disks.

Procedure

  1. Import the data of the source instance.
    You must download the SMC client to the ECS instance whose disks you want to shrink and then use the client to import the source ECS instance to SMC. For more information, see Import the information about a migration source by using the SMC client.
  2. Create and start a migration task.
    For information about how to shrink disks by migrating the data of the source instance to the destination instance, see Migrate servers to ECS instances. When you create a migration task, take note of the following items:
    • Configure the System Disk and Data Disk parameters in the Target Disk Size section based on your requirements. The values of these parameters cannot be less than the amounts of used space of the system and data disk.
    • If you want to create a custom image from the source instance and then create an ECS instance from the custom image, set Resource Type to ECS Image when you create a migration task.
  3. Wait until the migration task is completed.
    • If the migration task is in the Completed state, the task is completed and you can view the destination ECS instance. daasda5862
    • If the migration task is in the InError state, the task failed. You can check the logs to troubleshoot the failure. Then, restart the migration task. For information about common errors and solutions, see SMC FAQ.