1

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?

itroulli
  • 2,044
  • 1
  • 10
  • 21
LemmeTestThat
  • 498
  • 7
  • 17
  • 2
    Local SSDs are suitable only for temporary storage. If you want persistence, you must manually copy that data some place else and restore. Google does not offer a managed solution. Given that an instance can be rebooted by Google (rare), operating systems/applications can crash, ... the number of cases where you might have data loss makes your goal unrealistic. – John Hanley Aug 13 '20 at 05:31

1 Answers1

1

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.

Wojtek_B
  • 4,245
  • 1
  • 7
  • 21
  • 1
    Quite helpful. I also would like to point out that the backup can be created using `gsutil rsync` onto a cloud bucket, which is one of the least expensive storage options on GCP. – LemmeTestThat Sep 02 '20 at 02:33