Ask Your Question
0

ERROR: The Parameter (ImageID) was not defined in template.

asked 2015-09-11 04:46:26 -0500

ravindert gravatar image

updated 2015-09-11 04:48:28 -0500

Hi ,

I have created the template for the stack and environment file. It is getting failed with below error. So can you please look into the files, templates and let me know why the stack creation is failing??

[root@controller log(keystone)]# echo $Int_Net_ID
8a5b893e-7ea1-45cb-ae5f-aa0c8d7c33da
[root@controller log(keystone)]#

[root@controller log(keystone)]# glance image-list
+--------------------------------------+----------+-------------+------------------+-----------+--------+
| ID                                   | Name     | Disk Format | Container Format | Size      | Status |
+--------------------------------------+----------+-------------+------------------+-----------+--------+
| e6edb708-cdb9-4866-a2d0-6cf6bda3b530 | cirros   | qcow2       | bare             | 13167616  | active |
| fc761829-869e-42ab-bae8-82b56289d990 | Fedora22 | qcow2       | bare             | 228599296 | active |
+--------------------------------------+----------+-------------+------------------+-----------+--------+
[root@controller log(keystone)]#

[root@controller log(keystone)]# heat stack-create -f simple.yaml -P "ImageID=cirros;NetID=$Int_Net_ID" -e environment.yaml  stack1
ERROR: The Parameter (ImageID) was not defined in template.


[root@controller log(keystone)]# cat cirros.yaml
heat_template_version: 2014-10-16

description: Heat Sample Template

parameters:
  ImageID:
    type: string
    description: Image used to boot a server
  NetID:
    type: string
    description: Network ID for the server

resources:
  server1:
    type: OS::Nova::Server
    properties:
      name: "Heat_Deployed_Server"
      image: { get_param: ImageID }
      flavor: "m1.small"
      networks:
      - network: { get_param: NetID }

outputs:
  server1_private_ip:
    description: IP address of the server in the private network
    value: { get_attr: [ server1, first_address ] }

[root@controller log(keystone)]#


[root@controller log(keystone)]# cat simple.yaml
heat_template_version: 2014-10-16
description: A simple auto scaling group.
resources:
  group:
    type: OS::Heat::AutoScalingGroup
    properties:
      cooldown: 60
      desired_capacity: 2
      max_size: 5
      min_size: 1
      resource:
        type: OS::Nova::Server::Cirros

  scaleup_policy:
    type: OS::Heat::ScalingPolicy
    properties:
      adjustment_type: change_in_capacity
      auto_scaling_group_id: { get_resource: group }
      cooldown: 60
      scaling_adjustment: 1

  cpu_alarm_high:
    type: OS::Ceilometer::Alarm
    properties:
      meter_name: cpu_util
      statistic: avg
      period: 60
      evaluation_periods: 1
      threshold: 50
      alarm_actions:
        - {get_attr: [scaleup_policy, alarm_url]}
      comparison_operator: gt
[root@controller log(keystone)]#


[root@controller log(keystone)]# cat environment.yaml
resource_registry:
    "OS::Nova::Server::Cirros": "cirros.yaml"
[root@controller log(keystone)]#

Thanks a lott!!!!

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2015-09-11 05:57:32 -0500

Hi

On looking at your stack create command

[root@controller log(keystone)]# heat stack-create -f simple.yaml -P "ImageID=cirros;NetID=$Int_Net_ID" -e environment.yaml  stack1

Stack create request is given against template file simple.yaml whereas it has doesn't has the parameter ImageID (or) NetID. Only the cirros.yaml template has the parameter - ImageID & NetID.

So try to execute the stack against template cirros.yaml as below

[root@controller log(keystone)]# heat stack-create -f cirros.yaml -P "ImageID=cirros;NetID=$Int_Net_ID" stack1

Note: If you need to debug more on the API request sent to HEAT, try to execute heat CLI command with --debug option.

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

Stats

Asked: 2015-09-11 04:46:26 -0500

Seen: 1,466 times

Last updated: Sep 11 '15