Yandex Cloud
Search
Contact UsGet started
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • AI for business
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
© 2025 Direct Cursus Technology L.L.C.
Yandex Compute Cloud
    • All guides
      • Creating a snapshot
      • Getting disk snapshot info
      • Deleting a snapshot
      • Creating a snapshot schedule
      • Getting disk snapshot schedule info
      • 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 service resource operations
    • Viewing metrics in Monitoring
    • NVIDIA driver update guide
  • Yandex Container Solution
  • Access management
  • Pricing policy
  • 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 August 6, 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

Note

The disk snapshot you create will get assigned the virtualized hardware generation on which a VM instance can be deployed from this snapshot. You can assign to a snapshot a generation different from the one assigned to the source disk using the Yandex Cloud CLI, Terraform, or API.

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 can only 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 installed yet, install and initialize it.

By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command 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******** \
      --hardware-generation-id <hardware_generation> \
      --hardware-features pci_topology=<PCI_topology>
    

    Where:

    • --name: Snapshot name. The naming requirements are as follows:

      • It must be from 2 to 63 characters long.
      • It can only contain lowercase Latin letters, numbers, and hyphens.
      • It must start with a letter and cannot end with a hyphen.
    • --description: Description of the new snapshot. This is an optional setting.

    • --disk-id: ID of the disk to create the snapshot for. Instead of the disk ID, you can provide its name in the --disk-name parameter.

    • --hardware-generation-id: Virtualized hardware generation assigned to the snapshot. This is an optional setting. The possible values are:

      • legacy: Gen 1. If you select this generation, you can also specify the PCI topology in the --hardware-features parameter.

      If not specified, the snapshot will get the same hardware generation assigned as the source disk.

    • --hardware-features: Additional settings for Gen 1. This is an optional setting. The possible values are:

      • pci_topology=v1: PCI_TOPOLOGY_V1 topology.
      • pci_topology=v2: PCI_TOPOLOGY_V2 topology.

      If the source disk has Gen 1 assigned, by default, the new snapshot will get the same --hardware-features value as the source disk.

    Result:

    done (19s)
    id: fd81qi89ldop********
    folder_id: b1gt6g8ht345********
    created_at: "2025-06-23T09:56:04Z"
    name: first-snapshot
    description: my first snapshot via CLI
    storage_size: "3116367872"
    disk_size: "21474836480"
    product_ids:
      - f2evcrm9ti79********
    status: READY
    source_disk_id: epd8lmcncidv********
    hardware_generation:
      legacy_features:
        pci_topology: PCI_TOPOLOGY_V2
    

If you do not have Terraform yet, install it and configure the 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>"
      hardware_generation {
        legacy_features {
          pci_topology = "<PCI_topology>"
        }
      }
    }
    

    Where:

    • name: Snapshot name. The naming requirements are as follows:

      • It must be from 2 to 63 characters long.
      • It can only contain lowercase Latin letters, numbers, and hyphens.
      • It must start with a letter and cannot end with a hyphen.
    • source_disk_id: ID of the disk to create the snapshot for.

    • hardware_generation: Block of settings describing the virtualized hardware generation assigned to the snapshot. This is an optional setting. It includes the following blocks of settings:

      • legacy_features: Settings with the description of parameters for Gen 1:

        • pci_topology: Selecting the PCI topology. The possible values are:

          • PCI_TOPOLOGY_V1
          • PCI_TOPOLOGY_V2

        The legacy_features and generation2_features sections are mutually exclusive.

      Note

      If the hardware_generation settings are not specified, the snapshot will get the same hardware generation assigned as the source disk.

    For more information about the yandex_compute_snapshot resource, see the relevant provider documentation.

  2. Make sure the configuration files are correct.

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

    2. Run a check using this command:

      terraform plan
      

    If the configuration description is correct, the terminal will display a list of the resources being created and their settings. 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.

    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.

  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. In your request, specify the source disk ID, and optionally the desired virtualized hardware generation in the hardwareGeneration object (hardware_generation if using the gRPC API).

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 disk snapshot info
© 2025 Direct Cursus Technology L.L.C.