Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EC2 instance - complete reinstall

I have an EC2 instance up and running (Linux). I've made some installations I'd like to completely undo. What would be the best/simplest way to get back to a clean instance?

like image 617
Asahi Avatar asked May 08 '13 08:05

Asahi


2 Answers

Start a new instance, running through your installation and configuration steps.

You can do this without terminating the old instance. This lets you look at configuration on the old instance in case you forgot how you set things up. It also lets you copy data or other files from the old instance to the new instance.

One you're completely happy with the new instance, terminate the old instance.

This approach of starting the new before destroying the old didn't make sense back in the days of physical servers, but EC2 gives us new ways to think about things.

Also: Document and/or script your installation and configuration steps so you can easily reproduce them in the future on new instances. Think about separating your data onto a second EBS volume so it can be easily moved to a new instance.

You should be comfortable with testing your setup scripts/docs repeatedly until they work just right on a brand new instance.

like image 87
Eric Hammond Avatar answered Sep 21 '22 15:09

Eric Hammond


Destroy it and create a new one using the same AMI, kernel, and any user-defined data/script that you passed to the original instance creation. Back any of your own data up to S3.

like image 34
Jim Dennis Avatar answered Sep 24 '22 15:09

Jim Dennis