Is it a Billable Op Changing Storage Class of Exis

2019-07-09 11:43发布

问题:

I was trying to change storage class of a set of existing objects (over 300 GBs) as advised in this post:

I tried it on one file first:

fyn@pod-arch:~$ gsutil ls -L gs://some-bucket/sub-dir/audioArch.mp3
gs://some-bucket/sub-dir/audioArch.mp3:
    Creation time:          Fri, 29 Jul 2016 00:52:51 GMT
    Update time:            Fri, 05 Aug 2016 15:40:51 GMT
    Storage class:          DURABLE_REDUCED_AVAILABILITY
    Content-Language:       en
    Content-Length:         43033404
    Content-Type:           audio/mpeg
    ... ...

fyn@pod-arch:~$ gsutil -m rewrite -s coldline gs://some-bucket/sub-dir/audioArch.mp3
- [1/1 files][ 41.0 MiB/ 41.0 MiB] 100% Done
Operation completed over 1 objects/41.0 MiB.

fyn@pod-arch:~$ gsutil ls -L gs://some-bucket/sub-dir/audioArch.mp3
gs://some-bucket/sub-dir/audioArch.mp3:
    Creation time:          Sun, 30 Oct 2016 23:49:34 GMT
    Update time:            Sun, 30 Oct 2016 23:49:34 GMT
    Storage class:          COLDLINE
    Content-Language:       en
    Content-Length:         43033404
    Content-Type:           audio/mpeg
    ... ...

Then I tried it on 15 more, and then on the rest of the objects in a subdir... Works like a charm ☺, although the operation overwrites the Creation & Update times!

I had two follow-up queries though:

  1. Is gsutil rewrite operation billable?
  2. Can Creation time be preserved?

Many thanks.

Cheers!

fynali

回答1:

Yes, it is billable as a Class A operation (it uses storage.objects.rewrite, see cloud.google.com/storage/pricing). No, there's no way to preserve the creation/update time because rewrite creates a new object generation.

–Travis Hobrla in comment here