tencent cloud

Feedback

Overview

Last updated: 2024-10-25 15:36:38
    In addition to creating a custom image, Tencent Cloud allows you to import images. You can import an image file of the system disk on a local or a different server into CVM custom images. You can use the imported image to create a CVM or reinstall the operating system for an existing CVM.

    Import Preparation

    Prepare an image file that meets the import requirements.
    Linux System Type Image Limit
    Windows System Type Image Limit
    Image Attributes
    Condition
    Operating system
    Images based on CentOS, CentOS Stream, Ubuntu, Debian, RedHat, OpenSUSE, CoreOS, FreeBSD, Kylin (Kirin), UnionTech, TencentOS, Fedora, AlmaLinux, Rocky Linux, OpenCloudOS, and Other Linux release version
    Support 32-bit, 64-bit, and arm_64-bit.
    Image format
    Support image formats of RAW, VHD, QCOW2, and VMDK.
    Use qemu-img info imageName | grep 'file format' to check the image format.
    For image files of other formats, you may refer to Converting Image Format to convert and then import them.
    File system and partition
    Support xfs, ext3, and ext4 file systems, and support MBR and GPT partitions.
    Note:
    Support the ext4 file system, but cannot include the feature 64bit. The features project and quota cannot appear in pairs. You can run the following command to view the list of features included in the ext4 file system.
    tune2fs -l <ext4 file system disk path> | grep features
    It is not recommended for the system disk to have multiple partitions. We recommend a single root partition only. If there are multiple partitions, it is not recommended to have other partitions after the one where the system resides. Otherwise, disk expansion will fail.
    It is not recommended to use LVM to create system disk partitions (root partition), as it may lead to issues such as instance startup, password modification, and SSH login via password.
    Image size
    The actual image size must not exceed 1024 GB. Use qemu-img info imageName | grep 'disk size' to check the actual image size;
    The image vsize must not exceed 1024 GB. Use qemu-img info imageName | grep 'virtual size' to check the image vsize.
    Note: When importing an image, review the size of the image after converting it to QCOW2 format.
    Network
    Tencent Cloud provides the eth0 network interface by default for instances.
    Users can query the instance's network configuration through the metadata service within the instance. For details, see Instance Metadata.
    Driver
    The image must install the Virtio driver for the virtualization platform KVM. For details, see Linux Import Image Check Virtio Driver.
    The image needs to install cloud-init. For details, see Linux Import Image Install cloud-init.
    If the image cannot install cloud-init for other reasons, refer to Force Importing Image to configure the instance manually.
    File system
    To ensure that the Linux system can correctly identify the disk when the file system is started, check and correctly configure the GRUB file disk identification method. For details, see Configure the GRUB file disk identification method to UUID.
    To ensure that the Linux system can correctly identify the disk when the file system is mounted, check and correctly configure the fstab file disk identification method. For details, see Configure the fstab file disk identification method to UUID.
    Kernel
    We recommend a native kernel for the image. Kernel modification may cause the CVM to fail to import.
    Region limit
    The image import service outside the Chinese mainland only supports COS files in the same region. That is, a COS link in the same region needs to be used for import.
    Image Attributes
    Condition
    Operating system
    Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012, Windows Server 2008, and Other Windows-related versions
    Support 32-bit, 64-bit, and arm_64-bit.
    Image format
    Support RAW, VHD, QCOW2, and VMDK image formats.
    Use qemu-img info imageName | grep 'file format' to check the image format.
    File system and partition
    Support NTFS file system, and support MBR and GPT partitions.
    Support creation of multiple partitions on the system disk.
    Ensure that no other partitions exist after the boot partition (C Drive) on the disk where the system resides, otherwise the instance may fail to start or the disk expansion may fail.
    Image size
    The actual image size must not exceed 1024 GB. Use qemu-img info imageName | grep 'disk size' to check the actual image size.
    The image vsize must not exceed 1024 GB. Use qemu-img info imageName | grep 'virtual size' to check the image vsize.
    Note: When importing an image, review the size of the image after converting it to qcow2 format.
    Network
    Tencent Cloud provides the local connection network interface for instances by default.
    Users can query the instance's network configuration through the metadata service within the instance. For details, see Instance Metadata.
    Driver
    Images must install the Virtio driver for the virtualization platform KVM. Windows system by default does not have the Virtio driver installed. Users can install the Windows Virtio driver and then export the local image. The download address for the Windows Virtio driver is as follows (download according to your actual network environment):
    Public network download address: http://mirrors.tencent.com/install/windows/virtio_64_1.0.9.exe
    Private network download address: http://mirrors.tencentyun.com/install/windows/virtio_64_1.0.9.exe
    Region limit
    The image import service outside the Chinese mainland only supports COS files in the same region. That is, a COS link in the same region needs to be used for import.
    Others
    The imported Windows system image does not provide Windows activation service.

    Directions

    1. Log in to the CVM console and click Images on the left sidebar.
    2. Select Custom image and click Importing an image.
    3. As prompted in the operation interface, first enable COS, and then create a bucket. Uploading an Object the image file to the bucket and get the image file URL.
    4. Click Next.
    5. Complete the configurations and click Import.
    Parameter
    Required
    Description
    Region
    Yes
    Ensure that the region of the custom image you need to import matches the region where you need to create an instance. Custom images from this region cannot be directly used to create instances in other regions. If you need to use the current image in another region, you can replicate your custom image across regions through image replication.
    System Disk Files
    Yes
    The system disk files contain the critical components such as the kernel, library files, and drivers needed for the server operating system. By using the system disk files, the server can start and run the operating system to provide basic services and features.
    Import method:
    Select the storage from the COS list.
    In the drop-down list, select the COS bucket where the file is contained, and then select the corresponding image file. The system will automatically obtain the URL of the image file. Note that only COS files within the local domain can be selected in this way.
    Enter the COS object address.
    Go to the COS console, find the bucket from Bucket List where the image file is located, and find the image file step by step. On the image file details page, click Copy Temporary Link to copy the URL of the image file.
    Operating System
    Yes
    1. Linux and Windows operating systems are supported.
    Ensure that it matches the operating system type of the image file.
    2. System platform
    Identifies the operating system platform to which the image file is imported. Ensure that it matches the operating system platform of the image file.
    Linux operating system: CentOS, CentOS Stream,Ubuntu, Debian, RedHat, and other commonly used system platforms can be selected. If the system platform is not listed, select Other Linux.
    Windows operating system: Windows Server 2022, Windows Server 2019, and other commonly used system platforms can be selected. If the system platform is not listed, select Other Windows.
    3. System Version
    Identifies the version of the Linux operating system to which the image file is imported. For example, CentOS supports multiple versions, including 8, 7, 6, and 5. Ensure that it matches the operating system version of the image file.
    4. System Architecture
    32-bit, 64-bit, and ARM 64-bit are supported. Ensure that it matches the system architecture of the image file.
    Data Disk Files
    (only available in the open beta after you contact customer service and apply for that)
    No
    The data disk files are used to store user data such as application data, user documents and database files. If your image has data disk files, add a data disk by configuring this.
    Import method:
    Select the storage from the COS list.
    In the drop-down list, select the COS bucket where the file is contained, and then select the corresponding image file. The system will automatically obtain the URL of the image file. Note that only COS files within the local domain can be selected in this way.
    Enter the COS object address.
    Go to the COS console, find the bucket from Bucket List where the image file is located, and find the image file step by step. On the image file details page, click Copy Temporary Link to copy the URL of the image file.
    Image Name
    Yes
    The image name displayed after the image file is imported. Note that the image name only supports Chinese characters, letters, digits, hyphens (-), underscores (_), and periods (.), with a maximum of 60 characters.
    Image Description
    No
    Add image description for easy management.
    Tag
    No
    Set a tag to facilitate search and management.
    More configuration items:
    Parameter
    Required
    Description
    Import Method
    No
    If your image cannot be imported correctly, you can select the Enable Forcible Import option. This method only checks the integrity of the file and will not block the import process due to driver or configuration issues. For details, see Forcibly Importing Image.
    Boot Mode
    Yes
    Ensure that the selected boot mode matches the boot mode of the image file. Otherwise, using this image may affect the normal startup of your instance. For details, see Best Practices for Boot Mode Legacy BIOS and UEFI.
    You will be notified about the import result via Message Center.

    Import Failed

    After you import images in the console, the task may fail for some reasons. In case of task failure, you can check the error code in the Console or Message Center and troubleshoot according to the following content.
    Error Code
    Reason
    Recommended Solution
    InvalidUrl
    The entered COS link is invalid. Possible reasons are as follows:
    The entered image file link is not a Tencent Cloud COS link.
    The object address of the COS has no permission for public read and private write.
    The access permission of COS files is private read, but the signature has expired.
    When an image is imported outside the Chinese mainland, a COS link not in the same region was used; the image import service outside the Chinese mainland only supports COS servers in the same region.
    The current COS file has been deleted.
    Check whether the COS link matches the imported image link.
    InvalidFormatSize
    The format or size of the imported image does not conform to the restrictions of Tencent Cloud image import feature.
    Imported images support image file formats of qcow2, vhd, vmdk, and raw.
    The size of the system disk image should not exceed 1024 GB, and a single data disk should not exceed 2048 GiB (based on the image file converted to qcow2 format)
    The image must meet the restrictions on image format and image size specified in Import Preparation.
    According to the image format conversion content of Linux Image Creation, convert the image file into an appropriate file format and simplify the image content to meet the size requirements, and then re-import the image.
    For files exceeding the size limit, images can also be migrated using the Offline Instance Migration feature.
    VirtioNotInstall
    Virtio driver not installed:
    Tencent Cloud uses KVM virtualization technology and requires users to install the Virtio driver in the image to be imported. Except for a few customized Linux operating systems, most Linux operating systems have the Virtio driver installed; Windows operating systems require users to manually install the Virtio driver.
    For Linux image import, see Checking Virtio Drivers in Linux.
    For Windows image import, see Creating Windows Images to install the Virtio driver.
    CloudInitNotInstalled
    cloud-init not installed:
    Tencent Cloud uses the open-source program cloud-init for CVM initialization. Therefore, CVM initialization will fail if the cloud-init program is not installed.
    For Linux image import, see Installing Cloud-Init on Linux.
    For Windows image import, see Installing Cloudbase-Init on Windows.
    PartitionNotPresent
    Partition information is not found, and the imported image is incomplete.
    The image is corrupted. Check if the boot partition was included when creating the image. It may be caused due to an incorrect image creation method.
    RootPartitionNotFound
    The imported image does not contain a root partition. Possible reasons are as follows:
    The installation package was uploaded;
    The data disk image was uploaded;
    The boot partition image was uploaded;
    An incorrect file was uploaded.
    The image is corrupted. It may be caused due to an incorrect image creation method.
    InternalError
    Other errors
    Contact Customer Service for assistance.

    Test Result Explanation and Suggestions for Fix

    Image import will automatically detect image availability. You can view the image import results in the console. We recommend refining the image according to the test results to ensure feature availability.

    Linux Operating System Inspection Items and Instructions

    Inspection Items
    Inspection Instructions
    Test Results
    Suggestions for Fix
    Virtio
    Whether the Virtio driver is installed in the image
    Supported - Satisfied
    KernelNotSupported - Kernel not supported
    BlkDriverNotFound - Disk driver not found
    NetDriverNotFound - Network driver not found
    Strongly recommended to fix:
    For details about how to fix, refer to Checking Virtio Drivers in Linux.
    CloudInit
    Whether cloud-init is installed in the image
    Supported - Satisfied
    NotSupported - Not supported
    Strongly recommended to fix:
    For details about how to fix, refer to Installing cloud-init on Linux.
    CloudinitConfig
    Whether cloud-init is configured correctly
    Supported - Satisfied
    Invalid - cloud.cfg content cannot be loaded
    InvalidCloudFinalModules - scripts-user not found in the cloud_final_modules configuration
    InvalidDatasourceList - ConfigDrive not found in datasource_list
    Strongly recommended to fix:
    1. Modify the cloud-init configuration file: Download cloud.cfg based on different operating systems.
    Click here to download cloud.cfg for Ubuntu operating system.
    Click here to download cloud.cfg for CentOS operating system.
    Click here to download cloud.cfg for OpenSUSE / SUSE operating system.
    2. Replace the content of /etc/cloud/cloud.cfg with that of the downloaded cloud.cfg file.
    Fstab
    The file /etc/fstab in the image is configured with system disk device mounting information. Incorrect configurations may cause system startup exceptions, such as device mounting information not existing or incorrect device UUID.
    Supported - Satisfied
    DeviceNotFound - The configuration contains a non-existent device
    DeviceConfig - /dev/vd* configuration is used
    Recommended fix:
    1. If your operating system is not FreeBSD, refer to Configure the fstab file disk identification method to UUID to fix.
    2. If your operating system is FreeBSD.
    Add Label.
    # Set Label
    tunefs -L root /dev/da3
    # View results
    ls /dev/ufs/root
    Modify /etc/fstab.
    # File backup
    cp /etc/fstab /etc/fstab.bak
    # Change to
    vim /etc/fstab
    Modify the result.
    /dev/ufs/home / ufs rw 2 2
    Grub
    Whether the grub boot file in the image is normal. For example, if device configurations are abnormal, related devices do not exist, or there are UUID errors, it may cause a system startup anomaly.
    Do not check this item when the image is FreeBSD.
    Supported - Satisfied
    NotSupported - Not configured using UUID
    Recommended fix:
    Selinux
    Whether SELinux is disabled for the image. It is not recommended to enable SELinux for cloud images, as it may cause a system startup anomaly.
    Do not check this item when the image is FreeBSD.
    Supported - Satisfied
    ConfigNotFound - The /etc/selinux/config file does not exist when SELinux is enabled
    Enforcing - Highest level enabled
    Recommended fix:
    Suggestions for fix
    # Switch to the root user
    vim /etc/selinux/config
    Change to
    # This file controls the state of SELinux on the system.
    # SELINUX= can take one of these three values:
    # enforcing - SELinux security policy is enforced.
    # permissive - SELinux prints warnings instead of enforcing.
    # disabled - No SELinux policy is loaded.
    SELINUX=permissive
    # SELINUXTYPE= can take one of these two values:
    # targeted - Targeted processes are protected,
    # mls - Multi Level Security protection.
    SELINUXTYPE=targeted
    
    OnlineResizeFS
    Whether the image supports root partition automatic scaling. The image has cloud-init, growpart (gpart, parted, growpart) commands installed. After the image is used to create an instance, the root partition will automatically scale. For example, if your image space size is 20 GB, and the system disk size is 100 GB during instance creation, the root partition will automatically scale to 100 GB after the instance is created.
    Supported - Satisfied
    NotSupported - Not supported
    Recommended fix:
    When the operating system is CentOS 6, CentOS 7, or TencentOS Server 2 version.
    # root user
    yum install cloud-utils-growpart
    When the operating system is CentOS 8, CentOS Stream, Rocky Linux, or TencentOS Server 3 version.
    # root user
    dnf -y install cloud-utils-growpart
    When the operating system is Ubuntu.
    # root user
    apt-get install cloud-guest-utils
    Network
    Whether the network configuration in the image complies with the cloud-init standard.
    Only Debian and Ubuntu operating systems need to checked.
    Supported - Satisfied
    Unsupported - Not supported
    Recommended fix:
    /etc/network/interfaces must contain source /etc/network/interfaces.d/*
    SupportBareMachine
    Whether the image supports Bare Metal.
    Supported - Satisfied
    Unsupported - Not supported
    Optional fix:
    If you are not using Bare Metal instances, do not need to pay attention to; if the image does not meet the requirements for Bare Metal instances, you can contact customer service for assistance.
    TimeSync
    Whether NTP is installed to maintain time synchronization.
    Supported - Satisfied
    Unsupported - Not supported
    Optional fix:
    When the operating system is CentOS 6, CentOS 7, or TencentOS Server 2 version.
    # root user
    yum install ntpd
    When the operating system is CentOS 8, CentOS Stream, Rocky Linux, or TencentOS Server 3 version.
    # root user
    dnf install chrony
    When the operating system is Ubuntu.
    # root user
    apt-get install ntp

    Windows Operating System Inspection Items and Instructions

    Inspection Items
    Inspection Instructions
    Test Results
    Suggestions for Fix
    Virtio
    Whether the Virtio driver is installed in the image
    Supported - Satisfied
    BlkDriverNotFound - Disk driver not found
    Strongly recommended to fix:
    For details about how to fix, refer to section Checking or Installing Virtio Drivers in Creating Windows Images.
    Cloudbase
    Whether cloudbase is installed in the image
    Supported - Satisfied
    NotSupported - Not supported
    Strongly recommended to fix:
    For details about how to fix, refer to Installing Cloudbase-Init on Windows.
    CloudbaseConfig
    Whether cloudbase is configured correctly
    Supported - Satisfied
    NotSupported - Not supported
    Strongly recommended to fix: For details about how to fix, refer to Modify the cloudbase-init configuration file.
    SupportBareMachine
    Whether the image supports Bare Metal
    Supported - Satisfied
    NotSupported - Not supported
    Optional fix:
    If you are not using Bare Metal instances, do not need to pay attention to; if the image does not meet the requirements for Bare Metal instances, you can contact customer service for assistance.
    Self-service driver download address:
    The downloaded file is a ZIP file. After extraction, right-click the bnxtnd.inf file and select Install.
    
    
    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