Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Persistent Disk Snapshot using API

I am taking persistent disk snapshot using GCP Cloud Client Library APIs. disk.createsnapshot
Following are my questions 

  • In case of persistent disk snapshot , we can specify the storage location to either 'MultiRegion Location' OR 'Regional Location'  My questions are
  1. In both the storage location cases, Does GCP internally create multiple copies of the snapshot automatically for High Availability & Resiliency ?
  2. If yes , Does it cost ?
  3. I didn't see any GCP documentation  where they have mentioned " How many copies of snapshot is getting created? In which region / zone these copies are getting created. etc" Can some one share the documentation link where it is mentioned clearly.
  • Is there any API available by which we can copy snapshot from default location to another GCP custom bucket?
  • Is there any API available by which we can read the snapshot?

Your assistance will be appreciated

 

Solved Solved
0 4 1,180
1 ACCEPTED SOLUTION

Hi @TusharG ,

Depending on the location that you choose for the snapshot (multi-region or region), the snapshot is stored in a multi-region of regional Cloud Storage bucket. And (citing from this Cloud Storage doc: https://cloud.google.com/storage/docs/locations), data in Cloud Storage is stored redundantly across zones or regions, depending on the bucket location. So to your Q1, yes, snapshots are stored redundantly across zones or regions, depending on the location you choose.

For pricing details, please see https://cloud.google.com/compute/disks-image-pricing#persistent_disk_snapshots

Afaik (going by the methods listed in https://cloud.google.com/compute/docs/reference/rest/v1/snapshots#methods), there's no API to "read" snapshot data or change the location of a snapshot.

I hope this helps.

 

View solution in original post

4 REPLIES 4

Hi @TusharG ,

Depending on the location that you choose for the snapshot (multi-region or region), the snapshot is stored in a multi-region of regional Cloud Storage bucket. And (citing from this Cloud Storage doc: https://cloud.google.com/storage/docs/locations), data in Cloud Storage is stored redundantly across zones or regions, depending on the bucket location. So to your Q1, yes, snapshots are stored redundantly across zones or regions, depending on the location you choose.

For pricing details, please see https://cloud.google.com/compute/disks-image-pricing#persistent_disk_snapshots

Afaik (going by the methods listed in https://cloud.google.com/compute/docs/reference/rest/v1/snapshots#methods), there's no API to "read" snapshot data or change the location of a snapshot.

I hope this helps.

 

Thanks Kumards

Your post really help me to resolve my questions. 

Regarding read snapshot data. Is there any alternate way to read the snapshot data?

I'm sure you know that you can create a disk or VM by using a snapshot and then read the data from the disk. See this doc: https://cloud.google.com/compute/docs/disks/restore-snapshot. And of course there's the GET API call to read the metadata of a snapshot: https://cloud.google.com/compute/docs/reference/rest/v1/snapshots/get. I'm not aware of any way to directly "read" the data stored in a snapshot.

The method that you have suggested that is regarding Restore & getting the snapshot metadata.

My use case is.

If I have a disk snapshot and I wanted to move/ copy that snapshot to a custom created GCP bucket.  

How can I achieve this, using APIs?