Update stack with change number of resources group cause of error

Bug #1756266 reported by Quan Phuong Cong
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Incomplete
Undecided
Unassigned

Bug Description

I created a stack with Heat, using OS::Heat::ResourceGroup. but when i update the number of resource in group, i had an error: the old resources is updated fail. I don't want to update resources, only want change the number of resource in the group. The template is like this:

```
  rg:
    type: OS::Heat::ResourceGroup
    depends_on: wait_condition
    properties:
      count: {get_param: count}
      resource_def:
        type: resource.yaml
```

the resource.yaml is group resource with 1 cinder volume and 1 instance, not any more.

I send the update request through API, follow this link https://developer.openstack.org/api-ref/orchestration/v1/index.html#update-stack-patch

Here is my resource file http://paste.openstack.org/show/702856/

and the params that i send to api: {"existing": true, "parameters" => {"count" => x}}

I don't know why when i send the patch or put action, the resourcegroup will update the existing resource.

Revision history for this message
Thomas Herve (therve) wrote :

Can you describe how it failed? Can you attach the logs? Thanks.

Changed in heat:
status: New → Incomplete
Revision history for this message
Quan Phuong Cong (wayarmy) wrote :

The log is below:

resources[0]: resources.asg.Resource CREATE failed: BadRequest: resources.minion-instance: Invalid volume: Invalid input received: Invalid volume: Volume status must be available to reserve, but the status is in-use. (HTTP 400) (Request-ID: req-a4d7cec7-428f-4146-a342-6c2774214e7d) (HTTP 400) (Request-ID: req-515cdeff-4c8c-4c80-975f-7cc119b9e8f7)

I create a stack with HOT at above, with params specific in API request. After that, i need to scale up the stack, so that i send the api patch the stack, with params: {"existing": true, "parameters" => {"count" => x}}.

And i got the error that i sent you above. i don't change the params define in resource group's properties. But all resources that created and existing in resource group is recreated.

Please explain that. i don't know why the existing resource need to be update when i don't change everything.

Revision history for this message
Rabi Mishra (rabi) wrote :

I just tested it and it seems to work as expected on master, I don't think anything has changed since pike for it to not work too.

I guess something has changed when you first updated the stack (key_name may be), due to which heat is trying to replace the server resource and replacement of server resources using bdm does not work as heat would first try to create a replacement and the volume resource would be still attached to server.

Revision history for this message
Quan Phuong Cong (wayarmy) wrote :

I found the problem. In my stack template, i define resourcegroup depends_on a waitcondition. And when i remove depends_on , everything will be ok. I think you need to check the logic of updating action.

Anw, thanks so much!!!

Rico Lin (rico-lin)
Changed in heat:
milestone: none → no-priority-tag-bugs
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.