tencent cloud

Feedback

Creating a Custom Image

Last updated: 2022-09-21 17:36:48

    Overview

    Besides public images, you can also create custom images, with which you can create CVM instances with the same configurations.

    Note

    Images use the CBS snapshot service for data storage:

    • Upon the creation of a custom image, a snapshot is automatically created and associated with the image. As a result, retaining custom images incurs costs. For more information, please see Billing Overview.

    Notes

    • Each region supports a maximum of 10 custom images.
    • The following directories and files will be cleared.
      • /var/log/
      • /root/.bash_history and /home/ubuntu/.bash_history (for the Ubuntu operating system)
    • When the Linux instance has a data disk mounted, and you only create an image on the system disk, make sure /etc/fstab does not include data disk configuration. Otherwise, instances created with this image cannot be started normally.
    • The creation process takes ten minutes or longer, which depends on the data size of the instance. Please prepare in advance to avoid business impacts.
    • You can not create an image by using a CBM instance in the console or via API. You can use CVM to create them.
    • If your Windows instance needs to enter a domain and uses a domain account, please execute Sysprep before creating a custom image to ensure that the SID is unique after the instance enters the domain. For more information, please see Ensuring Unique SIDs for CVMs Using Sysprep.

    Directions

    Shut down an instance (optional)

    1. Log in to the CVM console and check whether the corresponding instance needs to be shut down.
      Note

      For CVMs created based on public images after July 2018, you can create images without shutting down the instance. For other CVMs, shut down the instance before creating a custom image to ensure that the image has the same environment deployment as the current instance.

      • If the instance needs to be shut down, proceed to the next step.
      • If the instance doesn’t need to be shut down, please proceed to Create a custom image.
    2. On the instance management page, proceed according to the actually used view mode:
      • List view: In the row of the target instance, select More > Instance status > Shut down on the right as shown below:
      • Tab view: Select Shut down on the instance details page.

    Create a custom image

    1. On the instance management page, proceed according to the actually used view mode:
      • List view: Select More > Create image.
      • Tab view: Select More actions > Create image in the top-right corner.
    2. In the Create a custom image popup window, complete the configuration.
      • Image name and Image description: Custom name and description.
      • Tag: You can add tags for the instance as needed, which are used to categorize, search for, and aggregate cloud resources. For more information, see Overview.
      • Create only system disk image: To use the feature, please submit a ticket to apply for it.
        If your instance only has a system disk, this option will not appear. If your instance has a data disk, select it as needed.
        • If checked, only a system disk image of the instance will be created.
        • If unchecked, a data disk snapshot will be created at the same time when the instance has a data disk mounted.
    3. Click Create image.
      You can click Image on the left sidebar to view the creation progress in the Image page.

    Use the custom image to create an instance (optional)

    Select the image you created in the image list, and click Create instance on the right side to purchase a server with the same configuration as the image, as shown in the following figure:

    Best Practices

    Migrating the data on a data disk

    If you need to keep the data on the data disk of the original instance when launching a new instance, you can first take a snapshot of the data disk, and then use this data disk snapshot to create a new CBS data disk.
    For more information, please see Creating Cloud Disks Using Snapshots.

    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support