Configuring disk snapshot schedules
You can configure snapshot schedules for your disk:
Adding a schedule to a disk
You can create snapshots of network drives, such as HDDs, SSDs, and non-replicated SSDs, as well as ultra-high performance network storages with three replicas (SSD).
For non-replicated SSDs and ultra-high performance network storages with three replicas (SSD), the snapshot time is not determined.
To take snapshots of local disks residing on dedicated hosts, use Yandex Cloud Backup. This service supports Ubuntu, CentOS, CentOS Stream, and Windows Server.
- In the management console
, select the folder containing the disk. - Select Compute Cloud.
- Open the
Disks tab and select the disk. - Under Snapshot schedules, click
Edit snapshot schedules. - Choose a schedule or create a new one. For more information about setting up schedules, see this guide.
- Click Save.
If you do not have the Yandex Cloud command line interface yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name
or --folder-id
parameter.
-
View the description of the CLI commands for managing disks and schedules:
yc compute disk --help yc compute snapshot-schedule --help
-
Get IDs of disks that are in the default folder:
yc compute disk list --format yaml
Result:
- id: epdcq9g3co9s******** folder_id: e1ea8s8l71li******** created_at: "2022-10-13T14:37:44Z" name: disk-2 type_id: network-hdd zone_id: ru-central1-a size: "21474836480" block_size: "4096" product_ids: - f2euv1kekdgv******** status: READY source_image_id: fd88d14a6790******** instance_ids: - ephothb6lppn******** disk_placement_policy: {} - id: fhm7mip40dqh******** folder_id: e1ea8s8l71li******** created_at: "2022-10-10T05:00:04Z" name: disk-1 type_id: network-hdd zone_id: ru-central1-a size: "21474836480" block_size: "4096" product_ids: - f2euv1kekdgv******** status: READY source_image_id: fd88d14a6790******** instance_ids: - fhm1c7u23aiq******** disk_placement_policy: {}
For more information about the
yc compute disk list
command, see the CLI reference.To get a list of disks added to a given schedule, you can also use the command:
yc compute snapshot-schedule list-disks <schedule_name_or_ID>
See here for more information.
-
Get the name or ID of the schedule:
yc compute snapshot-schedule list --format yaml
Result:
- id: fc852cvb1ipd5******** folder_id: e1ea8s8l71li******** created_at: "2022-09-28T13:25:02Z" name: sched-1 status: ACTIVE schedule_policy: start_at: "2022-10-01T00:00:00Z" expression: 59 14 */1 * * snapshot_spec: {} - id: fc89n1j15l7f******** folder_id: e1ea8s8l71li******** created_at: "2022-09-27T16:04:13Z" name: sched-2 status: ACTIVE schedule_policy: start_at: "1970-01-01T00:00:00Z" expression: 0 */1 * * * retention_period: 3600s snapshot_spec: {} - id: fc8bplhqmh2b******** folder_id: b8gauskl78li******** created_at: "2022-10-03T13:28:01Z" name: sched-3 description: Daily labels: machine: file-server status: ACTIVE schedule_policy: start_at: "2022-12-31T19:04:05Z" expression: 10 19 ? * * snapshot_count: "7" snapshot_spec: {}
If you do not have a schedule, create one.
-
Add one or several disks to the schedule:
yc compute snapshot-schedule add-disks <schedule_name_or_ID> \ --disk-id <disk_1_ID>,<disk_2_ID>
Result:
done (3s) id: fc8e52mvchb2******** folder_id: e1iaui8l7kli******** created_at: "2022-09-28T09:15:28Z" name: sched-1 status: ACTIVE
Detaching a schedule from a disk
- In the management console
, select the folder containing the disk. - Select Compute Cloud.
- Open the
Disks tab and select the disk. - In the row with the schedule under Snapshot schedules, click
and select Detach from disk.
If you do not have the Yandex Cloud command line interface yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name
or --folder-id
parameter.
-
View the description of the CLI commands for managing disks and schedules:
yc compute disk --help yc compute snapshot-schedule --help
-
Get the name or ID of the schedule:
yc compute snapshot-schedule list --format yaml
Result:
- id: fc852cvb1ipd5******** folder_id: e1ea8s8l71li******** created_at: "2022-09-28T13:25:02Z" name: sched-1 status: ACTIVE schedule_policy: start_at: "2022-10-01T00:00:00Z" expression: 59 14 */1 * * snapshot_spec: {} - id: fc89n1j15l7f******** folder_id: e1ea8s8l71li******** created_at: "2022-09-27T16:04:13Z" name: sched-2 status: ACTIVE schedule_policy: start_at: "1970-01-01T00:00:00Z" expression: 0 */1 * * * retention_period: 3600s snapshot_spec: {} - id: fc8bplhqmh2b******** folder_id: e1ea8s8l71li******** created_at: "2022-10-03T13:28:01Z" name: sched-3 description: Daily labels: machine: file-server status: ACTIVE schedule_policy: start_at: "2022-12-31T19:04:05Z" expression: 10 19 ? * * snapshot_count: "7" snapshot_spec: {}
-
Get a list of disks used in the current schedule:
yc compute snapshot-schedule list-disks <schedule_name_or_ID> \ --format yaml
Result:
- id: epdcq9g3co9s******** folder_id: e1ea8s8l71li******** created_at: "2022-10-13T14:37:44Z" name: disk-2 type_id: network-hdd zone_id: ru-central1-a size: "21474836480" block_size: "4096" product_ids: - f2euv1kekdgv******** status: READY source_image_id: fd88d14a6790******** instance_ids: - epdothb6lppn******** disk_placement_policy: {} - id: fhm7mip40dqh******** folder_id: e1ea8s8l71li******** created_at: "2022-10-10T05:00:04Z" name: disk-1 type_id: network-hdd zone_id: ru-central1-a size: "21474836480" block_size: "4096" product_ids: - f2euv1kekdgv******** status: READY source_image_id: fd88d14a6790******** instance_ids: - fhm1c7u23aiq******** disk_placement_policy: {}
-
Delete one or more disks from the schedule:
yc compute snapshot-schedule remove-disks <schedule_name_or_ID> \ --disk-id <disk_1_ID>,<disk_2_ID>
Result:
done (3s) id: fc8e52mvchb2******** folder_id: e1ea8s8l71li******** created_at: "2022-09-28T09:15:28Z" name: sched-1 status: ACTIVE