Google Cloud Storage is a flexible, scalable, and durable storage option for your virtual machine instances. You can write files to Cloud Storage buckets from almost anywhere, so you can use buckets as common storage between your instances, Google App Engine, your on-premises systems, and other cloud services.
If Cloud Storage buckets do not meet your performance and latency requirements, you can use Cloud Storage in combination with other instance storage options.
Before you begin
- Read the VM instances documentation.
- If you want to use the command-line examples in this guide:
- If you want to use the API examples in this guide, set up API access.
Writing data to Google Cloud Storage buckets
Write files to Google Cloud Storage buckets through the
gsutil tool or
the Cloud Storage API.
By default, the
gsutil tool command is installed on all virtual machine
instances that use
supported operating systems.
If you have never used
gsutilon this instance before, use the
gcloudtool to set up credentials.
Alternatively, if your instance is configured to use a service account with a Google Cloud Storage scope, you can skip this step.
If you configured your instance to use a service account with a Google Cloud Storage scope, you can use the Cloud Storage APIs to write data to Cloud Storage buckets.
Install and configure a client library for your preferred language.
Follow one of the insert examples and include code in your application that writes a file to a Cloud Storage bucket.
Mounting a bucket as a file system
You can use the Google Cloud Storage FUSE tool to mount a Cloud Storage bucket to your Compute Engine instance. The mounted bucket behaves similarly to a persistent disk even though Cloud Storage buckets are object storage.
To learn how to mount a Cloud Storage bucket on your instance, read Using Cloud Storage FUSE.