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 have recently been recently using Amazon's CloudFormation to launch instances of EC2 Ubuntu machines running MongoDB.

When it comes to deleting the stack it often fails I guess due to not being able to dismount the ebs raid 10 drives Mongo is using.

I would like to something in that template (currently has bash script in user data) or machine to intercept that message, shutdown Mongo and dismount the drives so the delete can happen cleanly rather than having to be performed twice. Is there a simple way to augment CloudFormation to handle stack deletes more cleanly?

I realise there are alternatives (OWS running Chef 9 still / Chef installed on one of our machines in AWS / Juju / Puppet / etc / etc ) but right here and now I just want to get this working cleanly first if at all possible.

share|improve this question
add comment

1 Answer

We have similar problem due to the S3 buckets CF stack created could not be deleted if not empty.

Our solution/hack so far is have a bash script calling the AWS API using aws-cli to iterate though all S3 buckets and delete the contents inside first then call the aws cloudformation delete-stack.

For your problem you can do the same just detach ebs volumes on your Mongo instance before you delete the stack.

share|improve this answer
    
Thank you, I'll try this out all being well soon. I'll hold out for a couple of days on marking this as the accepted answer just in case someone figures it out just with the templates... though from what you are saying that is impossible :( –  paulecoyote Jul 26 '13 at 0:52
    
I agree on this solution. –  dialt0ne Jul 30 '13 at 13:41
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.