<div dir="ltr"><div>Hi All,</div><div><br></div><div>Below are some observations:</div><div><br></div><div>(1) Delete existing stack</div><div>(2) Re-create heat stack again with same stack-name and with same template as part of some kind of healing</div><div><div><br></div><div>But , when heat-engine is trying to create stack, there's again DELETE operation on same stack-name and creation is getting FAILED.</div><div><br></div><div>If I keep some delay between (1) and (2) then stack re-creation is going fine.</div><div><br></div><div><br></div><div>**************** stack-delete operation ****************<br></div><div><br></div><div>2016-07-15 15:32:31.910 3069 DEBUG root [-] JSON response : {"stack": {"disable_rollback": true, "description": "HOT template to create  network service\n", "parameters": {"right-net-id": "5756a23c-e28f-4b99-a48c-bb5b9d2774fd", "OS::stack_id": "8a8bb460-761c-4151-b4cb-bdf992b09c41", "OS::stack_name": "TEST-4ed70f4e-c4fd-49db-a6cd-30133a1daa17", "nsid": "4ed70f4e-c4fd-49db-a6cd-30133a1daa17", "mgmt-net-id": "25e0c2b9-c99a-4c9c-9ee5-e2d89b703358", "left-subnet-cidr": "<a href="http://80.0.0.0/24" target="_blank">80.0.0.0/24</a>"}, "stack_status_reason": "Stack DELETE started", "stack_name": "NSO-4ed70f4e-c4fd-49db-a6cd-30133a1daa17", "creation_time": "2016-07-15T09:57:46Z", "links": [{"href": "<a href="http://10.213.6.32:8004/v1/5c193081803c48c3a02f4f6986ba979f/stacks/" target="_blank">http://10.210.6.32:8004/v1/5c193081803c48c3a02f4f6986ba979f/stacks/</a>TEST-4ed70f4e-c4fd-49db-a6cd-30133a1daa17/8a8bb460-761c-4151-b4cb-bdf992b09c41", "rel": "self"}], "capabilities": [], "notification_topics": [], "timeout_mins": null, "stack_status": "DELETE_IN_PROGRESS", "updated_time": "2016-07-15T10:01:59Z", "id": "8a8bb460-761c-4151-b4cb-bdf992b09c41", "template_description": "HOT template to create  network service\n"}} to_json /usr/lib/python2.7/dist-packages/heat/common/wsgi.py:577<br></div><div><p><br></p><p>**************** stack-get returned NotFound ****************<br></p><p>2016-07-15 15:32:46.918 3069 DEBUG heat.api.middleware.version_negotiation [-] Processing request: GET /v1/5c193081803c48c3a02f4f6986ba979f/stacks/TEST-4ed70f4e-c4fd-49db-a6cd-30133a1daa17 Accept: application/json process_request /usr/lib/python2.7/dist-packages/heat/api/middleware/version_negotiation.py:53<br></p><p>2016-07-15 15:32:46.978 3069 DEBUG root [-] JSON response : {"explanation": "The resource could not be found.", "code": 404, "error": {"message": "The Stack (TEST-4ed70f4e-c4fd-49db-a6cd-30133a1daa17) could not be found.", "traceback": "Traceback (most recent call last):\n\n  File \"/usr/lib/python2.7/dist-packages/heat/engine/service.py\", line 63, in wrapped\n    return func(self, ctx, *args, **kwargs)\n\n  File \"/usr/lib/python2.7/dist-packages/heat/engine/service.py\", line 336, in identify_stack\n    raise exception.StackNotFound(stack_name=stack_name)\n\nStackNotFound: The Stack (TEST-4ed70f4e-c4fd-49db-a6cd-30133a1daa17) could not be found.\n", "type": "StackNotFound"}, "title": "Not Found"} to_json /usr/lib/python2.7/dist-packages/heat/common/wsgi.py:577</p></div><div><br></div><div>**************** CREATION request ****************<br></div><div><p>2016-07-15 15:33:05.974 3069 DEBUG root [-] JSON response : {"stack": {"disable_rollback": true, "description": "HOT template to create  network service\n", "parameters": {"right-net-id": "5756a23c-e28f-4b99-a48c-bb5b9d2774fd", "OS::stack_id": "e97f118a-7e1a-46be-a680-10fa98c65abf", "OS::stack_name": "TEST-4ed70f4e-c4fd-49db-a6cd-30133a1daa17", "nsid": "4ed70f4e-c4fd-49db-a6cd-30133a1daa17", "mgmt-net-id": "25e0c2b9-c99a-4c9c-9ee5-e2d89b703358", "left-subnet-cidr": "<a href="http://80.0.0.0/24" target="_blank">80.0.0.0/24</a>"}, "stack_status_reason": "Stack CREATE started", "stack_name": "NSO-4ed70f4e-c4fd-49db-a6cd-30133a1daa17", "creation_time": "2016-07-15T10:03:05Z", "links": [{"href": "<a href="http://10.213.6.32:8004/v1/5c193081803c48c3a02f4f6986ba979f/stacks/" target="_blank">http://10.210.6.32:8004/v1/5c193081803c48c3a02f4f6986ba979f/stacks/</a>TEST-4ed70f4e-c4fd-49db-a6cd-30133a1daa17/e97f118a-7e1a-46be-a680-10fa98c65abf", "rel": "self"}], "capabilities": [], "notification_topics": [], "timeout_mins": null, "stack_status": "CREATE_IN_PROGRESS", "updated_time": null, "id": "e97f118a-7e1a-46be-a680-10fa98c65abf", "template_description": "HOT template to create  network service\n"}} to_json /usr/lib/python2.7/dist-packages/heat/common/wsgi.py:577</p><p>**************** BUT again DELETE ****************</p><p>2016-07-15 15:33:06.132 3069 DEBUG heat.api.middleware.version_negotiation [-] Processing request: DELETE /v1/5c193081803c48c3a02f4f6986ba979f/stacks/TEST-4ed70f4e-c4fd-49db-a6cd-30133a1daa17/e97f118a-7e1a-46be-a680-10fa98c65abf Accept: */* process_request /usr/lib/python2.7/dist-packages/heat/api/middleware/version_negotiation.py:53<br></p></div><div>****************************************************************</div></div><div><br></div><div>Thanks</div><div><br></div><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jul 15, 2016 at 9:15 PM, ESWAR RAO <span dir="ltr"><<a href="mailto:eswar7028@gmail.com" target="_blank">eswar7028@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi All,</div><div><br></div><div><br></div><div>After deleting the heat-stack , I am polling until the stack is DELETED.</div><div><br></div><div>I am following below way of polling until stack-get fails with HTTPNotFound Exception.</div><div><br></div><div>Is there any other better way of checking whether stack is DELETED instead of catching exception.</div><div><br></div><p style="font-size:12.8px"><span style="font-size:12.8px">>>> from heatclient.client import Client</span><br></p><p style="font-size:12.8px">heat_client = Client('1', endpoint=heat_url, token=auth_token)</p><p style="font-size:12.8px"></p><p><span><span style="font-size:12.8px">heat_client</span>.stacks.delete(stack_name)</span></p><p><span><br></span></p><p>******poll loop**********</p><p><span>try:</span></p><p><span></span></p><p><span><span style="font-size:12.8px">    </span></span>stack_get = <span style="font-size:12.8px">heat_client</span>.stacks.get(stack_name)</p><p><span>except</span><span> (heatexception.HTTPNotFound):</span></p><p><span></span></p><p><span>                </span><span># stack is deleted</span></p><p><span></span></p><p><span>if</span><span> </span><span>'IN_PROGRESS'</span><span> </span><span>in</span><span> stack_get.</span>status:</p><p>               # sleep and again loop</p><p style="font-size:12.8px">*********************************</p><p style="font-size:12.8px"><br></p><p style="font-size:12.8px">Thanks</p><span class=""><font color="#888888"><p style="font-size:12.8px">Eswar</p></font></span></div>
</blockquote></div><br></div></div>