How can I add an ephemeral disk to an existing EC2 instance?

Six months ago I created an EC2 Instance with a Plesk license from the AWS Marketplace. Now I would like to add an ephemeral disk in order to put the temporal backup data generated by the Plesk.

The problem is that I cannot find a way to add an ephemeral disk to an existing instance (even stopping it).

I already have tried to create a new instance with the ephemeral disk and attach the root volume from the old instance. With this alternative I had a lot of problems coming from the plesk (Mainly because they have different internal IPs).

I know that I have the option create a new instance with a new disk and restore a Plesk backup from the old server.

The question is if I can add this ephemeral disk in a faster/easier way that just create a new server and copy the data from the old one.


Solution 1:

Just to provide some clarification on the initial point here: you cannot add an EPHEMERAL drive to an instance AFTER initial creation. Ephemeral drives are a part of the base instance configuration which is only written on instance creation, and is non-modifiable.

Another point to bear in mind, though you may already know this, is that ephemeral drives are not available on t1.micro instances.

Solution 2:

I do this a bit at work. Your process needs to be something like

  1. Stop the server (do whatever failovers or rerouting you need to)
  2. Create an AMI from the stopped instance, right click and choose "Create Image" make sure you add one "Instance Store X" for each ephemeral disk expected. More is totally okay (an i3.16xlarge offers 8 ephemeral disks, so plan ahead for future growth) enter image description here
  3. Wait for AMI to complete
  4. (optional) If you want to encrypt the disk, use "Copy AMI" to the same region now, and turn on encryption. You'll end up with a second AMI, with encrypted disks.
  5. Create a new instance from that AMI. It will come up with a new IP but all the other data exactly the same, so you may wish to move the private IP over from the original server.

After a couple days you can cleanup by deleting the AMI and the original stopped host.