Compute Engine Flashcards

1
Q

What is Compute Engine?

A

IaaS which allows users to create VMs, attach to persistent storage and make use of ther GCP services

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is Compute Engine made of?

A

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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What do compute engine instances run and 3 key points about those instances?

A

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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Where are Compute Engines contained?

A

Contained in a project and run in a zone and region

- hardware costs and availability can differ between regions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What storage options are available for Compute Engine VMs?

A
  1. remote standard persistent disks

2. local solid state drives

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are some key points about Compute Engine preemptibility?

A
  1. short lived instances that can persist up to 24 hours
  2. low cost
  3. may not be available and can terminate at any time with 30 sec notice
  4. cannot migrate to a regular VM
  5. cannot be set to automatically restart
  6. good for apps that are fault tolerant and can withstand interruptions
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are some key points of Compute Engine?

A
  1. completely customizable
  2. can be made preemptible
  3. can create instance groups
  4. can set up health checks
  5. can attach GPU for math intensive applications
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is an instance group and what are some key points?

A

It lets you manage multiple VMs as a single unit.

  1. any gcloud command issued to the group is applied to all VMs in the group
  2. instance template is based of an instance and can be used to make identical instances
  3. all GCP load balancing requires use of an instance group
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are the two types of instance groups.

A

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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is a health check?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Key points of VM billing in Compute Engine?

A
  1. billed in 1 sec increments based on machine type
  2. discount for sustained usage
  3. charged for a minimum of 1 min
  4. preemptible can save up to 80%
  5. once the instance is stopped, you are not billed
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Key points of GPUs attached to a VM?

A
  1. not all zones/machine types have GPUs as an option
  2. can have 1, 2 or 4 GPUs attached to a machine
  3. cannot be attached to shared memory machines
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is a snapshot and what are some key points?

A

A copy of a disk that is useful for backup.

  1. first snapshot contains full data - subsequent ones are incremental
  2. if application is buffered in memory, make sure to flush it before creating snapshot
  3. users must have Compute Storage Admin role to work with a snapshot
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is a disk image and what are some key points?

A

A copy of a disk that is in a suitable format for creating a VM

  1. can be made from a disk, snapshot, cloud storage file or another image.
  2. can delete or deprecate an image
  3. a family is a group of related images which are usually different versions of the same underlying image
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How do you create a commute engine instance via command line?

A

gcloud compute instances create [instance name]

Values from default project will be used if not specified

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How do you view project info via command line?

A

gcloud compute project-info describe

17
Q

How do you list the vms via command line?

A

gcloud compute instances list

18
Q

What are some commonly used parameters when creating a VM?

A
  • -boot-disk-size (10GB and 2TB)
  • -boot-disk-type
  • -labels
  • -machine-type : type of machine to use, standard is n1-standard-1
  • -preemptible
  • -subnet [SUBNET NAME] : to create the vm in a particular VPC
19
Q

How do you view available machine types for creating a VM?

A

gcloud compute machine-types list

20
Q

VM Management: What is metadata?

A

Key values pairs that are stored in a metdata serer and can be queried by Compute Engine API. It’s useful if running startup or shutdown scripts and need to change behavior based on metadata values

21
Q

VM Management: What options exist for availability policy?

A
  1. preemptibility
  2. automatic restart - auto restart if machine shut down
  3. on host maintenance - allows instances to be migrated to other servers during maintenance
22
Q

VM Management: What security options are available?

A
  1. Shielded VM - configured to have additional security measures
  2. Secure Boot - only authenticated OS software can run on VM
  3. VTPM - Virtual Trusted Platform Module
  4. Integrity Monitoring - uses a known baseline of boot measurements to compare current boot measurement
  5. SSH keys - can block project wide SSH keys
23
Q

VM Management: What disk options are available? (Not disk types)

A
  1. Specify whether boot disk is deleted when instance is deleted.
  2. How encryption will be managed
  3. Add new disk setting name, type, r/w parameters, size, encryption
24
Q

VM Management: What networking options are available?

A
  1. add network tags
  2. add another network interface to another network
  3. choose a VPC and select a subnet
  4. specify static IP or custom ephemeral address
25
Q

VM Management: What is sole tenancy?

A

It ensures that your VMs run on a server only with your other VMs

26
Q

How do you create an instance group via command line?

A

gcloud compute instance-templates create [template name]

  1. you can specify existing VMs as a source of the instance template
  2. it can contain instances zonally or regionally