How can I access instance storage on a Windows EC2 instance with an ebs root device?
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:
-
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
-
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.