All Products
Search
Document Center

Specify disks

Last Updated: May 10, 2018

1. Specify disks

When submitting a job or creating a cluster, you can specify the size and system disk type of each virtual machine (VMs) 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:

  1. {
  2. ...
  3. "DAG": {
  4. "Tasks": {
  5. "taskName": {
  6. "AutoCluster": {
  7. "InstanceType": "",
  8. "ImageId": "",
  9. "ECSImageId": "",
  10. "Configs": {
  11. "Disks": {
  12. "SystemDisk": {
  13. "Type": "cloud_efficiency",
  14. "Size": 50
  15. },
  16. "DataDisk": {
  17. "Type": "cloud_efficiency",
  18. "Size": 500,
  19. "MountPoint": "/path/to/mount"
  20. }
  21. }
  22. }
  23. }
  24. ...
  25. }
  26. }
  27. }
  28. ...
  29. }
  • 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

  1. 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.

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

You can also choose to specify only the data disk.

  1. 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.