How Do You Create a GCP VM to Be a Web Server?

Problem scenario
You have a GCP server. You can run curl commands to its URL via localhost. But with a URL constructed with the server’s external IP address the curl command times out. You cannot reach the URL from your workstation. How do you get the GCP server to present the web service to other machines?

Solution
Modify the firewall rule by following these steps below.

 » Read more..

How Do You Increase the Hard Disk Space of an Existing GCP Server?

Problem scenario
You need a larger hard disk on a Google Cloud Platform server. What should you do?

Solution

  1. In the GCP web console go to “VM instances”
  2. Click on the VM’s name (e.g., instance-1) that is hyperlinked.
  3. Find “Boot disk and local disks”. There should be a list with a “Name” column.
  4. Click on the hyperlinked name (e.g.,

 » Read more..

How Do You Open a Port to Connect to a GCP server?

Problem scenario
You are used to AWS Security Groups. You created a firewall rule in GCP. You cannot seem to reach the GCP server. What is wrong?

Possible Solution
Does the GCP firewall rule use the same shorthand notation like this?
x.x.x.x/32

Inbound rules in AWS Security Groups use the /32 to allow an IP address to connect to an EC-2 instance or service.

 » Read more..

How Do You Create a Windows VM in Google Cloud Platform with the Console?

Problem scenario
You want to create a Windows server in Google Cloud Platform. How do you do this?

Solution
1. Log into Google Cloud Platform.
2. Click the hamburger icon in the upper left hand corner (the icon with three horizontal bars stacked onto each other).
3. Go to Compute Engine -VM Instances
4. Click “Create Instance”
5.

 » Read more..

How Do You Troubleshoot a Web Server in GCP Not Working via a Web Browser when Port 80 Is Not Blocked?

Problem scenario
From a web browser these commands succeed (where x.x.x.x is the external IP address of the Linux VM serving the web service):

Test-NetConnection -ComputerName x.x.x.x -Port 80
Test-NetConnection -ComputerName x.x.x.x -Port 443

But when you open a web browser and go to the x.x.x.x IP address, but the page does not load. You may get an error message about it timing out or not being reached or available.

 » Read more..

How Do You Troubleshoot the Message “ImportError: cannot import name ‘pubsub_v1′”?

Problem scenario
From the Python command prompt or when running a Python program, you receive this message “ImportError: cannot import name ‘pubsub_v1′”. What should you do?

Solution
Possible Solution #1
Try to run the program as sudo: sudo python nameOfProg.py

Possible Solution #2
Prerequisite
This assumes that pip has been installed.

 » Read more..

How Do You Troubleshoot the Message “ImportError: No module named ‘google'”?

Problem scenario
From the Python command prompt or when running a Python program, you receive this message “ImportError: No module named ‘google'”. What should you do?

Solution
Possible Solution #1
Try to run the program as sudo: sudo python nameOfProg.py

Possible Solution #2
Prerequisite
This assumes that pip has been installed.

 » Read more..

How Do You Use Terraform to Create a Server in GCP?

Problem scenario
You want to use infrastructure as a code with Terraform and GCP. How do you use a .tf file to create a virtual machine in Google Cloud Platform?

Solution
Prerequisite

This assumes you have installed Terraform. If you need assistance with this, see this posting.

Procedures

1. Obtain the account.json file for your GCP account.

 » Read more..

How Do You Delete VM Instances from GCP That Pertain to GKE?

Problem Scenario
You have some GKE standard clusters that you want deleted. You try to delete them, but they do not go away. What should you do?

Solution
Root cause: Kubernetes clusters are self-healing. They are acting as they were designed. Once the instance group is deleted, you will be able to delete the instances via the web UI or via Google’s Cloud Shell.

 » Read more..

How Do You Install Docker on Debian Linux in GCP?

Problem scneario
In Google Cloud Platform you have a Debian Linux server. You want to install Docker on it. What do you do?

Solution
1. Create a file called dockerinstall.sh in the /tmp/ directory with the following content:

apt-get -y update
apt-get install -y apt-transport-https ca-certificates wget software-properties-common

wget https://download.docker.com/linux/debian/gpg
apt-key add gpg

echo “deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable” | sudo tee -a /etc/apt/sources.list.d/docker.list
apt-get -y update

apt-get -y install docker-ce

2.

 » Read more..