Bug 1568554

Summary: When using relative paths in heat templates, if the folder is moved to a new one and stack updated, it fails finding the file in the previous path
Product: Red Hat OpenStack Reporter: David Hill <dhill>
Component: openstack-heatAssignee: Rabi Mishra <ramishra>
Status: CLOSED CURRENTRELEASE QA Contact: Ronnie Rasouli <rrasouli>
Severity: low Docs Contact:
Priority: low    
Version: 10.0 (Newton)CC: aschultz, ipetrova, mburns, ramishra, sbaker, shardy, srevivo, therve
Target Milestone: ---Keywords: Triaged, ZStream
Target Release: 10.0 (Newton)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-12-04 03:37:21 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Templates used to reproduce this issue. none

Description David Hill 2018-04-17 18:35:57 UTC
Description of problem:
When using relative paths in heat templates, if the folder is moved to a new one and stack updated, it fails finding the file in the previous path

Example:

1) $ cd /root/rh_autoscale_example
2) $ openstack stack create -t template.yaml -e environment.yaml example
3) Wait until success
4) $ mv /root/rh_autoscale_example /root/rh_autoscale_example_moved
5) $ openstack stack update -t template.yaml -e environment.yaml example
6) Update fails

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. 
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 David Hill 2018-04-17 18:36:41 UTC
It might be affecting only the scale up groups:

| stack_status_reason   | Resource UPDATE failed: resources.scaleup_group: Could                                                                                                                        |
|                       | not fetch remote template                                                                                                                                                     |
|                       | "file:///home/stack/templates/cirros.yaml": Invalid URL                                                                                                                       |
|                       | scheme file                                                                                                                                                                   |

Comment 2 David Hill 2018-04-17 18:37:58 UTC
Created attachment 1423215 [details]
Templates used to reproduce this issue.

Comment 3 David Hill 2018-04-17 18:38:56 UTC
This appears to be a problem when using ansible which create a temporary folder when deploying openshift with ansible-shift.

Comment 4 David Hill 2018-04-17 18:43:04 UTC
In the following example:


resources:
  scaleup_group:
    type: OS::Heat::AutoScalingGroup
    properties:
      cooldown: 300
      desired_capacity: 2
      max_size: 3
      min_size: 2
      resource:
        type: cirros.yaml
        properties:
          metadata: {"metering.server_group": {get_param: "OS::stack_id"}}


will be imported as "file:///home/stack/templates/cirros.yaml" in the internal heat representation of the stack.   If we try to update that heat stack from another host and another path , let's say /home/another_user/templates/cirros.yaml, updating the stack will fail with:

| stack_status_reason   | Resource UPDATE failed: resources.scaleup_group: Could                                                                                                                        |
|                       | not fetch remote template                                                                                                                                                     |
|                       | "file:///home/stack/templates/cirros.yaml": Invalid URL                                                                                                                       |
|                       | scheme file      

It looks like the path is not updated even though the path changed.

Comment 16 Alex Schultz 2018-12-04 03:37:21 UTC
This has been addressed in the current release of Heat. The workaround should be used for older versions if possible.