Reputation: 1457
According to the docs:
Cloud Shell provisions 5 GB of free persistent disk storage mounted as your
$HOME
directory on the virtual machine instance.
I would need more (paid) storage though that I can access from the Cloud Shell environment and that is persistent across my sessions. It's mostly used to store local clones of git repositories and images. I would be the only one to access these files.
It seems that the 5 GB storage is a hard limit, so it won't expand dynamically and bill me for the exceeding amount. It is possible to use Boost Mode, but that does not affect the storage size. And I also can't provision more storage with a custom Cloud Shell environment. I couldn't figure out if I can mount another GCE persistent disk to my $HOME
. I was considering gcs-fuse as suggested in this answer but I'm not sure if it is suitable for git repos.
Is there any way to have more storage available in Cloud Shell?
Upvotes: 7
Views: 4852
Reputation: 568
There is another way to have more disk space in the cloud shell. It's to create a cloud storage bucket and map the cloud storage bucket as a folder. This way you can store larger files in the cloud storage bucket and it doesn't require any compute instance.
Go to cloud storage and create a new storage bucket
Copy the storage bucket's name, eg. my_storage_bucket
Go to cloud shell and create a folder in your home folder
mkdir ~/my_bucket_folder
Mount the storage bucket to this folder
gcsfuse my_storage_bucket ~/my_bucket_folder
Change directory to your my_bucket_folder
cd ~/my_bucket_folder
Voila! you have unlimited space!
To unmount please run the following
fusermount -u ~/my_bucket_folder
Upvotes: 9
Reputation: 541
I'm using gcsfuse and works fine. You don't have to remount every time if you put the mount command in .customize_environment (run on boot up).
#!/bin/sh
#.customize_environmnet run in background as root, wait for your user to initialize
sleep 20
sudo -u [USER] gcsfuse -o nonempty -file-mode=777 -dir-mode=777 --uid=1000 --debug_gcs [BUCKET_NAME] /home/[USER]/[FOLDER_NAME]
You can read more at Unlimited persistent disk in google cloud shell
Upvotes: 3
Reputation: 81414
Google Cloud Shell is a container that runs on a hidden Compute Engine instance managed by Google. You can download, modify and redeploy this container to Cloud Shell or to your own container running in the cloud or on your desktop.
The base image of the container is available at gcr.io/cloudshell-images/cloudshell:latest
, per this page.
For your use case, I would use Compute Engine with Container OS and run the Cloud Shell container within COS. You can scale the CPUs, memory, and storage to fit your requirements.
You can also set up a Compute Engine instance, install the CLIs, SDKs, and tools and have a more powerful system.
Notes for future readers based upon the first answer:
Upvotes: 7
Reputation: 537
There is no way of adding more storage to the Cloud Shell. You can create a VM and install the Cloud SDK and have as much storage as you'd like but it is not currently possible to add storage space to the Cloud Shell.
Depending on how you plan on using the saved repos, Cloud Storage may be ideal as it has a storage category just perfect archiving.
Filestore will be your best option as it is great for file systems and it is scalable. It fits your needs as you have described.
You can use Cloud Storage with FUSE. Keep in mind that this method, although great, depends on how it will be used as costs are based on storage category.
You can see a brief comparison of the Storage solutions the Cloud Platform has to offer here.
Upvotes: 2