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 Cloud Backup
  • Getting started
    • All guides
    • Activating the service
      • Creating a policy
      • Updating a policy
      • Linking a VM or BareMetal server to a policy
      • Getting information about a policy
      • Unlinking a VM or BareMetal server from a policy
      • Deleting a policy
    • Viewing operations with resources
    • Viewing backup statistics
  • Access management
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Release notes
  • Troubleshooting

In this article:

  • Updating basic settings
  • Updating a list of VMs and Yandex BareMetal servers
  1. Step-by-step guides
  2. Backup policies
  3. Updating a policy

Updating a backup policy

Written by
Yandex Cloud
Improved by
Danila N.
Updated at May 6, 2025
  • Updating basic settings
  • Updating a list of VMs and Yandex BareMetal servers

Note

Backups are created based on the VM's or Yandex BareMetal server's local time. There may be a slight delay in the schedule depending on the current service load.

BareMetal is at the Preview stage.

Updating basic settingsUpdating basic settings

Management console
CLI
Terraform
API
  1. In the management console, select the folder where you want to update a backup policy.

  2. In the list of services, select Cloud Backup.

  3. Navigate to the Backup policies tab.

  4. Click next to the backup policy you want to update and select Edit.

  5. Edit the backup policy parameters:

    • Enter a name. 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.
    • In the Frequency field, select how often backups should be created:

      • Every day: Specify the time for creating backups.
      • Weekly: Specify the days of the week and time for creating backups.
      • Monthly: Specify the months, days of the month, and time for creating backups.
    • Select the type of backup:

      • Incremental: Saves only data that is different from the previous backup.
      • Full: Saves all the VM / BareMetal server data.
    • Select the policy for backup retention:

      • Retain all copies: All backups created under this backup policy will be retained.
      • Only the last: Specify the number of recent backups you want to retain or the number of days, weeks, or months for which to retain the backups. All other backups are deleted automatically.

      If you create the policy via the management console, subsequent changes of backup retention rules will take effect as soon as you create another backup.

  6. Click Save.

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 command to update a backup policy:

    yc backup policy update --help
    
  2. Specify backup policy configuration in JSON format.

    Sample configuration file
    {
      "compression": "NORMAL",
      "format": "AUTO",
      "multiVolumeSnapshottingEnabled": true,
      "preserveFileSecuritySettings": true,
      "reattempts": {
        "enabled": true,
        "interval": {
          "type": "SECONDS",
          "count": "30"
        },
        "maxAttempts": "30"
      },
      "silentModeEnabled": true,
      "splitting": {
        "size": "1099511627776"
      },
      "vmSnapshotReattempts": {
        "enabled": true,
        "interval": {
          "type": "MINUTES",
          "count": "5"
        },
        "maxAttempts": "3"
      },
      "vss": {
        "enabled": true,
        "provider": "TARGET_SYSTEM_DEFINED"
      },
      "archive": {
        "name": "'[Machine Name]-[Plan ID]-[Unique ID]A'"
      },
      "performanceWindow": {
      },
      "retention": {
        "rules": [
          {
            "maxCount": "10"
          }
        ],
        "beforeBackup": true
      },
      "scheduling": {
        "backupSets": [
          {
            "time": {
              "weekdays": [
                "MONDAY"
              ],
              "repeatAt": [
                {
                  "minute": "5"
                }
              ],
              "type": "WEEKLY"
            }
          }
        ],
        "enabled": true,
        "maxParallelBackups": "2",
        "randMaxDelay": {
          "type": "MINUTES",
          "count": "30"
        },
        "scheme": "ALWAYS_INCREMENTAL",
        "weeklyBackupDay": "MONDAY"
      },
      "cbt": "ENABLE_AND_USE",
      "fastBackupEnabled": true,
      "quiesceSnapshottingEnabled": true
    }
    

    The example describes a configuration for a backup policy that will create incremental VM or BareMetal server backups every Monday at 00:05 (UTC+0). Only the last 10 backups will be stored.

    See the full backup policy specification for details.

  3. Get the ID of the backup policy you want to update:

    yc backup policy list
    

    Result:

    +----------------------+----------------------+---------+---------+---------------------+---------------------+
    |          ID          |      FOLDER ID       |  NAME   | ENABLED |     CREATED AT      |     UPDATED AT      |
    +----------------------+----------------------+---------+---------+---------------------+---------------------+
    | abc7n3wln123******** | ghi681qpe789******** | policy1 | true    | 2023-07-03 09:12:02 | 2023-07-03 09:12:43 |
    | deflqbiwc456******** | ghi681qpe789******** | policy2 | true    | 2023-07-07 14:58:23 | 2023-07-07 14:58:23 |
    +----------------------+----------------------+---------+---------+---------------------+---------------------+
    
  4. Update the backup policy by specifying its ID:

    yc backup policy update <backup_policy_ID> \
      --settings-from-file <path_to_configuration_file>
    

    Where --settings-from-file is the path to the backup policy configuration file in JSON format.

    Result:

    id: cbq5rwepukxn********
    name: test2
    created_at: "2023-07-03T08:24:16.735555276Z"
    updated_at: "2023-07-03T08:24:16.746377738Z"
    enabled: true
    settings:
      compression: NORMAL
      format: AUTO
      multi_volume_snapshotting_enabled: true
      preserve_file_security_settings: true
      reattempts:
        enabled: true
        interval:
          type: SECONDS
          count: "30"
        max_attempts: "30"
      silent_mode_enabled: true
      splitting:
        size: "1099511627776"
      vm_snapshot_reattempts:
        enabled: true
        interval:
          type: MINUTES
          count: "5"
        max_attempts: "3"
      vss:
        enabled: true
        provider: TARGET_SYSTEM_DEFINED
      archive:
        name: '''[Machine Name]-[Plan ID]-[Unique ID]A'''
      performance_window: {}
      retention:
        rules:
          - max_count: "10"
        before_backup: true
      scheduling:
        backup_sets:
          - time:
              weekdays:
                - MONDAY
              repeat_at:
                - minute: "5"
              type: WEEKLY
        enabled: true
        max_parallel_backups: "2"
        rand_max_delay:
          type: MINUTES
          count: "30"
        scheme: ALWAYS_INCREMENTAL
        weekly_backup_day: MONDAY
      cbt: ENABLE_AND_USE
      fast_backup_enabled: true
      quiesce_snapshotting_enabled: true
    folder_id: d2q792qpemb4********
    

    For more information about the command, see the CLI reference.

