Bug 1396287

Summary: Inconsistency between the cli and the heat orchestration/dashboard based application start creation.
Product: Red Hat OpenStack Reporter: Ruchika K <rkharwar>
Component: python-django-horizonAssignee: Beth White <beth.white>
Status: CLOSED ERRATA QA Contact: Radomir Dopieralski <rdopiera>
Severity: medium Docs Contact:
Priority: medium    
Version: 10.0 (Newton)CC: aortega, aschultz, athomas, augol, beth.white, jruzicka, mburns, mrunge, rdopiera, rhel-osp-director-maint, sbaker, shardy, srevivo, therve, tvignaud, zbitter
Target Milestone: betaKeywords: Triaged
Target Release: 12.0 (Pike)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-django-horizon-12.0.0-0.20170821142111.b1b6b3f.el7ost Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-12-13 20:52:28 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
Failure message showing inconsistency
none
workaround image with the env used correctly none

Description Ruchika K 2016-11-17 21:36:16 UTC
Created attachment 1221651 [details]
Failure message showing inconsistency

Description of problem:
using the openstack cli : 
ack@undercloud ~]$ openstack stack create wordpress -f yaml -t http://10.3.9.250/templates/heat_3a.yaml 
id: d9f06d32-e459-489e-844a-7de00fb9bfd9
stack_name: wordpress
description: Template that installs a wordpress server and supporting MySQL database
  running on separate servers
creation_time: '2016-11-17T21:17:57Z'
updated_time: null
stack_status: CREATE_IN_PROGRESS
stack_status_reason: Stack CREATE started
[stack@undercloud ~]$ heat stack-list
WARNING (shell) "heat stack-list" is deprecated, please use "openstack stack list" instead
+--------------------------------------+------------+--------------------+----------------------+--------------+
| id                                   | stack_name | stack_status       | creation_time        | updated_time |
+--------------------------------------+------------+--------------------+----------------------+--------------+
| d9f06d32-e459-489e-844a-7de00fb9bfd9 | wordpress  | CREATE_IN_PROGRESS | 2016-11-17T21:17:57Z | None         |
+--------------------------------------+------------+--------------------+----------------------+--------------+
[stack@undercloud ~]$ heat stack-list
WARNING (shell) "heat stack-list" is deprecated, please use "openstack stack list" instead
+--------------------------------------+------------+--------------------+----------------------+--------------+
| id                                   | stack_name | stack_status       | creation_time        | updated_time |
+--------------------------------------+------------+--------------------+----------------------+--------------+
| d9f06d32-e459-489e-844a-7de00fb9bfd9 | wordpress  | CREATE_IN_PROGRESS | 2016-11-17T21:17:57Z | None         |
+--------------------------------------+------------+--------------------+----------------------+--------------+
[stack@undercloud ~]$ heat stack-list
WARNING (shell) "heat stack-list" is deprecated, please use "openstack stack list" instead
+--------------------------------------+------------+--------------------+----------------------+--------------+
| id                                   | stack_name | stack_status       | creation_time        | updated_time |
+--------------------------------------+------------+--------------------+----------------------+--------------+
| d9f06d32-e459-489e-844a-7de00fb9bfd9 | wordpress  | CREATE_IN_PROGRESS | 2016-11-17T21:17:57Z | None         |
+--------------------------------------+------------+--------------------+----------------------+--------------+
[stack@undercloud ~]$ heat stack-list
WARNING (shell) "heat stack-list" is deprecated, please use "openstack stack list" instead
+--------------------------------------+------------+--------------------+----------------------+--------------+
| id                                   | stack_name | stack_status       | creation_time        | updated_time |
+--------------------------------------+------------+--------------------+----------------------+--------------+
| d9f06d32-e459-489e-844a-7de00fb9bfd9 | wordpress  | CREATE_IN_PROGRESS | 2016-11-17T21:17:57Z | None         |
+--------------------------------------+------------+--------------------+----------------------+--------------+
[stack@undercloud ~]$ openstack stack create wordpress -f yaml -t http://10.3.9.250/templates/heat_3a.yaml ^C
[stack@undercloud ~]$ heat stack-list
WARNING (shell) "heat stack-list" is deprecated, please use "openstack stack list" instead
+--------------------------------------+------------+-----------------+----------------------+--------------+
| id                                   | stack_name | stack_status    | creation_time        | updated_time |
+--------------------------------------+------------+-----------------+----------------------+--------------+
| d9f06d32-e459-489e-844a-7de00fb9bfd9 | wordpress  | CREATE_COMPLETE | 2016-11-17T21:17:57Z | None         |
+--------------------------------------+------------+-----------------+----------------------+--------------+

this launches successfully for the exact same file:
fails.

Interesting to note the difference in the 2 though.. I expected them to behave identically.
Images attached for how horizon fails !! 

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

 
How reproducible:
100%

Steps to Reproduce:
1. http://10.3.9.250/templates/heat_3a.yaml is the template used
2. this points to 
3.

Actual results:


Expected results:
Concostency between cli and horizon dashboard

Additional info:

Comment 1 Zane Bitter 2016-11-17 22:00:56 UTC
This is really a Horizon bug but I can't find a BZ component for that at the moment, so assigning to python-heatclient for now.

I think the Right Thing here would be to treat relative paths as relative to the template. I'm not sure why it isn't doing that.

