Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
    • Yandex Cloud Partner program
  • Blog
  • Pricing
  • Documentation
© 2025 Direct Cursus Technology L.L.C.
Yandex Compute Cloud
    • All guides
      • Creating a snapshot
      • Getting information about a disk snapshot
      • Deleting a snapshot
      • Creating a snapshot schedule
      • Getting information about a disk snapshot schedule
      • Changing a snapshot schedule
      • Disabling and enabling a snapshot schedule
      • Encrypting an image
      • Configuring disk snapshot access permissions
      • Configuring snapshot schedule access permissions
      • Deleting a snapshot schedule
    • Viewing operations with resources
  • Yandex Container Solution
  • Access management
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Release notes

In this article:

  • Preparation steps
  • Creating a snapshot
  1. Step-by-step guides
  2. Disk snapshots
  3. Creating a snapshot

Creating a disk snapshot

Written by
Yandex Cloud
Improved by
Danila N.
Updated at May 5, 2025
  • Preparation steps
  • Creating a snapshot

A disk snapshot is a copy of the disk file system at a specific point in time.

You can create snapshots of network disks 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, use Yandex Cloud Backup. This service supports Ubuntu, CentOS, CentOS Stream, and Windows Server.

Preparation stepsPreparation steps

A disk snapshot only contains the data that was written to the disk at the time its snapshot was created. If the disk is attached to a running VM, the OS and app cache will not be included in the snapshot.

To ensure the snapshot data integrity:

Linux
Other operating systems
  1. Stop all disk write operations in applications.

  2. Write the OS cache to the disk:

    sync
    
  3. Freeze the file system:

    sudo fsfreeze --freeze <mount_point>
    

    Where --freeze is the parameter to freeze the file system. Replace <mount_point> with the folder where the file system is mounted, e.g., /mnt/vdc2.

  4. Create a snapshot by following the steps below.

  5. Unfreeze the file system:

    sudo fsfreeze --unfreeze <mount_point>
    

    Where --unfreeze is the parameter to unfreeze the file system. Replace <mount_point> with the folder where the file system is mounted, e.g., /mnt/vdc2.

  1. Stop the VM (see Stopping).
  2. Wait until the VM status changes to STOPPED.

Creating a snapshotCreating a snapshot

To create a disk snapshot:

Management console
CLI
Terraform
API
  1. In the management console, select the folder containing the disk.

  2. Select Compute Cloud.

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

  4. In the line with the disk, click and select Create snapshot.

  5. Enter a name for the snapshot. The naming requirements are as follows:

    • It must be from 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.
  6. Provide a description for the snapshot, if required.

  7. Click Create.

If you do not have the Yandex Cloud CLI yet, install and initialize it.

The folder specified when creating the CLI profile is used by default. To change the default folder, use the yc config set folder-id <folder_ID> command. You can specify a different folder using the --folder-name or --folder-id parameter.

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

    yc compute snapshot create --help
    
  2. Select the disk to create a snapshot of. To get a list of disks in the default folder, run this command:

    yc compute disk list
    

    Result:

    +----------------------+--------------+-------------+-------------------+--------+----------------------+-----------------+-------------+
    |          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  |                      |                 |             |
    +----------------------+--------------+-------------+-------------------+--------+----------------------+-----------------+-------------+
    
  3. Create a snapshot in the default folder:

    yc compute snapshot create \
      --name first-snapshot \
      --description "my first snapshot via CLI" \
      --disk-id fhm4aq4hvq5g********
    

    This will create a disk snapshot named first-snapshot and described as my first snapshot via CLI.

    The snapshot naming requirements are as follows:

    • It must be from 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.

If you do not have Terraform yet, install it and configure its Yandex Cloud provider.

  1. Define the parameters of the yandex_compute_snapshot resource in the configuration file.

    Here is an example of the configuration file structure:

    resource "yandex_compute_snapshot" "snapshot-1" {
      name           = "disk-snapshot"
      source_disk_id = "<disk_ID>"
    }
    

    For more information about the resources you can create with Terraform, see the relevant provider documentation.

  2. Make sure the configuration files are correct.

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

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

  3. Deploy the cloud resources.

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

      terraform apply
      
    2. Confirm creating the resources.

    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.

  1. Get a list of disks using the list REST API method for the Disk resource or the DiskService/List gRPC API call.
  2. Create a snapshot using the create REST API method for the Snapshot resource or the SnapshotService/Create gRPC API call.

HDD or SSD snapshots are created asynchronously. The snapshot is created as soon as you run the create command and gets the Creating status. You can now resume writing data to the disk, as further disk operations will not affect the data in the snapshot.

Once the snapshot creation is complete, the snapshot status will change to Ready. You can now use the snapshot to create images, disks, and more.

Alert

When creating a snapshot or image in Linux, the UUID and PARTUUID of disk partitions are saved. Linux uses this data when mounting partitions, including the root one, so these IDs must be unique. For example, if you clone a boot disk and attach it to the same VM, the VM will have two partitions with identical UUIDs. As a result, the VM may boot from the root partition of the wrong disk, rather than the one you specified as the boot disk.

To avoid this, attach the disk to the VM and change all duplicate UUIDs. For more information, see Attaching a disk to a VM.

See alsoSee also

  • Creating a disk snapshot schedule
  • Recovering a disk from a snapshot

Was the article helpful?

Previous
Deleting a disk
Next
Getting information about a disk snapshot
© 2025 Direct Cursus Technology L.L.C.