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 an empty disk
      • Creating an empty disk with a large block
      • Creating a non-replicated disk
      • Creating a high-performance SSD
      • Recovering a disk from a snapshot
      • Recovering a disk from an image
    • 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
  1. Step-by-step guides
  2. Creating a disk
  3. Recovering a disk from an image

Recovering a disk from an image

Written by
Yandex Cloud
Improved by
Danila N.
Updated at December 3, 2025

Note

You cannot recover a boot disk of an existing VM from a snapshot or image. However, you can create a new VM to recover a boot disk from a snapshot. To recover the boot disk of an existing VM, use Yandex Cloud Backup.

To create a disk from an image:

Management console
CLI
Terraform
API
  1. In the management console, select the folder where you want to create a disk.

  2. Go to Compute Cloud.

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

  4. Click Create disk.

  5. Enter a name for the disk.

    • 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 disk, if required.

  7. Select the availability zone the disk will reside in.

  8. In the Contents field, select Image and select an image from the list. Optionally, use the filter.

  9. Set the disk parameters: disk type, disk size, and block size.

  10. Optionally, under Encryption:

    • Select Encrypted disk.
    • In the KMS key field, select the key you created earlier. To create a new key, click Create.

    To create an encrypted disk, you need the kms.keys.user role or higher.

    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.

    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, you will irrevocably lose access to the data. For details, see Destroying key versions.

  11. Optionally, select or create a schedule for automatic disk snapshots. For more information about setting up schedules, see this guide.

    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.

    When creating a disk, you can only select a single snapshot schedule. After the disk is created, you can add a few more schedules by following this guide.

  12. Optionally, expand the Additional section and, in the Hardware generation field, select the virtualized hardware generation you want to assign to the new disk:

    • Gen 1.2 (MBR, BIOS): Gen 1.2.
    • Gen 1.1 (MBR, BIOS): Gen 1.1.

    If you make no assignment, by default the disk will get the same generation assigned as the source image.

  13. Click Create disk.

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. View the description of the CLI command to create a disk:

    yc compute disk create --help
    
  2. Get a list of images in the default folder:

    yc compute image list
    

    Result:

    +----------------------+------------+--------+----------------------+--------+
    |          ID          |    NAME    | FAMILY |     PRODUCT IDS      | STATUS |
    +----------------------+------------+--------+----------------------+--------+
    | fd8ool134m70******** | test-image |        | f2e3eaei7io3******** | READY  |
    | fd8u2d7plgpu******** | image-2    |        |                      | READY  |
    +----------------------+------------+--------+----------------------+--------+
    
  3. Select ID or NAME of the image you need.

  4. Create a disk from the selected image:

    yc compute disk create \
      --name <disk_name> \
      --source-image-name <source_image_name> \
      --zone <availability_zone> \
      --description <text_description_of_disk> \
      --hardware-generation-id <hardware_generation> \
      --hardware-features pci_topology=<PCI_topology> \
      --kms-key-id <key_ID>
    

    Where:

    • --name: Disk name. Follow these naming requirements:

      • 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-image-name: Source image name. Instead of a name, you can provide the source image ID in the --source-image-id parameter.

    • --zone: Availability zone of the new disk.

    • --description: Text description of the new disk. This is an optional setting.

    • --hardware-generation-id: Virtualized hardware generation assigned to the disk. 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 disk will get the same hardware generation assigned as the source image.

    • --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: Adopts the PCI_TOPOLOGY_V2 topology.

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

    • --kms-key-id: ID of the Yandex Key Management Service symmetric encryption key for creating an encrypted disk. This is an optional setting.

      To create an encrypted disk, you need the kms.keys.user role or higher.

      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.

      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, you will irrevocably lose access to the data. For details, see Destroying key versions.

    Result:

    done (50s)
    id: epdoljps3ljd********
    folder_id: b1gt6g8ht345********
    created_at: "2025-06-23T17:25:56Z"
    name: first-disk
    description: my very first disk
    type_id: network-hdd
    zone_id: ru-central1-a
    size: "21474836480"
    block_size: "4096"
    product_ids:
      - f2ercusam4no********
    status: READY
    source_image_id: fd8it9g4ui2l********
    disk_placement_policy: {}
    hardware_generation:
      legacy_features:
        pci_topology: PCI_TOPOLOGY_V2
    

    For more information about the yc compute disk create command, see this CLI reference.

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

    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  |                      |                 |             |
    +----------------------+--------------+-------------+-------------------+--------+----------------------+-----------------+-------------+
    

    Get the same list with more details in YAML format:

    yc compute disk list --format yaml
    

    Result:

    - id: epdoljps3ljd********
      folder_id: b1gt6g8ht345********
      created_at: "2025-06-23T17:25:56Z"
      name: first-disk
      description: my very first disk
      type_id: network-hdd
      zone_id: ru-central1-a
      size: "21474836480"
      block_size: "4096"
      product_ids:
        - f2ercusam4no********
      status: READY
      source_image_id: fd8it9g4ui2l********
      disk_placement_policy: {}
      hardware_generation:
        legacy_features:
          pci_topology: PCI_TOPOLOGY_V2
    - id: epd8lmcncidv********
      folder_id: b1gt6g8ht345********
      created_at: "2025-06-23T06:32:26Z"
      name: second-disk
      type_id: network-ssd
      zone_id: ru-central1-a
      size: "21474836480"
      block_size: "4096"
      product_ids:
        - f2evcrm9ti79********
      status: READY
      source_image_id: fd80j21lmqar********
      instance_ids:
        - epdm2ene322e********
      disk_placement_policy: {}
      hardware_generation:
        legacy_features:
          pci_topology: PCI_TOPOLOGY_V1
    

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

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

    Here is the configuration file example:

    resource "yandex_compute_disk" "my-disk" {
      name           = "<disk_name>"
      zone           = "<availability_zone>"
      image_id       = "<image_ID>"
      hardware_generation {
        legacy_features {
          pci_topology = "<PCI_topology>"
        }
      }
    }
    

    Where:

    • name: Disk name. Follow these naming requirements:

      • 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.
    • zone: Availability zone of the new disk.

    • image_id: ID of the image you are creating the disk based on.

    • hardware_generation: Block of settings describing the virtualized hardware generation assigned to the disk. 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 disk will get the same hardware generation assigned as the source image.

    For more information about the yandex_compute_disk 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 images using the list REST API method for the Image resource or the ImageService/List gRPC API call.
  2. Create a disk using the create REST API method for the Disk resource or the DiskService/Create gRPC API call. In your request, specify the source image ID, and optionally the required hardware generation in the hardwareGeneration object (hardware_generation if using the gRPC API).

Once created, the disk will get the CREATING status. Wait until the disk status changes to READY before using it.

See alsoSee also

  • Creating a VM from a custom image
  • Attaching a disk to a VM and mounting partitions
  • Yandex Cloud Backup overview

Was the article helpful?

Previous
Recovering a disk from a snapshot
Next
Updating a disk
© 2025 Direct Cursus Technology L.L.C.