Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Amazon EC2: Ubuntu(PV) or Ubuntu(HVM)

I am about to launch Ubuntu instance on Amazon EC2. I'm choosing between PV and HVM options. I found that PV does provide a more efficient virtualization model though I could be wrong and as Amazon offers both options I'm suggesting that HVM may could have some benefits I will not get with PV. I want to use this virtual machine for GIT and maybe Team City in future. Could you help me to choose?

like image 822
alexxjk Avatar asked Mar 02 '14 16:03

alexxjk


People also ask

What is the difference between HVM and PV?

Linux Amazon Machine Images use one of two types of virtualization: paravirtual (PV) or hardware virtual machine (HVM). 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.

What version of Ubuntu does AWS use?

AWS OpsWorks Stacks supports the 64-bit versions of Ubuntu 12.04 LTS and Ubuntu 14.04 LTS. Ubuntu 12.04 is supported for all stacks.

What is the best Amazon EC2 instance type to use?

General-Purpose. M3 instances are the newest generation of general-purpose instances, and give you the option of a larger number of virtual CPUs (vCPUs) that provide higher performance. M3 instances are recommended if you are seeking general-purpose instances with demanding CPU requirements.

What version of Linux does Amazon EC2 use?

Optimized performanceAmazon Linux 2 includes support for the latest Amazon EC2 instance capabilities and is tuned for enhanced performance. It includes packages that help ease integration with other AWS Services.


3 Answers

I would say "go with PV" (on Linux) unless you have a reason. PV has been much better tested because it was the only option for many years. (HVM for Linux was only recently introduced outside of the very special Compute Cluster nodes.)

Converting between them isn't very hard -- especially if you do it right. By "do it right", I mean using something like Chef or Puppet or Ansible to build your server. This lets you put your "server" (well, server build process) under version control, which creates instant documentation for everyone to understand what's on your server.

Your root drive should be ephemeral, so that if the server dies, you can just re-launch and re-attach your EBS data. (And you can quickly upgrade the OS or server software by launching a 2nd instance to play with.) If you have an EBS root drive, you'll have to pay to store/backup your OS, and you'll never know if your server config is checked into version control or not.

UPDATE: Going forward, I would lean toward HVM, since performance can be much better (i.e. "Enhanced Networking"). Also, it's not "brand-new" anymore.

like image 54
BraveNewCurrency Avatar answered Oct 17 '22 05:10

BraveNewCurrency


In summer 2014, Amazon started recommending using HVM over PV AMIs as HVM seems to be the vision going forward. A lot of the newer & current generation instance types are only supported by HVM AMIs, for instance, memory optimized r3 types See here

With the push and R&D Amazon throwing in optimizing HVM, the PV AMI performance edge is going to be smaller and smaller IMMO.

like image 24
Devy Avatar answered Oct 17 '22 05:10

Devy


Amazon just recently came out with t2 instances that use only HVM. With the t2 instance aws introduces burstable performance(use resources when in need using credits, otherwise don't run in full power) and cpu credits(obtain credits if not running in full power over 24h period of time) to ec2 instances which lowers the price dramatically.

Currently this is available only on micro, small and medium instances.

Note that it won't have local instance storage so you'd need to include at least one ebs volume.

Check out the blog post

like image 15
Kristo J Avatar answered Oct 17 '22 05:10

Kristo J