EC2 is "Virtualization as a service".
Virtualization enables the ability to run multiple operating systems on the same physical machine.
Virtualization OSs run on top of host OS/hypervisor. The combination of the OS and apps are known as Virtual Machines.
The hypervisor runs binary translation to ensure virtual machines didn't clash, but this came with a performance penalty.
The software running on the hypervisor run in priviledged mode.
Virtual machines also had virtual resources allocated to them and physical devices mapped to them.
The guest OS would still think they're running in priviledged mode, so they needed a special arrangement to ensure it didn't crash. The hypervisor fixed this by running a process know as binary translation. It is really, really slow.
The guest OSs are still running with allocated resources, but instead of the slow binary translation used by the hypervisor, another approach is used.
This only works on a small subset of OSs - OSs which can be modified. There are areas of the guest OSs that attempt to make priviledged calls where the calls are modified. Instead of calling directly to the hardware, they make calls to the hypervisor called "hyper calls".
The source code of the guest OS is modified for the particular called and for the particular vendor (hypervisor) performing the virtualization.
This massively improved performance, but still required software.
This is where the hardware is virtualization aware. For example, the CPU contains specific instructions and capabilities so that the hypervisor can directly control and configure support. The CPU knows that virtualization exists.
The instructions from the OS are redirected to the hypervisor by the hardware and the hypervisor directs how these operations run. This improves performance again.
Because there is still shared devices like a network card, there can still be performance degradation from the software.
Single Root IO Virtualization. This is a very complex and feature-rich set of standards.
It allows any connected device to be presented to the guest OS as if each have their own card. In EC2, this is "enhanced networking".
AWS have their own network stack known as "Nitro" which will be presented later.
A primary ENI is provised within a subnet which maps to the data network on the host.
EC2 host can connect to EBS. This service also runs within a specific AZ.
Instances stays on host unless:
What is EC2 good for?
Choosing an EC2 instance type is done to influence a few things:
For example, R5dn.8xlarge
. The full name is named the instance type.
8xlarge
. The is a logical and often linear relationship for the sizes.dn
.Some resources: