What is the difference between PV and HVM virtualization types in ec2?

Solution 1:

Amazon run on Xen, which provides Para-virtualization (PV) or Hardware-assisted virtualization (HVM).

Para-virtualization used to be the recommended choice, as it gave you better performance (with a much closer integration to the virtualization host, through patched specialized kernels/drivers on both the host and the guest).

Hardware-assisted virtualization uses the benefits provided in modern hardware, and it doesn't require any kind of custom kernel or patches. Recent benchmarks has proven that HVM is actually faster on certain workloads.

Solution 2:

One noticeable difference is paravirtual doesn't support GPU Instances.

I'd have created it as hvm had I known that I would want to relaunch it as a GPU instance.

edit: Hmm, actually, it seems like we can change from paravirtual to hvm while create an AMI.


Solution 3:

An extract from AWS documentation :

The main differences between PV and HVM AMIs are the way in which they boot and whether they can take advantage of special hardware extensions (CPU, network, and storage) for better performance.

HVM AMIs are presented with a fully virtualized set of hardware and boot by executing the master boot record of the root block device of your image. This virtualization type provides the ability to run an operating system directly on top of a virtual machine without any modification, as if it were run on the bare-metal hardware. The Amazon EC2 host system emulates some or all of the underlying hardware that is presented to the guest. Unlike PV guests, HVM guests can take advantage of hardware extensions that provide fast access to the underlying hardware on the host system. HVM AMIs are required to take advantage of enhanced networking and GPU processing.

PV AMIs boot with a special boot loader called PV-GRUB, which starts the boot cycle and then chain loads the kernel specified in the menu.lst file on your image. Paravirtual guests can run on host hardware that does not have explicit support for virtualization, but they cannot take advantage of special hardware extensions such as enhanced networking or GPU processing. Historically, PV guests had better performance than HVM guests in many cases, but because of enhancements in HVM virtualization and the availability of PV drivers for HVM AMIs, this is no longer true.