Creating a non-replicated disk
You can create a stand-alone non-replicated disk or add such a disk to a disk placement group.
The size of the disk must be a multiple of 93 GB.
Create a separate non-replicated disk
-
In the management console
, select the folder to host your disk. -
Select Compute Cloud.
-
In the left-hand panel, select
Disks. -
Click Create disk.
-
Enter the disk name. The naming requirements are as follows:
- The name must be from 3 to 63 characters long.
- It may contain lowercase Latin letters, numbers, and hyphens.
- The first character must be a letter and the last character cannot be a hyphen.
-
Add a disk description, if required.
-
Select the availability zone to place the disk in.
-
Select
Non-replicated SSD
as the disk type. -
Select the required block size.
-
Specify the required disk size.
-
(Optional) To encrypt a disk, under Disks and file storages, configure encryption parameters for the disk:
- Select the Encrypted disk option.
- In the KMS Key field, select the key with which you want to encrypt the disk. To create a new key, click Create.
The encryption feature in Compute Cloud is currently at the Preview stage. To access it, open the resource creation page and click Request access under Encryption or contact support
.If you deactivate the key used to encrypt a disk or snapshot, access to the data will be suspended until you reactivate the key.
Alert
If you destroy the key or its version used to encrypt a disk or snapshot, access to the data will be irrevocably lost. Learn more in Destroying key versions.
-
If required, select a schedule to automatically create snapshots, or create a new one. For more information about setting up schedules, see this guide.
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.
-
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.
-
View the description of the CLI command to create disks:
yc compute disk create --help
-
To create a non-replicated disk named
nr-disk
, run the command:yc compute disk create \ --name nr-disk \ --type network-ssd-nonreplicated \ --size 93
Result:
done (1s) id: epdb2517b970******** folder_id: b1g7gvsi89m3******** ... block_size: "4096" status: READY disk_placement_policy: {}
Terraform
For more information about the provider resources, see the documentation on the Terraform
If you change the configuration files, Terraform automatically detects which part of your configuration is already deployed, and what should be added or removed.
If you don't have Terraform, install it and configure the Yandex Cloud provider.
-
In the configuration file, describe the non-replicated disk's parameters:
resource "yandex_compute_disk" "nr" { name = "<non-replicated_disk_name>" size = <non-replicated_disk_size> block_size = <block_size> type = "network-ssd-nonreplicated" zone = "<availability_zone>" }
Where:
-
name
: Non-replicated disk name. The naming requirements are as follows:- The name must be from 3 to 63 characters long.
- It may contain lowercase Latin letters, numbers, and hyphens.
- The first character must be a letter and the last character cannot be a hyphen.
-
size
: A non-replicated disk's size must be a multiple of 93 GB. -
block_size
: Block size in bytes (the minimum storage size for information on the disk). The maximum disk size depends on the specified block size. 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. -
type
: Disk type. Specifynetwork-ssd-nonreplicated
to create a non-replicated disk. -
zone
: Availability zone.
For more information about the
yandex_compute_disk
resource parameters in Terraform, see the provider documentation . -
-
Make sure the configuration files are correct.
-
In the command line, go to the folder where you created the configuration file.
-
Run a 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.
-
-
Deploy cloud resources.
-
If the configuration does not contain any errors, run this command:
terraform apply
-
Confirm creating the resources: type
yes
in the terminal and press Enter.All the resources you need will then be created in the specified folder. You can check the new resources and their configuration using the management console
or this CLI command:yc compute disk list
-
Use the create REST API method for the Disk resource or the DiskService/Create gRPC API call.
Create a non-replicated disk in a placement group
You can only create a disk in an existing disk placement group.
-
In the management console
, select the folder where you want to create a disk. -
Select Compute Cloud.
-
In the left-hand panel, select
Disks. -
Click Create disk.
-
Enter the disk name. The naming requirements are as follows:
- The name must be from 3 to 63 characters long.
- It may contain lowercase Latin letters, numbers, and hyphens.
- The first character must be a letter and the last character cannot be a hyphen.
-
Add a disk description, if required.
-
Select the availability zone to host the disk.
The availability zone for a disk must be the same as that of the placement group where you want to create the disk.
-
Select
Non-replicated SSD
as the disk type. -
Select a disk placement group.
If you select a group with the partition placement, specify the number of the partition you want to add the disk to.
-
Specify the required disk size.
-
If required, select a schedule for automatic snapshot creation, or set up a new schedule. For more information about setting up schedules, see this guide.
If you want to set another schedule, you can add it after the disk is created.
-
Click Create disk.
If you do not have the Yandex Cloud command line interface yet, install and initialize it.
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.
-
View a description of the CLI command to create disks:
yc compute disk create --help
-
In a placement group, create a non-replicated disk in the default folder using one of the strategies:
-
yc compute disk create \ --name <disk_name> \ --type network-ssd-nonreplicated \ --size <disk_size> \ --disk-placement-group-name <placement_group_name>
Where:
--name
: Disk name--type
: Disk type--size
: Disk size--disk-placement-group-name
: Placement group name
Result:
done (1s) id: epdtncic35ru******** folder_id: b1g7gvsi89m3******** ... status: READY disk_placement_policy: placement_group_id: epdn946ilslh********
-
yc compute disk create \ --name <disk_name> \ --type network-ssd-nonreplicated \ --size <disk_size> \ --disk-placement-group-name <placement_group_name> \ --disk-placement-group-partition <partition_number>
Where:
--name
: Disk name--type
: Disk type--size
: Disk size--disk-placement-group-name
: Placement group name--disk-placement-group-partition
: Placement group partition number
Result:
done (1s) id: epdtncic35ru******** folder_id: b1g7gvsi89m3******** ... disk_placement_policy: placement_group_id: epdn946ilslh******** placement_group_partition: 2
-
Use the create REST API method for the Disk resource or the DiskService/Create gRPC API call.