Announcements
This site is in read only until July 22 as we migrate to a new platform; refer to this community post for more details.
Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Cloud compute instance VM script help

Hello, I don't really know where to ask for help so i'll ask here. I want to make a script for my cloud VM to start at a certain hour and also run a script inside it right after starting itself, and then for it to run a inside script and shutdown the VM right after it at a other certain hour. So that it's ON from 9am to 3am and OFF the rest of time I don't know how to navigate the page to get to it as i have not used google cloud at all, only other cloud services where i used the vm for 24/7. Any help would be greatly appreciated

0 1 27
1 REPLY 1

Hi, @Fraglaj.

You can use the GCP Cloud Scheduler to automatically start or stop a VM at specific times. I recommend referring to this official documentation for setup details.

Additionally, to run a script when the VM starts, you can use the startup script feature available in the VM instance settings. Please look on the corresponding documentation for guidance on how to configure this.

Regards,
Mokit

Top Labels in this Space
Top Solution Authors