What is the fundamental idea of virtual machines?
Abstract hardware of a single computer into several different execution environments.
Host vs VMM vs guest.
Host: the underlying hardware system. VMM/hypervisor: creates and runs VMs, providing an interface identical to the host. Guest: a process provided with a virtual copy of the host, usually an OS.
What is a Type 0 hypervisor? Examples?
A hardware-based solution providing VM creation and management via firmware — IBM LPARs, Oracle LDOMs.
What is a Type 1 hypervisor? Examples?
Operating-system-like software built to provide virtualization — VMware ESX, Joyent SmartOS, Citrix XenServer (also general-purpose OSs with VMM functions: Windows Server with HyperV, RedHat Linux with KVM).
What is a Type 2 hypervisor? Examples?
An application that runs on a standard OS but provides VMM features to guest OSs — VMware Workstation and Fusion, Parallels Desktop, Oracle VirtualBox.
Paravirtualization in one line.
The guest operating system is modified to work in cooperation with the VMM to optimize performance.
Why is application containment "not virtualization at all"?
It provides virtualization-like features by segregating applications from the operating system (e.g., Solaris Zones, BSD Jails, IBM AIX WPARs), not by virtualizing hardware.
When and where did virtualization first appear?
In IBM mainframes in 1972, allowing multiple users to share a batch-oriented system.
The three points of the formal definition of virtualization.
1. The VMM provides an environment essentially identical to the original machine; 2. programs show only minor performance decreases; 3. the VMM is in complete control of system resources.
Snapshot vs clone.
Snapshot: save a given state and be able to restore back to it. Clone: create a copy and run both original and copy.
What is templating?
Create an OS + application VM, provide it to customers, and use it to create multiple instances of that combination.
How do virtualization features relate to cloud computing?
All those features taken together → cloud computing: using APIs, programs tell cloud infrastructure (servers, networking, storage) to create new guests, VMs, virtual desktops.
What does a VCPU represent?
The state of the CPU per guest as the guest believes it to be.
In which real mode do virtual user mode and virtual kernel mode run?
Both run in real user mode.
Trap-and-emulate: what happens when the guest attempts a privileged instruction in user mode?
It causes an error → trap; the VMM gains control, analyzes the error, executes the operation as attempted by the guest, and returns control to the guest in user mode.
Trap-and-emulate: which guest code runs slower?
Kernel-mode privileged code (user-mode code runs at the same speed as if not a guest).
Why does popf break trap-and-emulate?
In user mode it replaces only some flags and no trap is generated, so the VMM never gets control (earlier x86 lacks a clean privileged/nonprivileged separation).
Binary translation: what happens to special vs non-special instructions in guest kernel mode?
Non-special instructions run natively; special instructions are translated into a new set of instructions that perform an equivalent task.
What did Intel VT-x and AMD-V remove the need for?
Binary translation (they add "guest" and "host" CPU modes).
What is virtual machine sprawl?
Lots of VMs whose history and state are difficult to track — a result of VM creation being simpler and faster than a physical install.
Two characteristics of Type 0 hypervisors.
E.g.: a HW feature implemented by firmware; each guest has dedicated HW; smaller feature set; I/O a challenge; can provide virtualization-within-virtualization.
Where are Type 1 hypervisors commonly found, and in which mode do they run?
In company datacenters ("datacenter operating systems"); they run in kernel mode, natively on the hardware.
Type 2: main drawback and main benefit.
Drawback: poorer overall performance (can't use some HW features). Benefit: requires no changes to the host OS.
What is a hypercall?
A call to the hypervisor; in Xen paravirtualization the guest uses it when page-table changes are needed.
Virtualization vs emulation: the CPU requirement.
Virtualization requires the underlying CPU to be the same as the guest was compiled for; emulation allows the guest to run on a different CPU by translating all guest instructions.
How many kernels run with application containment (zones)?
Only one — the host OS kernel.
What is live migration?
Moving a running guest between systems without interrupting user access to the guest or its apps.
Live migration: why is step 4 repeated?
During step 4 (sending read-write pages) some pages were probably modified by the guest and are now dirty, so they must be sent again.