Hacker News new | ask | show | jobs
by _rs 638 days ago
I thought AWS uses KVM, which is the same VM that QEMU would use? Or am I mistaken?
2 comments

AWS uses KVM in the kernel but they have a different, non-open source userspace stack for EC2; plus Firecracker which is open source but is only used for Lambda, and runs on EC2 bare metal instances.

Google also uses KVM with a variety of userspace stacks: a proprietary one (tied to a lot of internal Google infrastructure but overall a lot more similar to QEMU than Amazon's) for GCE, gVisor for AppEngine or whatever it is called these days, crosvm for ChromeOS, and QEMU for Android Emulator.

EC2 instances are using the Xen hypervisor. At least that's what reported by hostnamectl.
EC2 migrated off Xen around ten years ago. Only really old instances should be using Xen or Xen emulation.
I'm puzzled by your comment. On an EC2 instance of AL2023 deployed on us-east-1 region this is the output of hostnamectl:

  [ec2-user][~]$ hostnamectl
   Static hostname: ip-x-x-x-x.ec2.internal
         Icon name: computer-vm
           Chassis: vm 
        Machine ID: ec2d54f27fc534ea74980638ccc33d96
           Boot ID: 6caf18b7ed3647819c1985c11f128142
    Virtualization: xen
  Operating System: Amazon Linux 2023.5.20240903
       CPE OS Name: cpe:2.3:o:amazon:amazon_linux:2023
            Kernel: Linux 6.1.106-116.188.amzn2023.x86_64
      Architecture: x86-64
   Hardware Vendor: Xen
    Hardware Model: HVM domU
  Firmware Version: 4.11.amazon
KVM can emulate the Xen hypercall interface. Amazon is not using Xen anymore.
I'm not quite sure the status of it at least, but reported back in 2017 that they are moving off Xen

https://www.theregister.com/2017/11/07/aws_writes_new_kvm_ba...

It could be that it's not all over and tied to specific machine types still, or there's something they've done to make it report to the guest still that it's xen based for some compatibility reasons.

I think some older instance types are still on xen, later types run kvm (code named nitro.. perhaps?). I can’t remember the exact type but last year we ran into some weird issues related to some kernel regression that only affected some instances in our fleet, turns out they where all the same type and apparently ran on xen according to aws support
What instance type is it?
Lambda and Fargate.
It was true for Fargate some time ago, but is not true anymore since quite a while. All Fargate tasks run on EC2 instances today.
…which is probably the reason why task launches take 3-5 business weeks
Ah, interesting. Thanks for the correction!
unless something has changed in the past year, fargate still runs each task in a single use ec2 vm with no further isolation around containers in a task.
QEMU can use a number of different hypervisors, KVM and Xen being the two most common ones. Additionally it can also emulate any architecture if one would want/need that.