Ask Your Question
1

Fn::FindInMap gives error in Heat HOT Template

asked 2015-02-03 23:00:55 -0500

In my HOT template heat_template_version: 2014-10-16 I have a autoscaling group as

auto_scale_server:
    type: OS::Heat::AutoScalingGroup
    properties:
      min_size: 0
      max_size: { "Fn::FindInMap" : [ "mirror_map", { "Ref" : "Mirror" } ]}
      resource:       
          type: OS::Nova::Server
          properties:
            name: Scaled_Blade
            image: UbuntuDemo
            flavor: g1.disk
            key_name: htor
            networks: [{network: internal}]

where value of max_size depends upon Property Mirror

In Parameters section

parameters:

      Mirror:
        type: string
        label: Mirroring Port
        description: Select the Port on which you want to Mirror the traffic
        constraints:
         - allowed_values:
           - port1
           - fm00

     Mappings: 
        mirror_map: 
          fm00: 0
          port1: 1

When I start this template, I got error

ERROR: Invalid key 'mirror_map' for parameter (Mappings)
edit retag flag offensive close merge delete

Comments

1

I stumbled upon http://docs.openstack.org/hot-referen... which suggests that only 'Fn::Select' is supported in HOT '2014-10-16' (but should still not fail like you mention). Please change your HOT template version to '2013-05-23' and give it a try.

unmesh-gurjar gravatar imageunmesh-gurjar ( 2015-02-06 12:22:24 -0500 )edit

I checked that but no luck

Khayam gravatar imageKhayam ( 2015-02-10 22:25:50 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2015-02-12 20:14:31 -0500

asalkeld gravatar image

HOT does not support the top level "Mappings" section.

To use Fn::Select with your data:

I'd remove the "Mappings" and just have:

mirror_map:
  fm00: 0
  port1: 1
 {Fn::Select: [{get_param: Mirror}, {get_param: mirror_map}]
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2015-02-03 23:00:55 -0500

Seen: 545 times

Last updated: Feb 12 '15