Test Flashcards
What is Virtualization in cloud computing?
An ability to run multiple (Virtual) OSes on a single physical system and share underlying HW resources
What are the Benefits of virtualization?
Run multiple/different OSes on a single machine
2. Consolidate underutilized servers to reduce CAPEX and
OPEX
3. Simplified management (rebalancing workloads)
4. Improved availability
5. Enforced security
What is a Hypervisor?
A virtual machine monitor creates and runs virtual machines
What is a Virtual Machine?
The virtualization or emulation of a computer system
What is Full Virualization?
A full virtualization of a computer
What is Paravirtualization?
Hypervisor enables virtual machine that are similar but not 100% identical to physical HW
What is OS-Level Virtualization?
An operating system virtualization paradigm in which the kernel allows the existence of multiple isolated user space instances, called containers, zones, virtual private servers, partitions, virtual environments, virtual kernels, or jails.
What is Application-Level Virtualization?
Abstracting an app from the underlying hardware it is running on
What are the Key Techniques in Full Virtualization?
Trap and Emulate
Binary Translation
What is Trap and Emulate?
Running a VM in two states, a User State and Kernel state, when a privileged instruction occurs there is a switch between the user state and kernel state by the hypervisor
What is the 4 steps in trap and emulate?
1 Privileged Instruction in user mode causes an error
2 Hypervisor gains control, executes operation as attempted by guest OS
3 Return control to guest OS in user mode
4 Call this Trap and emulate
Does trap and emulate has the same speed of execution with full virtualization?
No
What is a critical instruction?
A sensitive but non-privileged instruction
What is sensitive instruction?
Instructions that interact with hardware
What is non-sensitive instructions?
All other instructions
What is an example of a critical instruction?
File Writing
What is the purpose of Binary Translation?
To skip or modify the guest OS binary code blocks which include critical instructions and translate those critical instructions into privileged instructions which will be trapped by the Hypervisor for further emulation
What is Para-Virulization?
Similar the to Virtualization but it enables virtual machine that are similar but not 100% identical to physical HW
Does Para-Virtualization require OS modification?
Yes
Does Para-Virtualization require modification to the ABI?
No
What are the Pros of Full Virulization?
No Source Code Modification
Easy
What are the Cons of Full Virtulization?
Latency from OS/HW emulation
Hard to provide real-time guarantee
Latency to RAM (25%-75%) DISKIO (2%-20%) NETIO (10%) and CPU (7%)
What are the Pros of Para-virtualization?
Performance, Fast, Feasible for All CPU Architectures
What are the Cons of Para-virtualization?
OS Modification
Poor Portability
Precludes off the self OS and legacy version of OS
What is PUE?
1 + Non IT Equipment Power/ IT Equipment Power
What is VM migration?
The transfer of one VM from one machine to another
What are the three use cases of VM Migration?
Load Balancing
Maintenance
Fault Tolerance
What are the two types of migrations?
Cold Migration and Live Migration
How does Pre-Copy Live Migration take place?
1 Select target host for migration
2 Initialize a VM on the target host
Iterative Step Copy update memory from VM on host A to host B
3 Suspend VM on host A, Sync all remaining VM states to host B
4 Release VM from host A
5 Start VM on host b
How does Post-Copy Live Migration take place?
1 Activate VM on host A and B
2 Suspend VM on host A
3 Transfer VM state to target
4 Resume VM on host B
5 Copy memory Pages from A to B
What are the Pros of Pre-Copy live migration?
Shorter Downtime
High Performance after
migration
What are the Cons of Pre-Copy live migration?
Longer Migration Time
Network Utilization
What are the Pros of Post-Copy live migration?
Shorter Migration Time
Network Utilization
What are the Cons of Post-Copy live migration?
Longer Downtime (but still Live)
Overhead after migration
OS-Level Virtualization vs. IaaS
OS Level Virtualization is lighter than IAAS
OS-Level Virtualization vs. PaaS
OS Level Virtualization doesn’t have to worry about supported frameworks or supported languages
What are the Cons of OS-Level Virtualization?
“Technically” doesn’t have OS
- Generally runs “the same OS” as the
host machine (i.e., you cannot run
“Windows on Linux” via OS-level
virtualization)
What are the Pros of OS-Level Virtualization?
Lightweight (fast creation, fast
destruction, little overhead switching between instances)
no HW emulation
Good Isolation (security, resource usage)
What is a Namespace?
A limits to what processes/containers
can see through the form of an ID
What are the six namespaces?
PID namespace
NET namespace
MNT namespace
IPC namespace
UTS namespace
User namespace
What is the point of Linux Namespaces?
To provide processes with their own view of the system
What is a PID namespace?
Processes within a PID namespace only see processes in the same PID namespace
What is a NET namespace?
A NET namespace isolates networking related resources
What is a MNT namespace?
A mount namespace for limiting filesystems
What is an IPC namespace?
A IPC namespace isolates the inter-process communication resource
What is a control group? (cgroups)
A limit to what and how much processes or containers can use
What are the characteristics of Cgroups
Subsystem Hierarchy
Hierarchies are independent
Processes belong to exactly 1 node in each hierarchy
Each hierarchy starts with 1 node
Each node == group of processes
What are some subsystems limited by cgroups?
CPU
Memory
Block IO
Network (TC/iptables)
Devices (/dev/*)
What are Docker Internals?
Written in Go
Uses cgroups and namespaces
has a libcontainer
composed of containerd, containerd-shim, runcC
What is the Docker Client?
The client section of docker
What is the Docker Daemon?
The server section of docker
What is the Docker Hub?
Public docker image registry
What is docker?
A software platform that allows you to build, test, and deploy apps with OS-level virtualization
What is Docker’s Architecture?
Client Server Architecture, Client talks to daemon which builds, runs and distributes docker containers
What is a Docker Image?
A collection of files and meta data
What is the difference between Docker Container vs Docker Image?
Docker container is a running version of an image
Which would be pushed to Docker Hub? Container or Image?
Image
How can Docker Images be built?
From a dockerfile and a context (a set of files)
What is immutable infrastructure?
When a service (e.g., app, bin, others) is updated, OS or
execution environment does not have to be changed
Build a new image and deploy it to servers!
What are the pros of Immutable Infrastructure?
Less management effort for
service/servers
Need to manage images
Horizontal Scalability
Run multiple servers with a
single image
Easy integration with
autoscaling
What are the cons of Immutable Infrastructures?
Small quick fixes require a full
redeploy.
Docker run
Runs a docker image
docker ps
Shows all docker containers running
docker stop
Suspends a docker containter
What command to stop all containers?
docker stop $(docker ps -q)
docker rm
Removes a docker container
What command to remove all containers
docker stop $(docker ps -q)
docker images
Displays all images currently installed on your machine
docker pull
pull an image from registry
docker rmi
Remove one or more images
docker logs
Fetch the logs of a container
docker exec
Doesn’t create a new container but sends commands to an existing container
docker compose
creates and starts all
the services from your configuration file
What is a monolithic application?
An app contained in one codebase and database
What are the characteristics of monolithic applications?
Large codebase + Large DB
Put every function/logic into a single host (or VM)
Many components, no clear ownership
Long deployment/delivery cycle
What are the three design principles of microservices?
Modularity and Independent
Hide Implementation Details
Automation
What are the Pros of Microservices?
Polyglot Architecture
Language and Platform
Freedom
Evolutionary Design
Replaceable Architecture
Selective Scalability
Small, Simple, Lightweight
What are the Cons of Microservices?
High Overall Complexity
(aka Deathstar…)
Overhead
Operation
Service Discovery
Communication
(Chattiness)
Could be slow
HTTP is slower than
external function call
Diversity in Language,
Platform, DB
What are the Pros and Cons of Bare Metal Virtualization?
Pros: Performance, No additional SW layers, Security, No possible attack from hosted OS
Cons: Complex
What are the Pros and Cons of Hosted Virtualization?
Pros: Easy to use, Hosted OS takes care of all hardware
Cons: Single point of failure, What if base OS needs a reboot
clone()
creates a new process and a new namespace; the process is attached to the new namespace
unshare()
Attaches the calling process to a new namespace
setns()
Allows the calling process to join an existing namespace