Overview

Last updated: 2020-06-12 14:41:55

    In addition to creating custom images, Tencent Cloud also allows you to import images. You can import an image file in the system disk of the local server or a server on another platform into CVM custom images. After an image is imported, you can use it to create a CVM or reinstall the operating system (OS) for an existing CVM.

    Import Preparations

    Prepare an image file that meets import requirements in advance.

    • Requirements for Linux images:
      Image AttributeRequirements
      OS
      • CentOS, Ubuntu, Debian, CoreOS, OpenSUSE, and SUSE
      • Both 32-bit and 64-bit OSs are supported.
      Image format
      • RAW, VHD, QCOW2, and VMDK
      • Run qemu-img info imageName | grep 'file format' to check the image format.
      File systemGPT partition is not supported
      Image size
      • The actual image size cannot exceed 50 GB. Run qemu-img info imageName | grep 'disk size' to check the actual image size.
      • The image vsize cannot exceed 500 GB. Run qemu-img info imageName | grep 'virtual size' to check the image vsize.
      Note: when an image is imported, the size of the image in QCOW2 format prevails.
      Network
      • Tencent Cloud provides the eth0 network interface for the instance by default.
      • You can use the metadata service in the instance to check the network configuration of the instance. For more information, see Instance Metadata.
      Driver
      KernelThe native kernel is preferred for an image. Any modifications on the kernel may cause a failure in importing the image into the CVM.
    • Requirements for Windows images:
      Image AttributeRequirements
      OS
      • Windows Server 2008, Windows Server 2012, and Windows Server 2016 related versions
      • Both 32-bit and 64-bit OSs are supported.
      Image format
      • RAW, VHD, QCOW2, and VMDK
      • Run qemu-img info imageName | grep 'file format' to check the image format.
      File system type
      • Only NTFS with MBR partitions is supported.
      • GPT partitions are not supported.
      • Logical Volume Manager (LVM) is not supported.
      Image size
      • The actual image size cannot exceed 50 GB. Run qemu-img info imageName | grep 'disk size' to check the actual image size.
      • The image vsize cannot exceed 500 GB. Run qemu-img info imageName | grep 'virtual size' to check the image vsize.
      Note: when an image is imported, the size of the image in qcow2 format prevails.
      Network
      • Tencent Cloud provides the Local Area Connection network interface for the instance by default.
      • You can use the metadata service in the instance to check the network configuration of the instance. For more information, see Instance Metadata.
      DriverThe Virtio driver of the visualization platform KVM must be installed for the image. The Virtio driver is not installed in the Windows OS by default. You can install the Virtio driver for Windows and then export the local image.
      OthersImported Windows images do not provide the Windows license activation service.

    Directions

    1. Log in to the CVM console.
    2. In the left sidebar, click Images.
    3. Select Custom Image and click Import Image.
    4. Enable Cloud Object Storage, and then create a bucket. Upload the image file to the bucket and obtain the image file URL.
    5. Click Next.
    6. Complete the form based on the actual situation and click Import.

      Ensure that the entered COS file URL is correct.

      You will be notified whether the import is successful through internal messages.

    Failed Import

    Images may fail to be imported in the console. If the import fails, troubleshoot as follows:

    Notes

    Before troubleshooting, ensure that you have subscribed to product service notifications on the message subscription page. This ensures that you can receive internal messages, SMS messages, and emails about the causes of the failure.

    If you do not subscribe to product service notifications, you will not receive messages about the import result.

    Troubleshooting

    For more information on error messages and descriptions, see [Error Codes](# errorcode).

    InvalidUrl: invalid COS URL

    The InvalidUrl error indicates that an incorrect COS URL is entered on the import page. The possible causes include:

    • The image URL that you entered is not a Tencent Cloud Object Storage image URL.
    • The access permission of the COS file is private read, and the signature has expired.

      A COS file URL with the signature can be accessed only once.

    • A COS URL of another region has been entered.

      The image import service accesses the COS server in the local region through a VPC instance.

    • The user's image file has been deleted.
      After you receive the error message stating that the COS URL is invalid, troubleshoot based on the preceding causes.

    InvalidFormatSize: invalid format or size

    The InvalidFormatSize error indicates that the format or size of the image to be imported does not meet the following requirements of the Tencent Cloud's image import feature:

    • Supported image file formats are qcow2,vhd, vmdk, andraw.
    • The actual image file size cannot exceed 50 GB (based on the converted image file in qcow2 format).
    • The size of the system disk to which the image is imported cannot exceed 500 GB.

    After you receive an error message stating that the format or size is invalid:

    • Convert the image file into an appropriate format according to Linux Image Creation, reduce the image size to meet the size requirements, and then reimport it.
    • You can also use the offline instance migration feature to migrate the instance. This feature supports the migration of an image file with a size up to 500 GB.

    VirtioNotInstall: the Virtio driver is not installed

    The VirtioNotInstall error indicates that the image to be imported does not have the Virtio driver installed. Tencent Cloud uses the KVM virtualization technology and requires users to install the Virtio driver on the image to be imported. Except for a few customized Linux OSs, most Linux OSs have the Virtio driver installed. In Windows OSs, users need to manually install the Virtio driver:

    CloudInitNotInstalled: the cloud-init program is not installed

    The CloudInitNotInstalled error indicates that the image to be imported does not have the cloud-init program installed. Tencent Cloud uses the open-source cloud-init program to initialize the CVM. If the cloud-init program is not installed, the CVM will fail to be initialized.

    PartitionNotPresent: partition information is lost

    The PartitionNotPresent error indicates that the imported image is incomplete. In this case, check whether the boot partition was included when the image was created.

    RootPartitionNotFound: the root partition is lost

    The RootPartitionNotFound error indicates that the root partition cannot be detected in the image to be imported. In this case, check the image file. The possible causes include:

    • The installation package is uploaded.
    • The data disk image is uploaded.
    • The boot partition image is uploaded.
    • An incorrect file is uploaded.

    InternalError: unknown error

    The InternalError error indicates that the image import service does not record the cause of the error. In this case, contact our customer service. Our technical personnel will help you resolve the issue as soon as possible.

    Error Codes

    Error Code Reason Recommended Solution
    InvalidUrl The COS link is invalid. Check whether the COS URL is the same as the imported image URL.
    InvalidFormatSize The format or size does not meet requirements. Images need to meet the image format and image size requirements described in Import Preparations.
    VirtioNotInstall The Virtio driver is not installed. Install the Virtio driver in the image by referring to the Driver section in Import Preparations.
    PartitionNotPresent Partition information is not found. The image is corrupted possibly due to an incorrect image creation method.
    CloudInitNotInstalled The cloud-init program is not installed. Install cloud-init in the Linux image by referring to the Driver section in Import Preparations.
    RootPartitionNotFound The root partition is not found. The image is corrupted possibly due to an incorrect image creation method.
    InternalError An internal error other than the preceding ones occurs. Contact our customer service.

    Was this page helpful?

    Was this page helpful?

    • Not at all
    • Not very helpful
    • Somewhat helpful
    • Very helpful
    • Extremely helpful
    Send Feedback
    Help