53

AWS EC2 offers two types of virtualization of Ubuntu Linux EC2 machines - PV and HVM.

PV: enter image description here

HVM: enter image description here

What is the difference between these types?

  • 9
    This is a good question. Why was it down-voted? I recommend adding explanations when you down-vote. – Chad Johnson Jan 12 '15 at 1:50
  • Mouse over the down arrow; the popup says "This question does not show any research effort; it is unclear or not useful". Downvotes without comment may be presumed to be for at least one of those reasons. – MadHatter supports Monica Apr 25 '16 at 6:34
  • 2
    okay - how can this be 'not useful'? my researching took me here ... i wish i have an option to down vote your comment :) – OK999 Oct 19 '17 at 20:38
  • This is a very useful question! – Ravi Kumar Oct 15 '18 at 14:58
45

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.

1

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.

1

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.

0

Now, On AWS, should use HVM and can get greater performance.

1)
HVM AMIs are required to take advantage of enhanced networking and GPU processing
2)
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.

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/virtualization_types.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.