This topic describes how to create an Elastic Compute Service (ECS) instance by using a custom image. You can use a custom image to create an ECS instance that has the same operating system, applications, and data as those of the custom image to make the process more efficient.
PrerequisitesA custom image is created in the account and region where you want to create an instance.
Background informationIf you do not have a custom image in the account and region where you want to create an instance, you can use one of the following solutions.
|You have an image on the local device.||Import the local image to Alibaba Cloud as a custom image. For more information, see Import an image.|
|You do not have custom images but have an instance as a template.||For more information, see Create a custom image from an instance.|
|You do not have custom images but have a snapshot as a template.||For more information, see Create a custom image from a snapshot.|
|You have a custom image in another region.||Copy the custom image to the region where you want to create an instance. For more information, see Copy an image.|
|You have a custom image in another account.||Share the custom image with the account under which you want to create an instance. For more information, see Share a custom image.|
- Log on to the ECS console.
- In the left-side navigation pane, choose .
- In the top navigation bar, select a region.
- Use one of the following methods to go to the image list tab based on the image source:
- Custom image created or exported: Go to the Custom Images tab.
- Custom image obtained by copying another image: Go to the Custom Images tab.
- Custom image shared from another account: Go to the Shared Images tab.
- Find the image that you want to use. Click Create Instance in the Actions column.
- Configure parameters to create an instance. The region and the image are automatically specified. Configure other parameters based on your business requirements. For more information, see Create an instance by using the wizard.Note When you use a custom image to create an instance, take note of the following items:
- You can extend the system disk. If cloud-init and growpart are installed in the image, the root partition of the system disk is automatically extended after the instance is created by using the image. For example, if the image size is 20 GB and you set the system disk size to 100 GB when you create an instance, the root partition is automatically extended to 100 GB after the instance is created.
- If the selected custom image contains one or more data disk snapshots, an equal number of data disks are automatically created from the snapshots. Each data disk has the same size as the snapshot from which the disk is created. You can extend a data disk, but you cannot shrink a data disk.
After you extend a data disk, extend the partitions and file systems of the disk for the new capacity to take effect. For more information, see Extend the partitions and file systems of disks on a Linux instance or Extend the partitions and file systems of a disk on a Windows instance.