OS::Heat::ResourceGroup validation failed if group "0" is removed
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Heat |
Fix Released
|
Medium
|
Rabi Mishra |
Bug Description
*Use case*
1) Create a stack with resource group which contains two ("0", "1") OS::Nova::Server.
Each server has different image, which comes from stack parameters, and indexed by %index% at resource group.
2) Try to update stack with removal policy ["0"], so basically scale-in the first Server.
Leave out Image parameter for first server due to it will be removed, so we do not need image for a removed server.
It fails with input validation due to image of removed server is not found:
ERROR: Failed to validate: Failed to validate: resources[0]: Neither image nor bootable volume is specified for instance server
+ Even in later updates you need to specify image for the none-existing server.
*Reproduce with stack-create*
main_template.yaml:
---
heat_template_
parameters:
images:
type: json
default: { "1": "cirros" }
resources:
simple_
type: OS::Heat:
properties:
count: 1
removal_
resource_def:
type: simple.
properties:
images: { get_param: images }
rg_index: '%index%'
simple.
---
heat_template_
parameters:
images:
type: json
rg_index:
type: string
description: the current index of the resource group ( ex. "0", "2")
default: invalid
resources:
server:
type: OS::Nova::Server
properties:
name: {get_param: rg_index}
flavor: m1.small
image: { get_param: [ images, {get_param: rg_index} ] }
networks:
- network: preservedNetwork
*Bug in the heat code*
https:/
Here always the group "0" is validated and removal policy is not applied at all.
summary: |
- OS::Heat::ResourceGroup validation failed if group "0" is on blacklist + OS::Heat::ResourceGroup validation failed if group "0" is removed |
Changed in heat: | |
milestone: | none → pike-2 |
Yeah, we should use the first non blacklisted item.