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)
- 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
- Type 2 ("Hosted"):
- This runs as a software layer on operating system
- Examples: Virtual Box, Vmware workstation etc
- Type 1 ("Bare metal"):
- This is a software that creates and runs Virtual Machines(VMs)
- 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
- 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.
- You may choose to use
- public images provided by google
- Market Place images provided by third-party vendors
- Create your own images
- public images provided by google
- 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
- Login into the vm from console
- Create a new user called as qtdevops with password qtdevops
- 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
- Now try to login from your workstation(laptop) as qtdevops user
- Now lets install apache server on this instance
- Now lets try to install tomcat
sudo yum install tomcat
sudo service tomcat start
- Exercise: Try creating a ubuntu vm and install apache and tomcat and try to access both by external ip