AWS – Find EC2 Instance virtualization type

Leave a comment

This article help you to find virtualization type of an Instance and AMI. I used awscli commands to demonstrate. The same details can be obtained from console too.

Identify virtualization type of EC2 Instance

Use the “describe-instances” command of EC2 CLI to get the virtualization type of already launched Instance.

aws --profile myaccount ec2 describe-instances --instance-ids i-xxxxxxxxx --query Reservations[].Instances[].[VirtualizationType] --output json
[
    [
        "paravirtual"
    ]
]

From output, can declare that Instance is paravirtual type virtualization.

Below is the example for HVM type Instance.

aws --profile myaccount ec2 describe-instances --instance-ids i-xxxxxxxxxx --query Reservations[].Instances[].[VirtualizationType]
[
    [
        "hvm"
    ]
]

Identify virtualization type of AMI

Use “describe-images” command of EC2 CLI.

aws --profile myaccount ec2 describe-images --image-ids ami-00d18e77 --query Images[].[VirtualizationType] --output json
[
    [
        "paravirtual"
    ]
]

From output, this is paravirtual type AMI. The output would be HVM in case AMI is of HVM type.

Kernel ID of Paravirtual Instance

Paravirtual Instances use customized boot loader named PV-GRUB. AWS provides the PV-GRUB in the form of AKI image. These AKI images available in all regions. When you start an instance, PV-GRUB starts the boot process and then chain loads the kernel specified by your image’s menu.lst file. Yes, PV-GRUB understands standard grub.conf or menu.lst commands

aws --profile myaccount ec2 describe-instances --instance-ids i-xxxxxxxxx --query Reservations[].Instances[].[KernelId]
[
    [
        "aki-dc9ed9af"
    ]
]

Find the latest version of AKI image available for your region, from AWS document Amazon PV-GRUB Kernel Image Id’s

Kernel ID of HVM Instance

HVM technology also called as full virtualization. HVM type Instances boot on its own. This is same like how bare metal systems boot. Here Linux operating system uses inbuilt boot loader usually GRUB.

aws --profile myaccount ec2 describe-images --image-ids ami-xxxxxx --query Images[].[KernelId] --output json
[
    [
        null
    ]
]

AWS will not aware of what kernel been used by Instance. Since it is fully controlled by guest operating system. Hence the Kernel-Id value is none for HVM machines.

Hope this small tip helps you. Please leave a comment if you have any query.

Leave a Reply

Your email address will not be published. Required fields are marked *