[Yandex Cloud documentation](../../../index.md) > [Yandex Compute Cloud](../../index.md) > [Step-by-step guides](../index.md) > Creating a disk > Creating an empty disk

# Creating an empty disk

You can create an empty disk of the specified size.

{% list tabs group=instructions %}

- Management console {#console}

  1. In the [management console](https://console.yandex.cloud), select the folder where you want to create a disk.
  1. Navigate to **Compute Cloud**.
  1. In the left-hand panel, select ![image](../../../_assets/console-icons/hard-drive.svg) **Disks**.
  1. Click **Create disk**.
  1. Enter a name for the disk. The naming requirements are as follows:

      * Length: between 3 and 63 characters.
      * It can only contain lowercase Latin letters, numbers, and hyphens.
      * It must start with a letter and cannot end with a hyphen.

  1. Add a description for the disk, if required.
  1. Select the [availability zone](../../../overview/concepts/geo-scope.md) the disk will reside in.
  1. Select the required disk type: `HDD`, `SSD`, `SSD IO`, or `Non-replicated SSD`.


  1. Select the required block size (minimum storage unit on the disk). By default, the block size is 4 KB for all new disks; however, this is insufficient for disks larger than 8 TB.
  1. Specify the disk size. The maximum disk size depends on the specified block size.
  1. Optionally, under **Encryption**:
     
       * Select **Encrypted disk**.
       * In the **KMS key** field, select the [key](../../../kms/concepts/key.md) you created earlier. To [create](../../../kms/operations/key.md#create) a new key, click **Create**.
     
       To create an encrypted disk, you need the `kms.keys.user` [role](../../../kms/security/index.md#kms-keys-user) or higher.
     
       {% note warning %}
       
       You can specify encryption settings only when creating a disk. You cannot disable or change disk encryption. You also cannot enable encryption for an existing disk.
       
       {% endnote %}
       
       If you deactivate the key used to encrypt a disk, image, or snapshot, access to the data will be suspended until you reactivate the key.
       
       {% note alert %}
       
       If you destroy the key or its [version](../../../kms/concepts/version.md) used to encrypt a disk, image, or snapshot, you will irrevocably lose access to the data. For details, see [Destroying key versions](../../../kms/concepts/version.md#version-distruct).
       
       {% endnote %}
  1. Optionally, select or create a [schedule](../../concepts/snapshot-schedule.md) for automatic disk [snapshots](../../concepts/snapshot.md). For more information on schedule settings, see [this guide](../snapshot-control/create-schedule.md).

     You can create snapshots of network [disks](../../concepts/disk.md#disks_types) and drives, such as HDDs, SSDs, and non-replicated SSDs, as well as ultra high-speed network storages with three replicas (SSD).
     
     For non-replicated SSDs and ultra high-speed network storages with three replicas (SSD), the snapshot time is not determined.
     
     To create snapshots of local disks residing on [dedicated hosts](../../concepts/dedicated-host.md), use [Yandex Cloud Backup](../../../backup/index.md). This service supports Ubuntu, CentOS, CentOS Stream, and Windows Server.

     When creating a disk, you can only select a single snapshot schedule. After the disk is created, you can add a few more schedules, if required, by following [this guide](../disk-control/configure-schedule.md#add-schedule).

  1. Click **Create disk**.

- CLI {#cli}

  The folder used by default is the one specified when [creating](../../../cli/operations/profile/profile-create.md) the CLI profile. To change the default folder, use the `yc config set folder-id <folder_ID>` command. You can also specify a different folder for any command using `--folder-name` or `--folder-id`. If you access a resource by its name, the search will be limited to the default folder. If you access a resource by its ID, the search will be global, i.e., through all folders based on access permissions.

  1. See the description of the CLI commands for creating disks:

      ```bash
      yc compute disk create --help
      ```

  1. Create a disk in the default folder:

      ```bash
      yc compute disk create \
        --name first-disk \
        --size 10 \
        --description "my first disk via yc" \
        --kms-key-id <key_ID>
      ```

      Where:

      * `--name`: Disk name. The disk naming requirements are as follows:

          * Length: between 3 and 63 characters.
          * It can only contain lowercase Latin letters, numbers, and hyphens.
          * It must start with a letter and cannot end with a hyphen.

      * `--size`: Disk size.
      * `--description`: Disk description.
      * `--kms-key-id`: ID of the [KMS symmetric key](../../../kms/concepts/key.md) to create an encrypted disk. This is an optional setting.

        To create an encrypted disk, you need the `kms.keys.user` [role](../../../kms/security/index.md#kms-keys-user) or higher.
        
        {% note warning %}
        
        You can specify encryption settings only when creating a disk. You cannot disable or change disk encryption. You also cannot enable encryption for an existing disk.
        
        {% endnote %}

        If you deactivate the key used to encrypt a disk, image, or snapshot, access to the data will be suspended until you reactivate the key.
        
        {% note alert %}
        
        If you destroy the key or its [version](../../../kms/concepts/version.md) used to encrypt a disk, image, or snapshot, you will irrevocably lose access to the data. For details, see [Destroying key versions](../../../kms/concepts/version.md#version-distruct).
        
        {% endnote %}

      This command will create a 10 GB disk named `first-disk` and described as `my first disk via yc`.

  1. Get a list of disks in the default folder:

      ```bash
      yc compute disk list
      ```
      
      Result:
      
      ```text
      +----------------------+--------------+-------------+-------------------+--------+----------------------+-----------------+-------------+
      |          ID          |     NAME     |    SIZE     |       ZONE        | STATUS |     INSTANCE IDS     | PLACEMENT GROUP | DESCRIPTION |
      +----------------------+--------------+-------------+-------------------+--------+----------------------+-----------------+-------------+
      | a7lqgbt0bb9s******** | first-disk   | 20401094656 |   ru-central1-a   | READY  | a7lcvu28njbh******** |                 |             |
      | a7lv5j5hm1p1******** | second-disk  | 21474836480 |   ru-central1-a   | READY  |                      |                 |             |
      +----------------------+--------------+-------------+-------------------+--------+----------------------+-----------------+-------------+
      ```

      Get the same list with more details in YAML format:

      ```bash
      yc compute disk list --format yaml
      ```

      Result:
      ```text
      - id: fhm4aq4hvq5g********
          folder_id: b1gm3og7ei7a********
          created_at: "2018-10-29T07:43:06Z"
          name: first-disk
          description: my first disk via yc
          type_id: network-hdd
          zone_id: ru-central1-a
          size: "10737418240"
          status: READY
          disk_placement_policy: {}
          hardware_generation:
            legacy_features:
              pci_topology: PCI_TOPOLOGY_V1
          kms_key:
            key_id: abjbaqdga6hs********
            version_id: abj295dgqnlp********
      - id: fhmo6rdqg5fo********
          folder_id: b1gm3og7ei7a********
          created_at: "2018-10-29T07:33:04Z"
          name: second-disk
          description: my second disk via yc
          type_id: network-hdd
          zone_id: ru-central1-a
          size: "8589934592"
          product_ids:
          - f2en2dtd08b5********
          status: READY
          source_image_id: fdvk34al8k5n********
          instance_ids:
          - fhm5b617fjnj********
          disk_placement_policy: {}
          hardware_generation:
            legacy_features:
              pci_topology: PCI_TOPOLOGY_V1
          kms_key:
            key_id: abjbaqdga6hs********
            version_id: abj295dgqnlp********
      ```

- Terraform {#tf}

  If you do not have Terraform yet, [install it and configure the Yandex Cloud provider](../../../tutorials/infrastructure-management/terraform-quickstart.md#install-terraform).
  
  
  To manage infrastructure using Terraform under a service account or user accounts (a Yandex account, a federated account, or a local user), [authenticate](../../../terraform/authentication.md) using the appropriate method.

  To create an empty disk:
  
  1. Define the parameters of the `yandex_compute_disk` resource in the configuration file.
  
     Here is an example of the configuration file structure:
  
     ```hcl
     resource "yandex_compute_disk" "empty-disk" {
       name       = "empty-disk"
       type       = "network-hdd"
       zone       = "<availability_zone>"
       size       = <disk_size>
       block_size = <block_size>
       kms_key_id = "<KMS_key_ID>"
     }
     ```
  
     Where:
     * `name`: Disk name. The name format is as follows:
  
          * Length: between 3 and 63 characters.
          * It can only contain lowercase Latin letters, numbers, and hyphens.
          * It must start with a letter and cannot end with a hyphen.
  
     * `type`: Disk type.
     * `zone`: [Availability zone](../../../overview/concepts/geo-scope.md). The availability zone for your disk must match the zone of the placement group where you want to create it.
     * `size`: Disk size, in GB. The maximum disk size depends on the specified block size.
     * `block_size`: Block size in bytes (minimum storage unit on the disk). By default, the block size is 4 KB for all new disks; however, this is insufficient for disks larger than 8 TB. For more information, see [Creating an empty disk with a large block](empty-disk-blocksize.md).
     * `kms_key_id`: ID of the [KMS symmetric key](../../../kms/concepts/key.md) to create an [encrypted](../../concepts/encryption.md) disk. This is an optional setting.
  
          To create an encrypted disk, you need the `kms.keys.user` [role](../../../kms/security/index.md#kms-keys-user) or higher.
  
          {% note warning %}
          
          You can specify encryption settings only when creating a disk. You cannot disable or change disk encryption. You also cannot enable encryption for an existing disk.
          
          {% endnote %}
  
          If you deactivate the key used to encrypt a disk, image, or snapshot, access to the data will be suspended until you reactivate the key.
          
          {% note alert %}
          
          If you destroy the key or its [version](../../../kms/concepts/version.md) used to encrypt a disk, image, or snapshot, you will irrevocably lose access to the data. For details, see [Destroying key versions](../../../kms/concepts/version.md#version-distruct).
          
          {% endnote %}
  
     For more information about `yandex_compute_disk`, see [this provider guide](../../../terraform/resources/compute_disk.md).
  
  1. Make sure the configuration files are correct.
  
     1. In the terminal, navigate to the directory where you created your configuration file.
     1. Run a check using this command:
  
        ```bash
        terraform plan
        ```
  
     If the configuration is correct, the terminal will display a list of the resources and their settings. Otherwise, Terraform will show any detected errors. 
  
  1. Deploy the cloud resources.
  
     1. If the configuration is correct, run this command:
  
        ```bash
        terraform apply
        ```
  
     1. Confirm creating the resources.
  
     This will create all the resources you need in the specified folder. You can check the new resources and their settings using the [management console](https://console.yandex.cloud) or this [CLI](../../../cli/quickstart.md) command:
  
        ```bash
        yc compute disk list
        ```

- API {#api}

  Use the [create](../../api-ref/Disk/create.md) REST API method for the [Disk](../../api-ref/Disk/index.md) resource or the [DiskService/Create](../../api-ref/grpc/Disk/create.md) gRPC API call.

{% endlist %}

#### See also {#see-also}

* [Creating a disk snapshot schedule](../snapshot-control/create-schedule.md)