Start and Stop VMs in GCP Using HTTP Triggered Cloud Functions with Python
Start and Stop VMs in GCP Using HTTP Triggered Cloud Functions with Python

Summary

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.
  • The
Read the rest “Start and Stop VMs in GCP Using HTTP Triggered Cloud Functions with Python”

How to reduce the size of a Windows persistent disk in GCP
How to reduce the size of a Windows persistent disk in GCP

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 is … Read the rest “How to reduce the size of a Windows persistent disk in GCP”

Enable snapshot schedules in GCP Compute Engine!

Intro

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!”

GCP – Change Windows instance DNS using a startup script
GCP – Change Windows instance DNS using a startup script

Intro to the GCP project

So I have been working on a GCP project for a big customer where I live, and part of the work involved migrating instances from their other cloud platform to GCP. The migration that I was doing supposed to be simple. We call it lift and shift.

The concept is we take the instance as it is with all of its data and configuration and replicate it to GCP. This is a simple process.. Or that’s how we all though!

We used CloudEndure for this work and the whole process was easy and straight forward. Once the machines were ready for testing I started them up and asked the customer to login to them and test and confirm if things are good.

Problems begin!

The customer called and said they cannot access the machines and there is an issue with the authentication and AD settings… … Read the rest “GCP – Change Windows instance DNS using a startup script”