In many cases you want to start or stop a VM instance in GCP very quickly. You can do this by using Cloud Functions and a few lines of Python.
In this article I’ll be showing you how you can do that with a very easy and simple to follow instructions.
The idea behind this was that I wanted to easily let my family start and stop the small Minecraft server that I have built for us, so that any time the kids want to play, the server can be started easily without anyone logging into the Cloud Console.
So I thought of finding a way to let them just hit a simple URL which in turn will do the job. That’s where Cloud Functions on GCP come in.
So in this article, I’ll be showing you the following:
- The prerequisites prior to setting up your Cloud Function.
Introduction and Important Notes
Before I go into the details on this, I just want to provide some context and back story into this.
I will also list the references that I used at the end of this article to make sure you get to the source of this if you want to do that.
Also there are few important notes I think they worth to be mentioned so I’ll list them in this section as well.
My Use Case and Environment
So the reason I was forced to do that was the result of a mess up that happened between our team and the sales who was handling a customer requirement.
The customer wanted to have a 1 year commitment with #Google on an E2 instance with a certain amount of CPU and memory. In addition to that they wanted to reduce the size of the PD that … Read the rest “How to reduce the size of a Windows persistent disk in GCP”
GCP or Google Cloud platform offers many services to customers. One of the fundamental services in GCP is the GCE, or Compute Engine.
Compute Engine is the service that allows you to run and deploy your workloads through the IaaS approach. One of the key benefits of IaaS is the ease and flexibility of resource deployment and management.
Snapshots are an important part of the service. They allow you to easily capture the whole VM state before doing any modification… Before a while, there was no option to automate the snapshot creation process without using Google Cloud SDK or gcloud command line tools.
Usually the way we used to do that is by creating a cron job, or a scheduled task that will run gcloud command and then create the snapshot. More automation involved managing the snapshots retention period from inside the script we ran from that cron … Read the rest “Enable snapshot schedules in GCP Compute Engine!”