Ask Your Question

How to avoid accidental removal of the stack with the heat stack-delete

asked 2019-07-19 00:26:11 -0500

snowmoon gravatar image

updated 2019-07-19 02:21:17 -0500

Hello , We are developing the heat script for our deployment and all our execution from a node called deployer .Once the stack is created ,how I can lock the stack to avoid the accidental deletion of my stack . if some some has accidentally execute heat stack-delete < stack-name> all my instance will get deleted .

So once the deployment is completed I want to lock the entire stack from deletion or upgrade ,but there should be some option to unlock also when I want to upgrade the same .

Thanks sarath chandran

edit retag flag offensive close merge delete


You can not lock the stack and there is nothing as such. When you try to delete a stack it does prompt the user for the confirmation. I can imagine you are wanting a functionality which we have in AWS which enables the deletion locking, but there is nothing like this in OS

Syed Awais Ali gravatar imageSyed Awais Ali ( 2019-07-25 04:18:27 -0500 )edit

Thank you Sayed . Yes I expected the same aws functionality to avoid accidental deletion . I think I can lock the instance once its deployed .. Not sure this will also over ride if I delete stack

snowmoon gravatar imagesnowmoon ( 2019-07-27 09:18:31 -0500 )edit

2 answers

Sort by ยป oldest newest most voted

answered 2019-07-29 06:12:41 -0500

updated 2019-07-29 06:13:02 -0500

Hey, As you have read my comment and Zaneb's answer on the stack locking stuff. For your next query about the instance locking, yes we can lock the instance state that will prevent users to accidentally perform any undesirable actions on the instance. Please see the following code in compute api

Also please refer to the openstack docs here

You can do

Nova lock <instance-name>

to lock the instance

Hope that helps !!

edit flag offensive delete link more

answered 2019-07-22 18:46:45 -0500

zaneb gravatar image

There's no way to lock a stack. The stack delete command does prompt for confirmation if run from an interactive shell, to try to reduce accidents.

edit flag offensive delete link more


Thanks Zaned . Can we lock instance instead of locking stack ?

snowmoon gravatar imagesnowmoon ( 2019-07-27 09:19:04 -0500 )edit

One thing you can do is set deletion_policy: retain on servers so that if the stack does get deleted the servers are not removed. (If you really want to delete you can always update the stack again to remove the deletion policy first.)

zaneb gravatar imagezaneb ( 2019-07-29 10:54:04 -0500 )edit

Thank you ! This should work for me

snowmoon gravatar imagesnowmoon ( 2019-08-01 03:29:48 -0500 )edit

I just found today this feature in AWS CFN: may be worth implementing smth like that in Heat as well

pas-ha gravatar imagepas-ha ( 2019-12-10 07:17:13 -0500 )edit

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: 2019-07-19 00:26:11 -0500

Seen: 220 times

Last updated: Jul 29 '19