Upload
others
View
14
Download
0
Embed Size (px)
Citation preview
The principles Benefits Shortcomings Technicalities Use cases Examples Roundup
Virtualization – the Rabbit Hole Goes Deep
Leonid Bloch
[project21] TheAlternative
October 25, 2018
Leonid Bloch [project21] TheAlternative
Virtualization – the Rabbit Hole Goes Deep
The principles Benefits Shortcomings Technicalities Use cases Examples Roundup
A virtual computer?
What are computers, really?
◮ All computers are machines for solving logical problems using simple operations
Leonid Bloch [project21] TheAlternative
Virtualization – the Rabbit Hole Goes Deep
The principles Benefits Shortcomings Technicalities Use cases Examples Roundup
A virtual computer?
Logic is logic
◮ Which problems a computer can solve?
◮ Any solvable logical problem! (Can be mathematically proven!)
Leonid Bloch [project21] TheAlternative
Virtualization – the Rabbit Hole Goes Deep
The principles Benefits Shortcomings Technicalities Use cases Examples Roundup
A virtual computer?
Logic is logic
◮ Which problems a computer can solve?
◮ Any solvable logical problem! (Can be mathematically proven!)
Turing completeness:
If a machine answers to some very simple requirements:
◮ Can perform logical operators (IF, AND, NOT)
◮ Random access to as much memory as needed
Then it can be proven that it can solve any solvable logical problem!
Leonid Bloch [project21] TheAlternative
Virtualization – the Rabbit Hole Goes Deep
The principles Benefits Shortcomings Technicalities Use cases Examples Roundup
A virtual computer?
A sea of possibilities
◮ But the hardware is a Turing machine etched on asemiconductor, and (most of) the programminglanguages that run on it are Turing complete, can“hardware” be written in a programming language?
Leonid Bloch [project21] TheAlternative
Virtualization – the Rabbit Hole Goes Deep
The principles Benefits Shortcomings Technicalities Use cases Examples Roundup
A virtual computer?
A sea of possibilities
◮ But the hardware is a Turing machine etched on asemiconductor, and (most of) the programminglanguages that run on it are Turing complete, can“hardware” be written in a programming language?
◮ Sure!!!
Leonid Bloch [project21] TheAlternative
Virtualization – the Rabbit Hole Goes Deep
The principles Benefits Shortcomings Technicalities Use cases Examples Roundup
A virtual computer?
A simulation inside a simulation... inside a simulation???
Leonid Bloch [project21] TheAlternative
Virtualization – the Rabbit Hole Goes Deep
The principles Benefits Shortcomings Technicalities Use cases Examples Roundup
A virtual computer?
A simulation inside a simulation... inside a simulation???
Leonid Bloch [project21] TheAlternative
Virtualization – the Rabbit Hole Goes Deep
The principles Benefits Shortcomings Technicalities Use cases Examples Roundup
A virtual computer?
A simulation inside a simulation... inside a simulation???
Leonid Bloch [project21] TheAlternative
Virtualization – the Rabbit Hole Goes Deep
The principles Benefits Shortcomings Technicalities Use cases Examples Roundup
What is it good for?
A truly unbreakable computer
Physical hardware:
◮ Overheats
◮ Corrodes
◮ Wears
◮ Burns
◮ Gets outdated!
Virtual hardware:
◮ In most of the cases to the left canbe migrated to another physicalhardware, in many cases whileoperating!
Leonid Bloch [project21] TheAlternative
Virtualization – the Rabbit Hole Goes Deep
The principles Benefits Shortcomings Technicalities Use cases Examples Roundup
What is it good for?
A truly unbreakable computer
Physical hardware:
◮ Overheats
◮ Corrodes
◮ Wears
◮ Burns
◮ Gets outdated!
Virtual hardware:
◮ In most of the cases to the left canbe migrated to another physicalhardware, in many cases whileoperating!
◮ Except the burn case. Well, then itsstate can be backed up – easily!
Leonid Bloch [project21] TheAlternative
Virtualization – the Rabbit Hole Goes Deep
The principles Benefits Shortcomings Technicalities Use cases Examples Roundup
What is it good for?
Totally predictable
◮ Sometimes it’s important for hardware to be totally predictable (scientificcalculations, traffic control...)
◮ Physical hardware, even of the same model, can vary!
◮ Virtual hardware is always identical
Leonid Bloch [project21] TheAlternative
Virtualization – the Rabbit Hole Goes Deep
The principles Benefits Shortcomings Technicalities Use cases Examples Roundup
What is it good for?
Transparent hardware
◮ Most of the hardware is not open-source
◮ Regardless, it’s impossible to verify its functionality in non-destructive methods.
Leonid Bloch [project21] TheAlternative
Virtualization – the Rabbit Hole Goes Deep
The principles Benefits Shortcomings Technicalities Use cases Examples Roundup
What is it good for?
Transparent hardware
◮ Most of the hardware is not open-source
◮ Regardless, it’s impossible to verify its functionality in non-destructive methods.
◮ However... many hypervisors∗/emulators are open-source, and have the samebenefits as other FOSS.
∗ – The components which provide the virtual machines with their hardware assets.
Leonid Bloch [project21] TheAlternative
Virtualization – the Rabbit Hole Goes Deep
The principles Benefits Shortcomings Technicalities Use cases Examples Roundup
What is it good for?
Write your own hardware!
Example: Intel gigabit ehternet card – physical:
◮ Multi-billion Dollar facilities
◮ Extremely complicated manufacturing process
◮ Thousands of engineers
Leonid Bloch [project21] TheAlternative
Virtualization – the Rabbit Hole Goes Deep
The principles Benefits Shortcomings Technicalities Use cases Examples Roundup
What is it good for?
Write your own hardware!
Leonid Bloch [project21] TheAlternative
Virtualization – the Rabbit Hole Goes Deep
The principles Benefits Shortcomings Technicalities Use cases Examples Roundup
What is it good for?
Write your own hardware!
Example: Intel gigabit ehternet card – emulated:
◮ Three months of work for two engineers◮ One engineer and an apprentice, actually
◮ Works exactly according to Intel specifications◮ However, it is impossible to know the unspecified behavior of the physical card!
Therefore if a misfit with the specs is known, it has to be emulated!
Leonid Bloch [project21] TheAlternative
Virtualization – the Rabbit Hole Goes Deep
The principles Benefits Shortcomings Technicalities Use cases Examples Roundup
What is it good for?
Write your own hardware!hw/net/e1000e.c :
[...]
static uint64_t
e1000e_mmio_read ( void *opaque , hwaddr addr , unsigned size)
{
E1000EState *s = opaque ;
return e1000e_core_read (&s->core , addr , size);
}
static void
e1000e_mmio_write ( void *opaque , hwaddr addr ,
uint64_t val , unsigned size)
{
E1000EState *s = opaque ;
e1000e_core_write (&s->core , addr , val , size);
}
[...]
Leonid Bloch [project21] TheAlternative
Virtualization – the Rabbit Hole Goes Deep
The principles Benefits Shortcomings Technicalities Use cases Examples Roundup
What is it good for?
Total control by the user
◮ Did you ever modify the configuration of your home PC?
◮ Well now you can also modify the internals of your CPU!
Leonid Bloch [project21] TheAlternative
Virtualization – the Rabbit Hole Goes Deep
The principles Benefits Shortcomings Technicalities Use cases Examples Roundup
No perfect solution
Real hardware overhead
Running VMs comes at a cost:
◮ The physical hardware has to run another kernel (OS).
◮ The physical hardware has also to run the hypervisor
◮ The emulated hardware has to use the logic of the physical hardware throughabstractions
... And obviously the performance degrades.
Leonid Bloch [project21] TheAlternative
Virtualization – the Rabbit Hole Goes Deep
The principles Benefits Shortcomings Technicalities Use cases Examples Roundup
No perfect solution
Passthrough & other solutions
But fear not – modern VMs work at close to native speeds!
◮ Modern CPUs “know” that they are likely to be used for running VMs, and supplyhypervisors with optimized logic for that (Intel VT-x, AMD-V, ...).
◮ If a truly native performance is desired, physical devices can be assigned directlyto a VM.
◮ There are virtual devices that are optimized for VM usage – do not emulate anyreal-world device (paravirtualized). They are designed to work fast in VMs, andusually use some hardware acceleration.
◮ There are physical devices which incorporate optimizations for VM usage(KVMGT, scalable I/O, ...).
Leonid Bloch [project21] TheAlternative
Virtualization – the Rabbit Hole Goes Deep
The principles Benefits Shortcomings Technicalities Use cases Examples Roundup
No perfect solution
What about containers?
Containers:
◮ Run natively on the hardware
◮ Use the host kernel
◮ Provide isolated environment on asoftware level (namespaces, etc...)
◮ Very fast to launch
◮ Smaller image sizes
◮ Fit for single application needs
Virtual machines:
◮ Run on emulated hardware (may bedifferent architecture than the host)
◮ Use their own kernels
◮ Stronger isolation from the host
◮ Slower to launch (entire boot process)
◮ More overhead on the host
◮ Provide more complete environments
∗ Lately it’s fashionable to mix VMs and containers, and a “hot trend” now is to usethe same management tools for both.
Leonid Bloch [project21] TheAlternative
Virtualization – the Rabbit Hole Goes Deep
The principles Benefits Shortcomings Technicalities Use cases Examples Roundup
Tools
Many tools...
Leonid Bloch [project21] TheAlternative
Virtualization – the Rabbit Hole Goes Deep
The principles Benefits Shortcomings Technicalities Use cases Examples Roundup
What can it be used for, in practice?
The trivial example – the clouds around us
◮ When you go to google.com do you think that you connect to a physical server?◮ “Do you think it’s air you’re breathing now, Neo?”
◮ All the major cloud providers use VMs, for their flexibility and fault-tolerance.
◮ You can actually rent the same VMs that Amazon and Google use for your ownneeds.
◮ Need a beast with 128 cores and 1 TB of RAM for some data crunching? For justa few hours? No problem, under $100!
◮ Need a small webserver for your own VPN solution? No problem – few $ a year!
Leonid Bloch [project21] TheAlternative
Virtualization – the Rabbit Hole Goes Deep
The principles Benefits Shortcomings Technicalities Use cases Examples Roundup
What can it be used for, in practice?
Migration between servers? How about migration between clouds?
Leonid Bloch [project21] TheAlternative
Virtualization – the Rabbit Hole Goes Deep
The principles Benefits Shortcomings Technicalities Use cases Examples Roundup
What can it be used for, in practice?
Migration between servers? How about migration between clouds?
But what if... the virtualization layer was running on a virtualization layer itself?
◮ Cloud infrastructure is very difficult for an organization to disconnect from.
◮ Yet cloud providers (Amazon, Google, Microsoft) often change prices and terms.
◮ The solution?
Leonid Bloch [project21] TheAlternative
Virtualization – the Rabbit Hole Goes Deep
The principles Benefits Shortcomings Technicalities Use cases Examples Roundup
What can it be used for, in practice?
Migration between servers? How about migration between clouds?
But what if... the virtualization layer was running on a virtualization layer itself?
◮ Cloud infrastructure is very difficult for an organization to disconnect from.
◮ Yet cloud providers (Amazon, Google, Microsoft) often change prices and terms.
◮ The solution?
◮ Work with a cloud infrastructure that can migrate your infrastructure,transparently to you, between different cloud providers!
◮ We mentioned migration between servers? How about migration between clouds?
Leonid Bloch [project21] TheAlternative
Virtualization – the Rabbit Hole Goes Deep
The principles Benefits Shortcomings Technicalities Use cases Examples Roundup
What can it be used for, in practice?
Seamless VM on the desktop – the perfect control
Leonid Bloch [project21] TheAlternative
Virtualization – the Rabbit Hole Goes Deep
The principles Benefits Shortcomings Technicalities Use cases Examples Roundup
What can it be used for, in practice?
Seamless VM on the desktop – the perfect control
Control employee computing at sensitive organizations (banks, government, ...)
◮ No dedicated bulky hardware
◮ Full control and tracking by the organization – mouse, keyboard, screen◮ Even if you take a screenshot with a camera!
◮ On boot an underlying (host) OS starts transparently to the user, and the OSwhich the user ever sees runs inside a VM!
Leonid Bloch [project21] TheAlternative
Virtualization – the Rabbit Hole Goes Deep
The principles Benefits Shortcomings Technicalities Use cases Examples Roundup
What can it be used for, in practice?
Your ideas?
???
Leonid Bloch [project21] TheAlternative
Virtualization – the Rabbit Hole Goes Deep
The principles Benefits Shortcomings Technicalities Use cases Examples Roundup
A short migration demo
Live migration with QEMU demo
1. Start source VM
2. Start destination VM (idle while waiting for the incoming “ghost”)
3. Go to the monitor interface of the first VM
4. migrate -d tcp:<destination IP>:<destination port>◮ ...And follow the progress with: info migrate
5. Done!
Leonid Bloch [project21] TheAlternative
Virtualization – the Rabbit Hole Goes Deep
The principles Benefits Shortcomings Technicalities Use cases Examples Roundup
And finally...
What now?
◮ Q&A – now
◮ 10 min. break
◮ Hands on session!Please see the hands-on walkthrough here:https://github.com/blochl/pVM/blob/demo/LinuxDays.md
Leonid Bloch [project21] TheAlternative
Virtualization – the Rabbit Hole Goes Deep
The principles Benefits Shortcomings Technicalities Use cases Examples Roundup
And finally...
Credits
◮ The template for these slides was written by Christian Horea, and is availablehere: https://bitbucket.org/TheChymera/ld_foss/src
◮ Some images used in this presentation are copyrighted. They are used here underthe protection of the Fair Use Act, as this presentation is non-commercial, andmade for educational purposes only.
Leonid Bloch [project21] TheAlternative
Virtualization – the Rabbit Hole Goes Deep