Reputation: 2221
On AWS EC2, if we launch and AMI with instance-store
, we can attach EBS volume for persisent store. Is the vice-versa possible.
ie.,
Can we add instance-store
volume when launching a EBS HVM AMI, the reason behind this is to use it as a swap.
I can't see the option to add Instance store on Storage Configuration, while launching a EBS backed instance.
Please let me know, if there is a method to achieve root volume as EBS and swap volume as instance-store
.
many thanks, Shan
Upvotes: 1
Views: 320
Reputation: 179054
If you are launching an instance class that includes instance store (ephemeral) disks, those should be accessible from Storage Configuration, as in this example, where the instance class provides two ephemeral disks.
See Instance Storage in the EC2 documentation to confirm whether the instance class you're launching includes instance store volumes. Some classes do not, and where that is the case, you can only select EBS
as the Volume Type.
If you're launching from an AMI that already contains references to the ephemeral disks, you should see something like this screen shot. If it doesn't include references to the instance store volumes, you can use Add New Volume
to include the desired instance store volumes with the new instance. Their sizes are fixed by the specs of the instance class, which is why Size
says N/A
. Since they are provided at no charge, you should always attach them at launch, even if you have no plan for them, because they can't be added after launching.
AMIs can't be edited, so if you want these included automatically on future launches, you'll need to build a new AMI, which you'll probably also want to be configured (within the OS boot sequence) to create and mount the desired swap space.
Upvotes: 2