All Products
Search
Document Center

Elastic Compute Service:Shrink disks

最終更新日:Nov 06, 2023

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

Prerequisites

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

Background information

SMC is developed to balance cloud-based and off-cloud workloads for Alibaba Cloud users. You can 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 an instance as the migration source, you can reset the sizes of disks on the instance to smaller values to shrink disks. Before you perform the migration, take note of the following items:

  • If you want to shrink disks by migrating data of the instance to which the disks are attached to the destination instance, make sure that the source instance and the destination instance are not the same one. The destination must be available. You must delete all data from the destination instance or back up all data of the instance to an image, a snapshot, or a device that is not attached to the instance.

    Warning

    After the migration task is created, all original data in the destination instance is deleted. If the destination instance contains important data, we recommend that you do not directly migrate data of the source instance to the destination instance. You can set the destination type to ECS image and create an ECS instance from an image to migrate data.

  • After you shrink disks in SMC by migrating the data of the source instance to which the disks are attached to the destination instance, the disks are re-attached to the destination instance. Some attributes of the destination instance change after the migration. The changed attributes include the instance ID and public IP address.

    If the source instance resides in a virtual private cloud (VPC) and you want to retain the public IP address of the source instance, convert the public IP address into an elastic IP address (EIP). If the source instance already has an EIP or you do not need to retain the public IP address of the source instance, we recommend that you directly shrink disks in SMC.

Procedure

  1. Import the instance to which the disks that you want to shrink are attached as the migration source.

    Install the SMC client on the instance to which the disks that you want to shrink are attached and import the instance as the migration source by using the SMC client. 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 migrate data of an instance to shrink disks, see Migrate servers to ECS instances. When you create a migration task, take note of the following items:

    • Set the system disk size and data disk size of the destination instance to desired values. The sizes of the new system disk and the new data disks must be greater than the amount of used space of the original system disk and data disks.

    • To create a custom image from the source instance and then create an instance from the custom image, set the destination type to ECS image.

  3. Wait until the migration task is complete.

    • If the migration task is in the Finished state, the task is complete and you can view the destination instance.

    • If the migration task enters the InError state, the task fails. You can check the logs to troubleshoot the issue. Then, restart the migration task. For information about common errors and solutions, see FAQ.