0

On a gcloud debian vm instance, I would like to create full backups and rotate them, e.g.

  • one per day of week
  • one per week
  • one per month
  • one per year

That is, each daily would get over-written every seven days, weekly each month, monthly each year, and yearly kept "forever".

I thought I could do this with a snapshot, but there seems to be no provision in the disks snapshot command to force a full snapshot without deleting existing ones.

The other option seems to be disk images, but those appear to be literal images, taking up a full disk's amount of space which seems particularly wasteful.

One possibility would be to delete all snapshots, create a snapshot, copy it to another disk, then delete it. However, I don't see any way to copy a snapshot.

Another would be to copy a machine image someplace and compress it; maybe it is already compressed? But again, I see no way to copy / manipulate a machine image.

Surely this is possible? Any suggestions on other options?

1

If you want to create a backup of your VM instance and have the VM backup include files, configuration files, databases in the VM disk, orders info, etc, you can create a snapshot of your VM as per the following snapshot documentation link.

This documentation will guide you to create a snapshot backup of your instance persistent disk which will include the VM instance configuration file and database if hosted locally, depending on your configuration.

The first snapshot that is created is a full backup of all your data in the VM boot disk. Any further backups contain any new data or modified data since the first successful snapshot.

You can also use scheduled snapshots for Compute Engine persistent disk. The snapshot schedule can be used to a single disk, or multiple disks in the same region.

3
  • Unfortunately, that isn't what I want. At each of the above times, I want a complete snapshot -- the equivalent of the first snapshot. Scheduled snapshots create incremental snaps, and I don't want that. It appears that even manual snapshots are also incremental, based on the last snapshot, whether it was scheduled or not. – GaryA May 25 '20 at 22:01
  • Snapshots are incremental by default to avoid billing you for redundant data, which rely on a prior full snapshot backup. And it is not possible to change this. However, in order to ensure the reliability of snapshot history, a snapshot might occasionally capture a full image of the disk. If you are worried about the dependability of your snapshots, there are several best practices you can follow to create snapshots more quickly and with greater reliability [cloud.google.com/compute/docs/disks/snapshot-best-practices] – Kamelia Y May 26 '20 at 12:32
  • I’ve also found a public thread that discusses the same issue you mentioned in your use case which might be helpful. [serverfault.com/questions/1005054/… – Kamelia Y May 26 '20 at 12:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.