Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a small EC2 instance running Ubuntu 9.10. I cannot stop or terminate it because it's a production server and we cannot lose our IP.

I have an Amazon EBS volume that is our root drive and I have several snapshots of this drive. We attempted to upgrade our version of PHP today and it nuked a few things. I need to reload an old snapshot without terminating or stopping the instance. How can this be done?


share|improve this question
up vote 1 down vote accepted

Whenever you find yourself in a situation where a server cannot be rebooted, you ought to question how you have things set up. Amazon has their Elastic IP product specifically for this purpose. I'd recommend that you get that set up.

Regarding your snapshot, I'd be very hard pressed to believe you'll be able to do this. Even if it were possible to restore a snapshot to a running system, the operating system would not survive that without crashing. You're either going to need to fix the PHP issues or you'll need to swallow your pride and just deal with a bit of downtime.

To ensure your downtime is as short as possible, shorten the TTL of the DNS record for this host to 60 seconds or something like that. This will ensure that DNS resolvers won't cache the record for too long. When you're ready, take down the server, restore the snap, fire up a new instance, and re-configure your DNS to point to the elastic IP.

share|improve this answer
Thanks, not sure how I missed the Elastic IPs. Really wish I had saw those back in August. – mdgreenwald Nov 24 '10 at 5:04
Sure thing - hopefully it'll work out well for you. I certainly don't envy the situation that you're currently in, but hopefully you'll be able to pull out of it without too much hassle and/or downtime. – EEAA Nov 24 '10 at 5:07
Eh, it's not so bad. My excitement about being able to test new products on a test instance and then re-map the elastic IP when it's ready to go live and then ditch the old instance makes up for the headache. – mdgreenwald Nov 24 '10 at 5:27

You can't do exactly what you're asking. You'll need to start a new instance off of the snapshot, and then you can either:

  • Copy the affected files back to your old instance, or...
  • Change DNS or move the elastic IP to point to your new instance, moving the production traffic over.

I'd recommend the latter, as going through the process will make sure you're prepared to bring your service back up in case an instance fails.

It sounds like you might not be using an elastic IP, because you're worried about losing your IP. Because instances fail under normal operation, you'll want to get that fixed ASAP. You can work without elastic IPs, but you need some other layer of abstraction: DNS or elastic load balancer can both work well.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.