Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm looking for a way to have some kind of ephemere instances of Amazon EC2.

The idead would be to

  • launch an instance
  • do some work on it
  • reboot the instance (not stopping)
  • reset the hard disk to it's default state.

How can I do the latest step using Amazon mechanisme (or other ideas if this is not possible)?

Edit:

I want to do that because I would like to reset the state of the instance several time by hour without having to pay for a full hour each time. In Amazon you have to pay for a minimum of one hour each time you start an instance. I would like to be able to reset the instance to the initial state because the instance will be used by untrusted users that will have access to a not very secure application. I would like to be able to reset the instance each time a user logout. Only one user at a time will have access to the instance.

share|improve this question
    
Because what you're asking for is out of the ordinary it may help to explain why your're doing to do it that way. If we know what you're trying to achieve we can better answer you question. –  Drew Khoury Apr 6 '13 at 0:03
add comment

1 Answer

I'm not yet able to make comments, but I'm struggling to find the usefulness in what you've asked.

If you're looking to get a blank EC2, you can just terminate the existing one and bring up a new one. That's the AWS way of doing things.

You could create an AMI of the blank EC2 then create a new EC2 based off that blank AMI but that's more or less the same thing as my suggestion in the line above.

You can do all useful things programatically using the AWS APIs, like creating new machines, terminating or rebooting machines etc

If you're able to clarify exactly what you're hoping to achieve (and why you must reboot, not start with a new EC2) maybe we can come up with more tailored/useful solutions.

Edit:

Another approach would be to create an EBS and use that as your disk. Because it's life is independent of the EC2 you can do whatever you want with it. You should be able to restore from an AMI (a backup of a clean image) onto the EBS whenever you like.

Amazon Elastic Block Store – Amazon Elastic Block Store (EBS) offers persistent storage for Amazon EC2 instances. Amazon EBS volumes are network-attached, and persist independently from the life of an instance.

share|improve this answer
    
Agreed - just pop up new instances and drop the old. –  Rory Alsop Apr 5 '13 at 14:04
    
It's because each time you stop and start a new instance you have to pay for a minimum of one hour. I would like to be able reset the instance several time by hour. –  Yann Sagon Apr 6 '13 at 20:51
add comment

Your Answer

 
discard

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.