How to back-up local SSD in Google Cloud Platform

1k Views Asked by At

Local SSDs are the fastest storage available in Google Cloud Platform, which makes it clear why people would want to use it. But it comes with some severe drawbacks, most notably that all data on the SSDs will be lost if the VM is shut down manually. It also seems to be impossible to take and image of a local SSD and restore it to a restarted disk.

What then is the recommended way to back-up local SSD data if I have to shut down the VM (if I want to change the machine specs for example)? So far I can only thing of manually copying my files to a bucket or a persistent disk.

If you have a solution to this, would it work if multiple local SSDs were mounted into a single logical volume?

1

There are 1 best solutions below

1
On BEST ANSWER

I'm guessing that you want to create a backup of data stored on local SSD every time you shut down the machine (or reboot).

To achieve this (as @John Hanley commented) you have to copy the data either manually or by some script to other storage (persistend disk, bucket etc).

If you're running Linux:

Here's a great answer how to run script at reboot / shutdown. You can then create a script that will copy all the data to some more persistend storage solution.

If I were you I'd just use rsync and cron. Run it every hour or day (depends on your use case). Here's a another great example how to use rsync to synchronize folders.

If you're running Windows:

It is also possible to run command at windows shutdown and here's how.