Help & DocumentationCloud Block StorageCloud Disk Life CycleAuto-mounting Data Disks When Starting Up A New Instance

Auto-mounting Data Disks When Starting Up A New Instance

Last updated: 2017-11-24 15:53:46

PDF

Automatically mount data disks (linux) when using custom image and data disk snapshot to start a new instance

When starting new CVM instances, if a user specifies a custom image anddata disk snapshot, the Cloud Block Storage of Tencent Cloud can support automatic mounting after a CVM instance is started (which means reading and writing for data disks can be achieved directly without the need to perform a series of operations including adding, partitioning and formatting). Users need to perform several operations on the original instances before making custom images and data disk snapshots. Details of these operations will be described below.

In a Linux system, if a user hopes that the Cloud Block Storage generated by a specified data disk snapshot can automatically mount new CVM instances, the specified custom image and data disk snapshot must meet the following requirements:

  • The data disk should be formatted before a snapshot is made for it, namely it was successfully mounted to the original CVM.
  • Before an image is made for the system disk, the following commands need to be added to the /etc/rc.local file so that data disk mount points are written in the file:
mkdir -p <mount-point>
mount <device-id> <mount-point>

Note: Input the mount point of the file system in <mount-point>, such as /mydata, and input the actual location of file on the partition in <device-id>, such as /dev/vdb (The device name without partitions and with a file system) and /dev/vdb1 (The device name with both a file system and partitions).

Only if the two requirements above are both satisfied can the new Linux CVM instance data disk be automatically recognized and mounted.


Automatically mounting data disk (windows) when using custom image and data disk snapshot to start a new instance

When starting new CVM instances, if a user specifies a custom image anddata disk snapshot, the Cloud Block Storage of Tencent Cloud can support automatic mounting after a CVM instance is started (which means reading and writing for data disks can be achieved directly without the need to perform a series of operations including adding, partitioning and formatting). Users need to perform several operations on the original instances before making custom images and data disk snapshots. Details of these operations will be described below.

In a Windows system, if a user hopes that the Cloud Block Storage generated by a specified data disk snapshot can automatically mount new CVM instances, the specified custom image and data disk snapshot must meet the following requirements:

  • The SAN policy in the custom image is onlineAll. The Windows public images currently provided by Tencent Cloud have been configured accordingly by default, but users are recommended to check the configuration before making custom images.

  • Data disks should be formatted into ntfs or fat32 before snapshots are made.

Only if the two requirements above are both satisfied can the new Windows CVM instance data disk be automatically recognized and made online.