With Terraform, you can quickly create a cloud infrastructure in Yandex Cloud and manage it using configuration files. These files store the infrastructure description written in HashiCorp Configuration Language (HCL). If you change the configuration files, Terraform automatically detects which part of your configuration is already deployed, and what should be added or removed.

Terraform is distributed under the Business Source License. The Yandex Cloud provider for Terraform is distributed under the MPL-2.0 license.

For more information about the provider resources, see the documentation on the Terraform website or mirror website.

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

To edit the basic parameters of a backup policy:

  1. Open the Terraform configuration file and edit the required settings in the yandex_backup_policy resource description fragment:

    Below is an example with the description of the yandex_backup_policy resource in the Terraform configuration
    resource "yandex_backup_policy" "my_policy" {
        archive_name                      = "[<VM_or_BareMetal_server_name>]-[<plan_ID>]-[<unique_ID>]"
        cbt                               = "USE_IF_ENABLED"
        compression                       = "NORMAL"
        fast_backup_enabled               = true
        format                            = "AUTO"
        multi_volume_snapshotting_enabled = true
        name                              = "<backup_policy_name>"
        performance_window_enabled        = true
        preserve_file_security_settings   = true
        quiesce_snapshotting_enabled      = true
        silent_mode_enabled               = true
        splitting_bytes                   = "9223372036854775807"
        vss_provider                      = "NATIVE"
    
        reattempts {
            enabled      = true
            interval     = "1m"
            max_attempts = 10
        }
    
        retention {
            after_backup = false
    
            rules {
                max_age       = "365d"
                repeat_period = []
            }
        }
    
        scheduling {
            enabled              = false
            max_parallel_backups = 0
            random_max_delay     = "30m"
            scheme               = "ALWAYS_INCREMENTAL"
            weekly_backup_day    = "MONDAY"
    
            execute_by_time {
                include_last_day_of_month = true
                monthdays                 = []
                months                    = [1,2,3,4,5,6,7,8,9,10,11,12]
                repeat_at                 = ["04:10"]
                repeat_every              = "30m"
                type                      = "MONTHLY"
                weekdays                  = []
            }
        }
    
        vm_snapshot_reattempts {
            enabled      = true
            interval     = "1m"
            max_attempts = 10
        }
    }
    

    For more information about the yandex_backup_policy resource parameters, see this Terraform article.

  2. Apply the changes:

    1. In the terminal, change to the folder where you edited the configuration file.

    2. Make sure the configuration file is correct using the command:

      terraform validate
      

      If the configuration is correct, the following message is returned:

      Success! The configuration is valid.
      
    3. Run the command:

      terraform plan
      

      The terminal will display a list of resources with parameters. No changes are made at this step. If the configuration contains errors, Terraform will point them out.

    4. Apply the configuration changes:

      terraform apply
      
    5. Confirm the changes: type yes in the terminal and press Enter.

    You can check the updates using the management console or this CLI command:

    yc backup policy get <backup_policy_ID>
    

