Nebius Israel
Contact usConsole
  • GPU
  • Docs
© 2023 Nebius Israel Ltd
Compute Cloud
  • Container Solution
  • Access management
  • Pricing policy
  1. Step-by-step guides
  2. Creating a disk
  3. Creating an empty disk

Creating an empty disk

You can create an empty disk of the specified size.

Management console
CLI
API
Terraform
  1. In the management console, select the folder where you want to create a disk.

  2. Select Compute Cloud.

  3. In the left-hand panel, select Disks.

  4. Click Create disk.

  5. Enter the disk name.

    • The length can be from 3 to 63 characters.
    • It may contain lowercase Latin letters, numbers, and hyphens.
    • The first character must be a letter. The last character can't be a hyphen.
  6. Add a disk description, if required.

  7. Select the availability zone to place the disk in.

  8. Select the desired disk type: HDD, SSD, SSD IO, or Non-replicated SSD.

  9. Select the desired block size (the minimum chunk used to store data on the disk). By default, the block size of all created disks is 4 KB; however, this is not enough for disks larger than 8 TB.

  10. Specify the desired disk size. The maximum disk size depends on the specified block size.

  11. If required, select a schedule to automatically create snapshots, or create a new one. For more information about setting up schedules, see the instructions.

    You can create snapshots of network drives, such as HDDs, SSDs, non-replicated SSDs, and high-performance SSDs. While taking a snapshot, high-performance and non-replicated SSDs are not available for writes.

    When creating a disk, you can select only one snapshot schedule. After the disk is created, you can add a few more schedules, if required, by following this guide.

  12. Click Create disk.

The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name or --folder-id parameter.

  1. See the description of the CLI's create disk commands:

    yc compute disk create --help
    
  2. Create a disk in the default folder:

    yc compute disk create \
      --name first-disk \
      --size 10 \
      --description "my first disk via yc"
    

    This command creates a 10 GB disk with the name first-disk and description my first disk via yc.

    • The length can be from 3 to 63 characters.
    • It may contain lowercase Latin letters, numbers, and hyphens.
    • The first character must be a letter. The last character can't be a hyphen.
  3. Get a list of disks in the default folder:

    yc compute disk list
    

    Result:

    +----------------------+--------------+-------------+-------------------+--------+----------------------+-----------------+-------------+
    |          ID          |     NAME     |    SIZE     |       ZONE        | STATUS |     INSTANCE IDS     | PLACEMENT GROUP | DESCRIPTION |
    +----------------------+--------------+-------------+-------------------+--------+----------------------+-----------------+-------------+
    | a7lqgbt0bb9s******** | first-disk   | 20401094656 |   il1-a   | READY  | a7lcvu28njbh******** |                 |             |
    | a7lv5j5hm1p1******** | second-disk  | 21474836480 |   il1-a   | READY  |                      |                 |             |
    +----------------------+--------------+-------------+-------------------+--------+----------------------+-----------------+-------------+
    

    Get the same list with more details in YAML format:

    yc compute disk list --format yaml
    

    Result:

    - id: fhm4aq4hvq5g3nepvt9b
        folder_id: b1gm3og7ei7aegv8i73m
        created_at: "2018-10-29T07:43:06Z"
        name: first-disk
        description: my first disk via yc
        type_id: network-hdd
        zone_id: il1-a
        size: "10737418240"
        status: READY
    - id: fhmo6rdqg5folrc3lsaf
        folder_id: b1gm3og7ei7aegv8i73m
        created_at: "2018-10-29T07:33:04Z"
        name: second-disk
        description: my second disk via yc
        type_id: network-hdd
        zone_id: il1-a
        size: "8589934592"
        product_ids:
        - f2en2dtd08b5la74mlde
        status: READY
        source_image_id: fdvk34al8k5nltb58shr
        instance_ids:
        - fhm5b617fjnj44ovhcun
    

Use the create REST API method for the Disk resource or the DiskService/Create gRPC API call.

If you do not have Terraform yet, install it and configure the Nebius Israel provider.

To create an empty disk:

  1. Describe the resource parameters in the yandex_compute_disk configuration file.

    Example of the configuration file structure:

    resource "yandex_compute_disk" "empty-disk" {
      name       = "empty-disk"
      type       = "network-hdd"
      zone       = "<availability_zone>"
      size       = <disk_size>
      block_size = <block_size>
    }
    

    Where:

    • name: Disk name. The name format is as follows:

      • The length can be from 3 to 63 characters.
      • It may contain lowercase Latin letters, numbers, and hyphens.
      • The first character must be a letter. The last character can't be a hyphen.
    • type: Type of the disk being created.

    • zone: Availability zone. The availability zone for a disk must be the same as that of the placement group where you want to create the disk.

    • size: Disk size in GB. The maximum disk size depends on the specified block size.

    • block_size: Block size in bytes (the minimum storage size for information on the disk). By default, the block size of all created disks is 4 KB; however, this is not enough for disks larger than 8 TB. For more information, see Creating an empty disk with a large block.

    For more information about the yandex_compute_disk resource, see the provider documentation.

  2. Make sure that the configuration files are valid.

    1. In the command line, go to the directory where you created the configuration file.

    2. Run the check using this command:

      terraform plan
      

    If the configuration is described correctly, the terminal will display a list of created resources and their parameters. If the configuration contains any errors, Terraform will point them out.

  3. Deploy cloud resources.

    1. If the configuration does not contain any errors, run this command:

      terraform apply
      
    2. Confirm that you want to create the resources.

    All the resources you need will then be created in the specified folder. You can verify that the resources are there and their configuration is correct using the management console or the following CLI command:

    yc compute disk list
    

See alsoSee also

  • Creating a disk snapshot schedule
© 2023 Nebius Israel Ltd