[Openstack] [Heat] Heat-stack deletion and re-creation

ESWAR RAO eswar7028 at gmail.com
Tue Jul 19 01:45:01 UTC 2016


Hi All,

Below are some observations:

(1) Delete existing stack
(2) Re-create heat stack again with same stack-name and with same template
as part of some kind of healing

But , when heat-engine is trying to create stack, there's again DELETE
operation on same stack-name and creation is getting FAILED.

If I keep some delay between (1) and (2) then stack re-creation is going
fine.


**************** stack-delete operation ****************

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": "80.0.0.0/24"},
"stack_status_reason": "Stack DELETE started", "stack_name":
"NSO-4ed70f4e-c4fd-49db-a6cd-30133a1daa17", "creation_time":
"2016-07-15T09:57:46Z", "links": [{"href": "
http://10.210.6.32:8004/v1/5c193081803c48c3a02f4f6986ba979f/stacks/
<http://10.213.6.32:8004/v1/5c193081803c48c3a02f4f6986ba979f/stacks/>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


**************** stack-get returned NotFound ****************

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

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

**************** CREATION request ****************

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": "80.0.0.0/24"},
"stack_status_reason": "Stack CREATE started", "stack_name":
"NSO-4ed70f4e-c4fd-49db-a6cd-30133a1daa17", "creation_time":
"2016-07-15T10:03:05Z", "links": [{"href": "
http://10.210.6.32:8004/v1/5c193081803c48c3a02f4f6986ba979f/stacks/
<http://10.213.6.32:8004/v1/5c193081803c48c3a02f4f6986ba979f/stacks/>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

**************** BUT again DELETE ****************

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
****************************************************************

Thanks



On Fri, Jul 15, 2016 at 9:15 PM, ESWAR RAO <eswar7028 at gmail.com> wrote:

> Hi All,
>
>
> After deleting the heat-stack , I am polling until the stack is DELETED.
>
> I am following below way of polling until stack-get fails with
> HTTPNotFound Exception.
>
> Is there any other better way of checking whether stack is DELETED instead
> of catching exception.
>
> >>> from heatclient.client import Client
>
> heat_client = Client('1', endpoint=heat_url, token=auth_token)
>
> heat_client.stacks.delete(stack_name)
>
>
> ******poll loop**********
>
> try:
>
>     stack_get = heat_client.stacks.get(stack_name)
>
> except (heatexception.HTTPNotFound):
>
>                 # stack is deleted
>
> if 'IN_PROGRESS' in stack_get.status:
>
>                # sleep and again loop
>
> *********************************
>
>
> Thanks
>
> Eswar
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20160719/72bbecba/attachment.html>


More information about the Openstack mailing list