GCP Classroom Series – 24/Feb/2021

Google Compute Engine

  • This is a service that provides vms that run on GCP. Vms that run on GCP are referred as instances
  • Hypervisor:
    • This is a software that creates and runs Virtual Machines(VMs) Preview
    • There are two types of Hypervisors
      • Type 1 ("Bare metal"):
        • This acts like a light weight os that runs directly on hosts hardware
        • Example: VM Ware esxi Preview
      • Type 2 ("Hosted"):
        • This runs as a software layer on operating system
        • Examples: Virtual Box, Vmware workstation etc Preview
  • Cloud Hypervisor:
    • Thse hypervisors emerged as tool for running virtual machines and driving innovation in a cloud environment
  • On GCE when we want to create a vm the following image shows alloaction of vm on some physical server in a Zone Preview
  • Every VM needs to have some kind of OS, So for the vm which we are creating the operationg system , libraries etc are chosen by Google Virtual Machine Images. Preview Preview
  • You may choose to use
    • public images provided by google Preview
    • Market Place images provided by third-party vendors Preview
    • Create your own images
  • Virtual Machine instance which we create should be part of some vpc and subnet. A NIC is created that connects vm to subnet. A VM by default gets external ip address and internal ip address
  • Who can access vm depends on Firewall rules associated with the vm
  • So lets create a Ubuntu VM in default vpc in us-central1 Region and zone b.
  • Lets create a firewall rule to allow all the ports inbound Preview Preview
  • Login into the vm from console
  • Create a new user called as qtdevops with password qtdevops Preview
  • Enable password authentication
    • edit the Password Authentication to yes in /etc/ssh/sshd_config
    • restart sshd service sudo service sshd restart
  • Give Sudo permissions to qtdevops Preview
  • Now try to login from your workstation(laptop) as qtdevops user Preview
  • Now lets install apache server on this instance Preview Preview Preview
  • Now lets try to install tomcat
sudo yum install tomcat
sudo service tomcat start

Preview

  • Exercise: Try creating a ubuntu vm and install apache and tomcat and try to access both by external ip

Leave a Reply

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

About learningthoughtsadmin