How to create and rotate Automatic Snapshot?

前端 未结 10 2042
梦如初夏
梦如初夏 2020-12-14 08:33

On Compute Engine we can do Snapshots, which are basically backups. Could you try to figure out how we could create a script to do automated snapshots every day and keep lik

10条回答
  •  轮回少年
    2020-12-14 09:03

    There is now a feature called "Snapshot Schedule" available in GCP.

    It still seems to be in Beta, and there is not much documentation on this feature yet. But it is a straight forward process to enable it. First you create a snapshot schedule and can assign it to persistent disks after you set it up.

    See also the command line reference to create a schedule with corresponding the gcloud command:

    gcloud beta compute resource-policies create-snapshot-schedule
    

    https://cloud.google.com/sdk/gcloud/reference/beta/compute/resource-policies/create-snapshot-schedule

    To assign the schedule to a persistent disk you can use the command

    gcloud beta compute disks add-resource-policies
    

    https://cloud.google.com/sdk/gcloud/reference/beta/compute/disks/add-resource-policies

    Update 2019-02-15: Since yesterday there is a blog announcement about the scheduled snapshots feature and also a page in the Compute Engine documentation for scheduled snapshots.

提交回复
热议问题