Ask Your Question

execute user data while deleting an instance

asked 2015-06-23 09:21:53 -0600

binou gravatar image

Hello, I am studying autoscalability in openstack.On in the OS::Heat::AutoscalingGroup we can execute a script in the user_data section while launching instances. So can we do the same thing while a machine is deleted? like execute a script when an instance is bieng deleted by Heat (OS::Heat::ScalingPolicy)

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2015-06-23 10:58:09 -0600

mpetason gravatar image

You'll need to look into Cloud-Init and see how your images are configured. Usually this is run only once when the instance is created, however you may be able to get creative and have it run when the instance is being deleted, especially if you build your images with an API to trigger jobs. I'm not sure about the best way to do this as I haven't had a requirement to modify anything when the Instance is getting removed. Most of your logic should be outside of the instances, such as Load Balancers/More.

You'll have to dig deeper to find more information, as you know exactly what you are looking for while I am somewhat guessing.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2015-06-23 09:21:53 -0600

Seen: 90 times

Last updated: Jun 23 '15