Start and stop GCP VM from terminal

By going through the setup process from the fastai setup docs I was able to make the GCP VM using Google CLI. But I don’t want to go to the web dashboard every time I want to start and stop the instance. So I looked around and found the solution.

I have written the bash scripts to start and stop an instance. You can also combine starting and logging in into a single script. You can find the script in the following github gist. I have tested these scripts on Linux and MacOS, only.

Just replace the project name and instance name with your respective project and instance names.

1 Like