Compute Engine Flashcards
What is Compute Engine?
IaaS which allows users to create VMs, attach to persistent storage and make use of ther GCP services
What is Compute Engine made of?
Scalable, high performance virtual machines that are completely customizable.
- over 25 predefined machine types with various numbers of CPUs and memory
- customize 1-64 CPUs with up to 6.5GB RAM per CPU
What do compute engine instances run and 3 key points about those instances?
Images that contain an OS, libraries and other code.
- Google provides Linux and Windows Server images
- 3rd party vendors provide other images
- Can create custom image from boot disk or snapshot from an existing VM
Where are Compute Engines contained?
Contained in a project and run in a zone and region
- hardware costs and availability can differ between regions
What storage options are available for Compute Engine VMs?
- remote standard persistent disks
2. local solid state drives
What are some key points about Compute Engine preemptibility?
- short lived instances that can persist up to 24 hours
- low cost
- may not be available and can terminate at any time with 30 sec notice
- cannot migrate to a regular VM
- cannot be set to automatically restart
- good for apps that are fault tolerant and can withstand interruptions
What are some key points of Compute Engine?
- completely customizable
- can be made preemptible
- can create instance groups
- can set up health checks
- can attach GPU for math intensive applications
What is an instance group and what are some key points?
It lets you manage multiple VMs as a single unit.
- any gcloud command issued to the group is applied to all VMs in the group
- instance template is based of an instance and can be used to make identical instances
- all GCP load balancing requires use of an instance group
What are the two types of instance groups.
Unmanaged
- collections of instances with different configurations
- no auto-scaling
- can’t use instance templates
Managed
- collection of instances that are identical
- automatically scale and load balance
- instance that crashes can be automatically recreated
- can be set up with instance template
- zonal or regional
What is a health check?
A health check contacts the server and waits for a response. When setting up a health check, you set the frequency, how long to wait for a response and what a given number of successes or failures means in terms of health
Key points of VM billing in Compute Engine?
- billed in 1 sec increments based on machine type
- discount for sustained usage
- charged for a minimum of 1 min
- preemptible can save up to 80%
- once the instance is stopped, you are not billed
Key points of GPUs attached to a VM?
- not all zones/machine types have GPUs as an option
- can have 1, 2 or 4 GPUs attached to a machine
- cannot be attached to shared memory machines
What is a snapshot and what are some key points?
A copy of a disk that is useful for backup.
- first snapshot contains full data - subsequent ones are incremental
- if application is buffered in memory, make sure to flush it before creating snapshot
- users must have Compute Storage Admin role to work with a snapshot
What is a disk image and what are some key points?
A copy of a disk that is in a suitable format for creating a VM
- can be made from a disk, snapshot, cloud storage file or another image.
- can delete or deprecate an image
- a family is a group of related images which are usually different versions of the same underlying image
How do you create a commute engine instance via command line?
gcloud compute instances create [instance name]
Values from default project will be used if not specified