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 disk size must be a multiple of 93 GB.
Creating a stand-alone non-replicated disk
-
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 a name for the disk. The naming requirements are as follows:
- It must be 2 to 63 characters long.
- It may contain lowercase Latin letters, numbers, and hyphens.
- It must start with a letter and cannot end with a hyphen.
-
Add a description for the disk, if required.
-
Select the availability zone the disk will be in.
-
Select
Non-replicated SSD
as the disk type. -
Select the required block size.
-
Specify the required disk size.
-
Optionally, under Encryption:
- Select Encrypted disk.
- In the KMS key field, select the key you created earlier. To create a new key, click Create new key.
Warning
You can specify encryption settings only when creating a disk. You cannot disable or change disk encryption.
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.
Alert
If you destroy the key or its version used to encrypt a disk, image, or snapshot, access to the data will be irrevocably lost. For details, see Destroying key versions.
-
Select or set up a schedule for automatically creating disk snapshots, if required. For more information about setting up schedules, see this guide.
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.
-
Click Create disk.
The folder specified in the CLI profile is used by default. You can specify a different folder through the --folder-name
or --folder-id
parameter.
-
See the description of the CLI command for creating disks:
yc compute disk create --help
-
To create a non-replicated disk named
nr-disk
, run this 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: {}
With Terraform
Terraform is distributed under the Business Source License
For more information about the provider resources, see the documentation on the Terraform
If you don't have Terraform, install it and configure the Yandex Cloud provider.
-
In the configuration file, define the non-replicated disk 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:- It must be 2 to 63 characters long.
- It may contain lowercase Latin letters, numbers, and hyphens.
- It must start with a letter and cannot end with a hyphen.
-
size
: Non-replicated disk size, which must be a multiple of 93 GB. -
block_size
: Block size in bytes (minimum storage unit on the disk). The maximum disk size depends on the specified block size. By default, block size is 4 KB for all new disks; 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 relevant provider documentation . -
-
Make sure the configuration files are correct.
-
In the command line, go to the directory where you created the configuration file.
-
Run a check using this command:
terraform plan
If the configuration is correct, the terminal will display a list of resources to create and their parameters. If the configuration contains any errors, Terraform will point them out.
-
-
Deploy the 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 settings 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.
Creating 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 a name for the disk. The naming requirements are as follows:
- It must be 2 to 63 characters long.
- It may contain lowercase Latin letters, numbers, and hyphens.
- It must start with a letter and cannot end with a hyphen.
-
Add a description for the disk, if required.
-
Select the availability zone the disk will be in.
The availability zone for your disk must match the zone of the placement group where you want to create it.
-
Select
Non-replicated SSD
as the disk type. -
Select a disk placement group.
If you select a partition placement group, specify the number of the partition you want to add the disk to.
-
Specify the required disk size.
-
Select or set up a schedule for automatically creating disk snapshots, if required. 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 CLI yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder through the --folder-name
or --folder-id
parameter.
-
See the description of the CLI command for creating disks:
yc compute disk create --help
-
In a placement group, create a non-replicated disk in the default folder using one of these 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
: Partition number in the placement group.
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.