8

I have created an AMI, but I would like to use instance storage for some scientific programs I want to run. They basically read a bunch of stuff from disk, write it back out to disk and then summarize those results. This needs to be on Windows because that is the platform these programs were written for. I don't need to the files to persist and I don't really care if I lose them, so I would like to use instance storage for this and not incur any fees for I/O.

So, I boot up my AMI, but when I remote in, I only see my EBS root device. How can I mount the instance (ephemeral) storage that is available to me?

3
  • 2
    You either need to specify the block device mappings (e.g. -b /dev/xvdb=ephemeral0) by passing them to ec2-run-instances, or they need to be part of your AMI (i.e. added with ec2-register). See the documentation for details on how much instance storage is available and which device/mountpoint you can access it from.
    – cyberx86
    May 5, 2012 at 18:44
  • 1
    @cyberx86 thanks. block device mapping is the term i needed. now i get tons of google ideas on this. i will look into it. thanks! your response seems more like an answer than a comment to me.
    – oob
    May 5, 2012 at 18:48
  • It's a bad habit of mine, posting answers as comments (comments are quicker and easier to write up and have no penalty for being incorrect). While I use EC2 a lot, I don't use Windows servers - hence the reason for the comment. I have posted it as a generic answer however.
    – cyberx86
    May 5, 2012 at 19:08

1 Answer 1

8

While all instances, other than the t1.micro, do have an allocation of 'instance storage' (i.e. ephemeral storage), that storage is not necessarily attached by default. In most cases, instances with an EBS root volume will have zero or one attached ephemeral volumes.

The ephemeral disks, available to an instance are labelled ephemeral[0-3]. You can NOT attach these to an instance once it has been launched. (On the other hand, you can add EBS volumes to an instance while it is running).

Since ephemeral disks, together with EBS volumes, are block devices, AWS calls the mapping of these disks to an instance's devices 'block device mappings', and these can be specified either using the -b or --block-device-mapping parameters (which you can use more than once).

In order to change the ephemeral disks attached to the instance, you need to either:

  1. launch the instance explicitly specifying the ephemeral disk mappings OR

    ec2-run-instances ami-xxxxxxxx -b /dev/xvdb=ephemeral0 -b /dev/xvdc=ephemeral1 -b /dev/xvdd=ephemeral2 -b /dev/xvde=ephemeral3
  2. register a new AMI, explicitly specifying the ephemeral disk mappings (and an EBS root):

    ec2-register -n Image_Name -d Image_Description --root-device-name /dev/xvda1 -b /dev/xvda1=snap-xxxxxxxx -b /dev/xvdb=ephemeral0 -b /dev/xvdc=ephemeral1 -b /dev/xvdd=ephemeral2 -b /dev/xvde=ephemeral3

Note, on windows instance, you will specify the device as /dev/xvdX, whereas on Linux instances you will specify it as /dev/sdX (although, modern Linux kernels will still show this device as /dev/xvdX, with a symlink to /dev/sdX). Additionally, Windows instances will format the instance store volumes to NTFS (although, by default, the volumes come formatted as ext3).

AWS details the available instance storage and allocations in their documentation.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .