stack-create fails when OS::Sahara::ClusterTemplate is used

Bug #1472998 reported by Tatiana Kholkina
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Undecided
Tatiana Kholkina

Bug Description

I create a stack with OS::Sahara::ClusterTemplate resource and it fails with the following error:

2015-07-08 05:54:15.011 INFO heat.engine.resource [-] CREATE: SaharaClusterTemplate "cluster_template" Stack "test1" [86545cda-0e03-46f1-9b5a-0fda95ca29d6]
2015-07-08 05:54:15.011 TRACE heat.engine.resource Traceback (most recent call last):
2015-07-08 05:54:15.011 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/resource.py", line 552, in _action_recorder
2015-07-08 05:54:15.011 TRACE heat.engine.resource
2015-07-08 05:54:15.011 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/resource.py", line 623, in _do_action
2015-07-08 05:54:15.011 TRACE heat.engine.resource
2015-07-08 05:54:15.011 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/scheduler.py", line 315, in wrapper
2015-07-08 05:54:15.011 TRACE heat.engine.resource try:
2015-07-08 05:54:15.011 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/resource.py", line 594, in action_handler_task
2015-07-08 05:54:15.011 TRACE heat.engine.resource
2015-07-08 05:54:15.011 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/resources/openstack/sahara/sahara_templates.py", line 381, in handle_c
reate
2015-07-08 05:54:15.011 TRACE heat.engine.resource node_groups=node_groups
2015-07-08 05:54:15.011 TRACE heat.engine.resource File "/usr/local/lib/python2.7/dist-packages/saharaclient/api/cluster_templates.py", line 51, in create
2015-07-08 05:54:15.011 TRACE heat.engine.resource return self._create('/cluster-templates', data, 'cluster_template')
2015-07-08 05:54:15.011 TRACE heat.engine.resource File "/usr/local/lib/python2.7/dist-packages/saharaclient/api/base.py", line 96, in _create
2015-07-08 05:54:15.011 TRACE heat.engine.resource self._raise_api_exception(resp)
2015-07-08 05:54:15.011 TRACE heat.engine.resource File "/usr/local/lib/python2.7/dist-packages/saharaclient/api/base.py", line 162, in _raise_api_exceptio
n
2015-07-08 05:54:15.011 TRACE heat.engine.resource error_message=error_data.get("error_message"))
2015-07-08 05:54:15.011 TRACE heat.engine.resource APIException: u'test1-cluster_template-7zegmrmmvj3j' is not a 'valid_name_hostname'

Minimal template to reproduce:

heat_template_version: 2014-10-16
resources:
  cluster_template:
    type: OS::Sahara::ClusterTemplate
    properties:
      plugin_name: vanilla
      hadoop_version: 1.2.1

Seems we cannot use underscores or other characters which don't match this regex[1] in resource names. It should be checked before creation.

[1] https://github.com/openstack/heat/blob/master/heat/engine/resources/openstack/sahara/sahara_templates.py#L29-31

Changed in heat:
assignee: nobody → Tetiana Lashchova (tlashchova)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (master)

Fix proposed to branch: master
Review: https://review.openstack.org/200159

Changed in heat:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

Reviewed: https://review.openstack.org/200159
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=763ad42e4ad16e4bfe38fad6720d1f97691c1174
Submitter: Jenkins
Branch: master

commit 763ad42e4ad16e4bfe38fad6720d1f97691c1174
Author: Tetiana Lashchova <email address hidden>
Date: Thu Jul 9 18:47:17 2015 +0300

    Generate correct names for sahara templates

    Change-Id: I96a7ce8b673c07ca2a40f88e2c1a9f952113919e
    Closes-Bug: #1472998

Changed in heat:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in heat:
milestone: none → liberty-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in heat:
milestone: liberty-2 → 5.0.0
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to heat (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/506749

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to heat (master)

Reviewed: https://review.openstack.org/506749
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=2f941e9e650a5cabe25d116f0907085d5196a7a0
Submitter: Zuul
Branch: master

commit 2f941e9e650a5cabe25d116f0907085d5196a7a0
Author: Jeremy Freudberg <email address hidden>
Date: Fri Sep 22 18:50:38 2017 +0000

    Generate correct name for Sahara cluster

    Sahara has certain requirements for cluster names. The autogenerated
    name may previously have ended up invalid, if a resource name contained
    an incompatible character (for example underscore).

    Also adding some missed constraints to Sahara cluster name, borrowed
    from Sahara template name constraints.

    Change-Id: If1358a104beb831d04d4012e64cd1afedce5a7dd
    Closes-Bug: #1718989
    Related-Bug: #1472998

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.