How do we move a mistakenly configured EC2 instance from dedicated tenancy back to shared?

A friend accidentally configured an EC2 instance to use "dedicated" tenancy, not realizing that it didn't actually provide a dedicated server and was surprised it cost an additional $2/hour, so we're trying to untangle this now. We want to just change it over to use the default "shared" tenancy and not spend $1400/month for no reason.

The problem is that this is apparently a one-way operation. According to the AWS EC2 user guide, You can shut down an instance change its "shared" tenancy to "dedicated", but you can't undo it once it's launched:

After you launch an instance, there are some limitations to changing its tenancy.

  • You cannot change the tenancy of an instance from default to dedicated or host after you've launched it.
  • You cannot change the tenancy of an instance from dedicated or host to default after you've launched it.

It's true, the console doesn't give you the option to change tenancy back to "default". If you shut down the instance and use ec2 modify-instance-placement from the CLI like this:

aws ec2 modify-instance-placement \
    --instance-id i-0e6ddf6187EXAMPLE \
    --tenancy default

It causes the error: "An error occurred (InvalidTenancy) when calling the ModifyInstancePlacement operation: Invalid value 'default' for Tenancy."

Another approach is to launch a new instance with the correct tenancy, but using some kind of a snapshot of the current one and re-using the old one's EBS volumes. I could not for the life of me figure out how to do this in the AWS console, and I'm not sure the script I've cobbled together does the job.

In any case, we want to undo this mistaken configuration and end up with a running instance that is exactly the same as the current one, except with shared (default) tenancy. The instance is backed up, it is running Windows Server 2012 and SQL Server, has one public elastic IP, two EBS volumes and short downtime is allowable. What's the best way to get it done quickly and safely? Thanks for your advice in advance.


Solution 1:

Create a snapshot of the volume, create an AMI from that, and then launch a new instance. Documentation is here for Linux, here for Windows. I would copy out the steps but it's fairly pointless duplication, given AWS documentation is well maintained and regularly updated.