To update the basic parameters of a backup policy, use the update REST API method for the Policy resource or the PolicyService/Update gRPC API call.

Updating a list of VMs and Yandex BareMetal serversUpdating a list of VMs and Yandex BareMetal servers

Management console
CLI
API
  1. In the management console, select the folder containing the backup policy.
  2. In the list of services, select Cloud Backup.
  3. Navigate to the Backup policies tab.
  4. Select the backup policy where you want to edit the list of VMs or BareMetal servers.
  5. Edit the list of linked resources:
    • To link a new VM or BareMetal server, click Attach a VM and in the window that opens:

      • Depending on the resource you want to link to the backup policy, select the Virtual machines or BareMetal servers tab and select the VM or server from the list.

        If the VM or BareMetal server you want to link to the backup policy is not listed, make sure it is connected to Cloud Backup.

      • Click Attach.

    • To unlink a VM or BareMetal server:

      • Depending on the resource you want to unlink from the backup policy, select the Virtual machines or BareMetal servers tab.
      • In the row with the VM or BareMetal server you want to unlink from the backup policy, click and select Detach VM from policy or Detach server from policy, respectively.
      • In the window that opens, confirm this action.

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. Get the ID of the backup policy in which you want to edit the list of VMs or BareMetal servers:

    yc backup policy list
    

    Result:

    +----------------------+----------------------+---------+---------+---------------------+---------------------+
    |          ID          |      FOLDER ID       |  NAME   | ENABLED |     CREATED AT      |     UPDATED AT      |
    +----------------------+----------------------+---------+---------+---------------------+---------------------+
    | abc7n3wln123******** | ghi681qpe789******** | policy1 | true    | 2023-07-03 09:12:02 | 2023-07-03 09:12:43 |
    | deflqbiwc456******** | ghi681qpe789******** | policy2 | true    | 2023-07-07 14:58:23 | 2023-07-07 14:58:23 |
    +----------------------+----------------------+---------+---------+---------------------+---------------------+
    
  2. Get the IDs of VMs you need to add or delete:

    yc compute instance list
    

    Result:

    +----------------------+---------+---------------+---------+--------------+-------------+
    |          ID          |  NAME   |    ZONE ID    | STATUS  | EXTERNAL IP  | INTERNAL IP |
    +----------------------+---------+---------------+---------+--------------+-------------+
    | jklp0o9i8012******** | my-vm-1 | ru-central1-b | RUNNING | 51.250.**.** | 192.168.*.* |
    | mnoa5s6d8345******** | my-vm-2 | ru-central1-b | RUNNING | 84.201.**.** | 192.168.*.* |
    +----------------------+---------+---------------+---------+--------------+-------------+
    

    To get the BareMetal server IDs, select BareMetal from the list of services of the relevant folder in the management console. The IDs are specified in the server list in the ID field.

  3. Update the list of VMs and BareMetal servers in the backup policy.

    • To link a VM or BareMetal server to a backup policy:

      View a description of the CLI command:

      yc backup policy apply --help
      

      Link your VMs or BareMetal servers to the backup policy by specifying its ID:

      yc backup policy apply <backup_policy_ID> \
        --instance-ids <VM_or_BareMetal_server_IDs>
      

      Where --instance-ids are the IDs of the VMs or BareMetal servers connected to Cloud Backup you need to link to the backup policy. Multiple IDs should be comma-separated.

      For more information about the command, see the CLI reference.

    • To unlink VMs or BareMetal servers from a backup policy:

      View a description of the CLI command:

      yc backup policy revoke --help
      

      Unlink your VMs or BareMetal servers from the backup policy by specifying its ID:

      yc backup policy revoke <backup_policy_ID> \
        --instance-ids <VM_or_BareMetal_server_IDs>
      

      Where --instance-ids are the IDs of the VMs or BareMetal servers you need to unlink from the backup policy. Multiple IDs should be comma-separated.

      For more information about the command, see the CLI reference.

To edit the list of VMs or BareMetal servers backed up according to a backup policy, use the update REST API method for the Policy resource or the PolicyService/Update gRPC API call.

See alsoSee also

  • Deleting a backup policy

Was the article helpful?

Previous
Creating a policy
Next
Linking a VM or BareMetal server to a policy
© 2025 Direct Cursus Technology L.L.C.