Score:1

Launching Instance from AMI Creates two disk devices when only one is expected

cn flag

First some background. I am migrating an Ubuntu Instance-store backed ec2 instance to EBS using the steps outlined in Create an AMI from an instance store-backed instance.

Everything works correctly and I am able to create and register my AMI using:

aws ec2 register-image --region us-east-1 --name MASTER_EBS_AMI --block-device-mappings DeviceName=/dev/xvda,Ebs={SnapshotId=snap-0dd...} --virtualization-type hvm --architecture x86_64 --root-device-name /dev/xvda

I can successfully launch the new instance but when I look at the block devices I am expecting to see just /dev/xvda but there is also /dev/sda. /dev/xvda is a volume as expected but there is no trace of any volume for /dev/sda which isn't ideal since it does not allow snapshots (as far as I can tell).

At first I though perhaps they were the same device (identical contents) but after creating a unique file in each it was clear that they are indeed different.

My best guess is that the launch process is somehow copying the snapshot into both /dev/xvda and /dev/sda and booting from /dev/sda. /dev/sda seems ephemeral but the storage details say it is EBS and data is indeed persisted across a system stop / re-start;

Storage Settings

I've tried everything I can to find an explanation of what is happening here but everything I read suggests that it should behave exactly as I expect (i.e. one volume is created an mounted and is called /dev/sda or /dev/xvda).

Having the extra device isn't a big deal but I need to understand how exactly to access the underlying EBS or switch it to have just the one device.

Arrow Root avatar
sm flag
Thank you for the explanation. I'm facing the same issue, in my case I noticed when we try to create an ami from a specific Bitnami instance, some ephemeral volumes appear, even if these volumes didn't exist for the instance.
cn flag
So, not that anyone appears to be reading this (I suspect I'm about 5 years too late for this post), I did some more tests and discovered that these two disks are definitely the same but the contents written to /dev/sda aren't flushed to the EBS until it is shut down. There is definitely something funky going on with the drivers or possibly elsewhere.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.