72

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?

Adam Matan
  • 12,504
  • 19
  • 54
  • 73
  • 14
    This is a good question. Why was it down-voted? I recommend adding explanations when you down-vote. – Chad Johnson Jan 12 '15 at 01: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 Apr 25 '16 at 06:34
  • 3
    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
  • 1
    This is a very useful question! – RKA Oct 15 '18 at 14:58

4 Answers4

58

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.

pauska
  • 19,532
  • 4
  • 55
  • 75
  • 5
    Thanks! Pity they don't provide an explanation in their page. – Adam Matan Oct 15 '14 at 09:14
  • 4
    http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/virtualization_types.html – Shatiz Oct 25 '15 at 12:49
  • 3
    @Shatiz Thanks. This is a very strange UI choice - let the user choose between 2 acronyms and provide no in-page assistance. – Adam Matan Nov 01 '15 at 17:43
  • Would be nice to add, HVMG2 in the answer as well – OK999 Oct 23 '17 at 04:33
  • Xen has been dropped by Amazon in 2017 it seems: https://www.theregister.co.uk/2017/11/07/aws_writes_new_kvm_based_hypervisor_to_make_its_cloud_go_faster/ – Ciro Santilli OurBigBook.com Jan 16 '19 at 14:22
  • @AdamMatan I think it's a very sensible User Experience, it provides no explanation since it doesn't want to pester novice and intermediate users with details that may hinder. Therefore aws provides expert users the ability to choose, at almost no cost to users who don't know or care about the type of virtualization. – TZubiri Jul 13 '19 at 18:50
4

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.

anrajme
  • 151
  • 2
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.

Grit
  • 21
  • 2
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

beehuang
  • 101
  • 1