GCP Classroom notes 27/Aug/2024

Google Compute Engine (GCE)

  • GCE is one of the core GCP Services for creating virtual machines
  • Base resources of virtual machine are
    • processors
    • memory
    • storage
    • network
  • Google uses KVM hypervisor secured and hardened by google itself Refer Here
  • VM will be referred as instance in gcp.
  • GCE offers machines families for different types of workloads, here is the basic summary of machine families
    • General Purpose:
      • This offers best balance between price and performance
    • Compute Optimized:
      • This delivers the highest performace per core on Compute Engine and it is designed for compute intensive worloads
    • Memory Optimized: This is perfect for tasks that require large amount of memory, providing more memory per core with Maximum capacity of 12 TB RAM
    • Accelartor Optimized:
      • This is specifically tailore to massively paralleized Compute Unifided Device Architecture (CUDA) compute workloads such as machine learning (ML) and High performance compute (HPC)
  • GCE machines are further classified by series and generation
  • General-purpose workloads Refer Here
    • E2
    • N2, N2D and N1
    • C3
    • Tau T2D and Tau T2A
  • Compute Optimzied Refer Here
    • C2, C2D
  • Memory Optimized Refer Here
  • Accelarator Optimized Refer Here
  • Terminolgy Refer Here

Create an Ubuntu Linux VM Instance Using Console

  • Steps
    Preview
  • Now choose region and zone, provide name
    Preview
  • Select a machine family and series
    Preview
  • GCP Supports preset sizing and also custom sizing
    Preview
    Preview
    Preview
  • Inside the vm instance if we want to run a container then gcp directly supports it
    Preview
  • Boot disk lets us select Image and also set the disk size
    Preview
    Preview
  • Lets select the service account
    Preview
    Preview
    Preview
    Preview
    Preview
    Preview
    Preview
    Preview
  • Once the vm is created ssh into the vm
ssh -i <path to private key> username@externalip

Preview
* Now lets install nginx server in it

Create a Windows server using console

To create a Windows Server VM instance in the Google Cloud Platform (GCP) and log in to it, follow these steps:

1. Prerequisites

  • Google Cloud Account: Ensure you have a Google Cloud account. If not, create one and enable billing for your project[3].
  • Compute Engine API: Enable the Compute Engine API for your project[3].
  • RDP Client: If you’re not using Windows on your local machine, install an RDP client such as Chrome Remote Desktop[3].

2. Create a Windows Server VM Instance

  1. Sign in to Google Cloud Console: Log in to the Google Cloud Console.
  2. Select or Create a Project: On the project selector page, select or create a Google Cloud project[3].
  3. Navigate to Compute Engine: Go to the Compute Engine section.
  4. Create an Instance:
  5. Click on Create an instance.
  6. Provide a name for your VM instance.
  7. Choose the region and zone as needed[4][6].
  8. Configure the Boot Disk:
  9. In the Boot disk section, click Change.
  10. On the Public images tab, choose Windows Server from the Operating system list.
  11. Select the desired version of Windows Server (e.g., Windows Server 2019 Datacenter)[3][5].
  12. Configure Machine Type:
  13. Select the machine type based on your requirements. For example, you can choose from general-purpose, compute-optimized, memory-optimized, or GPU-optimized instances[4].
  14. Firewall Settings:
  15. Ensure that the firewall settings allow the necessary traffic. By default, you may need to allow HTTP traffic and create a custom firewall rule to allow RDP (port 3389)[2][3].

3. Create the VM

  • Click Create to create the VM instance. It will take a short time for the instance to start[3].

4. Set Windows Password

  1. Go to VM Instances Page:
  2. Navigate to the VM instances page.
  3. Set Windows Password:
  4. Click on the name of your VM instance.
  5. Under the Remote access section, click Set Windows password.
  6. Specify a username and click Set to generate a new password. Save the username and password for later use[3][6].

5. Connect to the VM Using RDP

  1. Get External IP:
  2. Note the external IP address of your VM instance.
  3. Create Firewall Rule for RDP:
  4. If not already done, create a firewall rule to allow incoming traffic on port 3389 for RDP[2].
  5. Connect via RDP:
  6. Open your RDP client and enter the external IP address of your VM instance.
  7. Use the username and password you set earlier to log in[2][3][6].

Example Steps from Sources

  • Detailed Steps with Firewall Configuration: Refer to the YouTube video by Vishal Bulbule for detailed steps including firewall configuration[2].
  • Quick Tutorial: The video by Dominic from starscreek.net provides a concise tutorial on creating and connecting to a Windows VM[6].

By following these steps, you can successfully create a Windows Server VM instance in GCP and log in to it using Remote Desktop Protocol (RDP).

Citations:
[1] https://holowczak.com/getting-started-with-google-cloud-platform-creating-a-windows-server-vm/
[2] https://www.youtube.com/watch?v=GqakgxJEthQ
[3] https://cloud.google.com/compute/docs/create-windows-server-vm-instance
[4] https://www.youtube.com/watch?v=AanhtRcqsDI
[5] https://cloud.google.com/compute/docs/instances/windows/creating-managing-windows-instances
[6] https://www.youtube.com/watch?v=pTMn7M8OJQ8
[7] https://www.youtube.com/watch?v=p5wl1s5gKY0
[8] https://console.cloud.google.com/getting-started?tutorial=compute_short_quickstart

Exercise

  • Create a redhat linux vm
  • Create an centos linux vm

Published
Categorized as Uncategorized Tagged

By continuous learner

devops & cloud enthusiastic learner

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Please turn AdBlock off
Social Network Integration by Acurax Social Media Branding Company

Discover more from Direct DevOps from Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading

Visit Us On FacebookVisit Us On LinkedinVisit Us On Youtube