All Products
Search
Document Center

Batch Compute:Specify disks

Last Updated:Feb 20, 2024

1. Specify disks

When submitting a job or creating a cluster, you can specify the size and system disk type of each virtual machine (VM) and optionally attach a data disk.

1.1. Write JSON file to submit a job

When submitting a job in JSON format, define the disk type and size in the AutoCluster field of each task:

{
  ...
  "DAG": {
    "Tasks": {
      "taskName": {
        "AutoCluster": {
            "InstanceType": "",
            "ImageId": "",
            "ECSImageId": "",
            "Configs": {
                "Disks": {
                    "SystemDisk": {
                        "Type": "cloud_efficiency",
                        "Size": 50
                    },
                    "DataDisk": {
                        "Type": "cloud_efficiency",
                        "Size": 500,
                        "MountPoint": "/path/to/mount"
                    }
                }
            }
        }
        ...
      }
    }
  }
  ...
}
  • Currently SystemDisk and DataDisk must be set to the same type. For example, if Type of SystemDisk is cloud_ssd, Type of DataDisk must also be cloud_ssd.

  • If the Type field of a disk is null, the system automatically selects the default disk type, making it easier to use.

  • MountPoint must be specified for a data disk. In a Linux operating system, a data disk can be attached to a directory; in a Windows operating system, a data disk can only be attached to a drive, for example, drive E (E:).

1.2. Use command line tool to submit a job

bcs sub "echo 123" --disk system:cloud_efficiency:40,data:cloud_efficiency:500:/home/disk1
  • The system disk configuration is in the following format: system:[cloud_efficiency|cloud_ssd|cloud|ephemeral|default]:[40, 500]. For example, system:cloud_efficiency:40 indicates that a 40 GB ultra cloud disk is attached to the system disk.

  • The data disk configuration is in the following format: data:[cloud_efficiency|cloud_ssd|cloud|ephemeral|default]:[5, 2000]:[mount-point]. For example, data:cloud_efficiency:500:/home/disk1 indicates that a 500 GB ultra cloud disk is attached as a data disk. In a Windows operating system, the data disk can only be attached to a drive, for example, drive E: data:cloud_efficiency:500:E.

  • If you select the default configuration, the system automatically selects the default disk type. The default disk type is recommended for applications that do not have special requirements on disk performance.

  • NOTE: If the data disk type is set to ephemeral, the disk size is in the range of [5, 1024] GB.

You can choose to specify only the system disk.

bcs sub "echo 123" --disk system:cloud_efficiency:40

You can also choose to specify only the data disk.

bcs sub "echo 123" --disk data:default:500:/home/disk1

2. Available disk types

Batch Compute service supports different disk types in different regions. For Batch Compute-specific instances with names starting with BCS, the disk type must be set to ephemeral. For more information about disk type selection for ECS instances, see ECS Instance type families.