tencent cloud


Attaching Cloud Disks

Last updated: 2022-05-16 15:19:13


    You can attach elastic cloud disks to a CVM instance in the same availability zone as a data disk. Up to 20 data disks can be attached to a CVM instance.

    This document describes how to attach cloud disks to a CVM instance in the console and by using an API.


    Some Linux CVMs may not recognize an elastic cloud disk. You must first enable the disk hot swapping feature in the CVM. For more information, see Enabling the disk hot swapping feature.


    Attaching cloud disks in the CBS console

    1. Log in to the CBS console.
    2. On the cloud disk list page, select and attach the cloud disks. Note that you can only attach cloud disks in To be attached status.
    • Attach a single cloud disk: Find the target cloud disk, and click More > Attach under the Operation column.
    • Attach multiple cloud disks: Select the cloud disks, and click Attach above the cloud disk list to attach them in a batch.
    1. In the Attach to instance pop-up window, attach the disks to the instance.

    Select the target instance, and complete the parameters Billing options.

    • Unified expiry time with the instance (XXX)
    • Enable monthly auto-renewal of the cloud disks (recommended)
    • Attach directly
    1. Click Next, and note the following in Subsequent operations:
      The cloud disk is offline after being manually attached. To use it, you need to log in to the instance to initialize it first.
    2. Click Attach now.
      If the status of the cloud disk changes to Attached, the attachment is successful.
    3. Perform the subsequent operations corresponding to different cloud disk capacities.
      Creation mode Cloud disk capacity Subsequent operations
      Manually created Cloud disk capacity < 2 TB Initializing cloud disks (< 2 TB)
      Cloud disk capacity ≥ 2 TB Initializing cloud disks (≥ 2 TB)
      Created from a snapshot Cloud disk capacity = Snapshot capacity
      • Attach to Windows CVMs Log in to the instance, and go to Server Manager Storage Disk Management to make the disk online.
      • Attach to Linux CVMs: Log in to the instance, and run the command mount , such as mount /dev/vdb /mnt, to make the disk usable.
      Snapshot capacity < Cloud disk capacity ≤ 2 TB
      2 TB < Snapshot capacity < Cloud disk capacity
      Snapshot capacity ≤ 2 TB < Cloud disk capacity

    Using the API to attach cloud disks

    You can use the AttachDisks API to attach cloud disks. For more information, see AttachDisks.

    Enabling the disk hot swapping feature

    All existing images already support attaching and detaching elastic cloud disks. To detach a cloud disk, you must first run the umount command in Linux CVM or perform offline operations in Windows CVM. Otherwise, the reattached elastic cloud disk may not be recognized.


    Hot swapping is only recommended for CVMs with the following operating systems.

    Operating systemVersion
    CentOS5.11 64-bit
    5.11 32-bit
    5.8 64-bit
    5.8 32-bit
    Debian6.0.3 32-bit
    Ubuntu10.04 64-bit
    10.04 32-bit
    openSUSE12.3 64-bit
    12.3 32-bit
    1. Log in to the Linux instance using Web Shell as the root user.
    2. Run the following command to add the driver.
      modprobe acpiphp
    1. (Optional) If you need to load the acpiphp module automatically after shutting down or re-starting the CVM, run the following command according to the operating system.
      1. Run the following command to create and open the acpiphp.modules file.
        vi /etc/sysconfig/modules/acpiphp.modules
      2. Add the following content to the file, and save it.
        modprobe acpiphp >& /dev/null
      3. Run the following command to grant execute permissions on the file.
        chmod a+x /etc/sysconfig/modules/acpiphp.modules

    Attaching data disks automatically upon instance creation

    If you specify a custom image and data disk snapshot while creating a CVM instance, the cloud disk created at the same time is automatically attached to the CVM and can be read and written without being initialized by partitioning, formatting and other operations. However, the specified custom images and data disk snapshots must meet the following requirements.

    If you use a custom image to create a Windows CVM instance, the cloud disk created from the corresponding data disk snapshot will be automatically attached. The custom image and the data disk snapshot must meet the following requirements:

    • The data disk must be formatted to ntfs or fat32 before you create a snapshot.
    • The SAN policy in the custom image is onlineAll.

    Checking configurations

    Tencent Cloud provides pre-configured public images for Windows by default, but we still recommend that you perform the following steps to check configurations before creating a custom image. Please run the following commands in order and check the returned results.



    As shown below:

    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