Comment 2 Ruchika K 2016-11-17 22:20:18 UTC
There is a problem with the way I passed the environment in the original bug post.
I misunderstood this to be the overcloudrc file but its not !!


For now a good workaround is to do this :
use resource_registry.

Example of a commandline and files using resource regstry is the following

CLI:

openstack stack create wordpress -f yaml -t http://10.3.9.250/templates/heat_app.yaml  -e http://10.3.9.250/templates/env.yaml

the contents of the heat_app template is this:

heat_template_version: 2013-05-23
 
description: Template that installs a wordpress server and supporting MySQL database running on separate servers

parameters:
  image:
    type: string
    label: Image name or ID
    description: Image to be used for server. Please use an Ubuntu based image.
    default: trusty-server-cloudimg-amd64
  flavor:
    type: string
    label: Flavor
    description: Type of instance (flavor) to be used on the compute instance.
    default: m1.small
  key:
    type: string
    label: Key name
    description: Name of key-pair to be installed on the compute instance.
    default: stack 
  private_network:
    type: string
    label: Private network name or ID
    description: Network to attach server to.
    default: test 
 
resources:
  mysql:
 #   type: lib/mysql.yaml
    type: Lib::MSG::MySQL
    properties:
      image: { get_param: image }
      flavor: { get_param: flavor }
      key: { get_param: key }
      private_network: { get_param: private_network }
      database_name: wordpress
      database_user: wordpress_user
 
  wordpress:
#    type: lib/wordpress.yaml
    type: Lib::MSG::Wordpress
    properties:
      image: { get_param: image }
      flavor: { get_param: flavor }
      key: { get_param: key }
      private_network: { get_param: private_network }
      mysql_server: { get_attr: [mysql, ip] }
      database_name: wordpress
      database_user: wordpress_user
      database_password: { get_attr: [mysql, database_password] }


and the env file is this:

resource_registry:
  Lib::MSG::MySQL: http://10.3.9.250/templates/lib/mysql.yaml
  Lib::MSG::Wordpress: http://10.3.9.250/templates/lib/wordpress.yaml

With this method the same templates can be used for CLI or via the dashboard;

Image attached with the dashboard:
<workaround.jpg>

Comment 3 Ruchika K 2016-11-17 22:20:40 UTC
There is a problem with the way I passed the environment in the original bug post.
I misunderstood this to be the overcloudrc file but its not !!


For now a good workaround is to do this :
use resource_registry.

Example of a commandline and files using resource regstry is the following

CLI:

openstack stack create wordpress -f yaml -t http://10.3.9.250/templates/heat_app.yaml  -e http://10.3.9.250/templates/env.yaml

the contents of the heat_app template is this:

heat_template_version: 2013-05-23
 
description: Template that installs a wordpress server and supporting MySQL database running on separate servers

parameters:
  image:
    type: string
    label: Image name or ID
    description: Image to be used for server. Please use an Ubuntu based image.
    default: trusty-server-cloudimg-amd64
  flavor:
    type: string
    label: Flavor
    description: Type of instance (flavor) to be used on the compute instance.
    default: m1.small
  key:
    type: string
    label: Key name
    description: Name of key-pair to be installed on the compute instance.
    default: stack 
  private_network:
    type: string
    label: Private network name or ID
    description: Network to attach server to.
    default: test 
 
resources:
  mysql:
 #   type: lib/mysql.yaml
    type: Lib::MSG::MySQL
    properties:
      image: { get_param: image }
      flavor: { get_param: flavor }
      key: { get_param: key }
      private_network: { get_param: private_network }
      database_name: wordpress
      database_user: wordpress_user
 
  wordpress:
#    type: lib/wordpress.yaml
    type: Lib::MSG::Wordpress
    properties:
      image: { get_param: image }
      flavor: { get_param: flavor }
      key: { get_param: key }
      private_network: { get_param: private_network }
      mysql_server: { get_attr: [mysql, ip] }
      database_name: wordpress
      database_user: wordpress_user
      database_password: { get_attr: [mysql, database_password] }


and the env file is this:

resource_registry:
  Lib::MSG::MySQL: http://10.3.9.250/templates/lib/mysql.yaml
  Lib::MSG::Wordpress: http://10.3.9.250/templates/lib/wordpress.yaml

With this method the same templates can be used for CLI or via the dashboard;

Image attached with the dashboard:
<workaround.jpg>

Comment 4 Ruchika K 2016-11-17 22:40:24 UTC
The original issue still stands about inconsistency between the CLI and the dashboard.

but this is just a workaround half the way since the env.yaml doesn't have the option to come from a "url" but only direct or file.

So if this is a BUG or an RFE

* Relative paths of the files should be handled consistently
* the environment file should have an option of being a url as well.

Comment 5 Ruchika K 2016-11-17 22:43:44 UTC
Created attachment 1221657 [details]
workaround image with the env used correctly

Comment 6 Thomas Hervé 2016-12-15 16:36:55 UTC
I opened the attached bug against Horizon.

Comment 7 Zane Bitter 2017-01-06 19:37:12 UTC
I found an older bug for this issue: https://bugs.launchpad.net/horizon/+bug/1467781

Comment 11 Radomir Dopieralski 2017-11-06 16:56:34 UTC
I verified that get_file is handled correctly as per lp#1512564, but I can't verify this works with the original user templates, because the user didn't attach them, and the addresses mentioned in the bug report don't work.

Comment 14 errata-xmlrpc 2017-12-13 20:52:28 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2017:3462