Deleting a disk snapshot schedule
To delete a disk snapshot schedule:
- In the management console
, select the folder where the schedule is located. - Select Compute Cloud.
- In the left-hand panel, select
Snapshots. - Go to the Snapshot schedules tab.
- Next to the schedule to delete, click
and select Delete. - Confirm the schedule deletion.
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 schedules:
yc compute snapshot-schedule --help yc compute snapshot-schedule delete --help
-
Get a list of schedules in the default folder:
yc compute snapshot-schedule list --format yaml
Result:
- id: fc852cvb1ipd5******** folder_id: e1ea8s8l71li******** created_at: "2022-09-28T13:25:02Z" ... expression: 10 19 ? * * snapshot_count: "7" snapshot_spec: {}
-
Delete the selected schedule:
yc compute snapshot-schedule delete <name_or_ID_of_the_schedule>
Result:
done (5s)
If you don't have Terraform, install it and configure the Yandex Cloud provider.
-
Open the Terraform configuration file and delete the fragment with the schedule description:
Sample schedule description in the Terraform configuration
resource "yandex_compute_snapshot_schedule" "default" { name = "my-name" schedule_policy { expression = "0 0 * * *" } snapshot_count = 1 snapshot_spec { description = "snapshot-description" labels = { snapshot-label = "my-snapshot-label-value" } } disk_ids = ["test_disk_id", "another_test_disk_id"] }
-
Apply the changes:
-
In the terminal, change to the folder where you edited the configuration file.
-
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.
-
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.
-
Apply the configuration changes:
terraform apply
-
Confirm the changes: type
yes
in the terminal and press Enter.
-
You can check the schedule deletion using the management console
yc compute snapshot-schedule list
- Get the list of schedules using the list REST API method for the SnapshotSchedule resource or the SnapshotScheduleService/List gRPC API call.
- Delete a snapshot schedule using the delete REST API method for the
SnapshotSchedule
resource or the SnapshotScheduleService/Delete gRPC API call.
All snapshot creation and deletion operations that started prior to deleting the schedule will be completed.