Ask Your Question
0

Heat ResourceGroup Server IP Address Outputs

asked 2016-02-05 02:24:56 -0500

VMTrooper gravatar image

Hello Folks,

I am attempting to create a group of servers and collect a list of their respective IP addresses as an output.

Steve Baker previously shared a great sample of this very thing, but I am having an issue with my ResourceGroup outputs being empty.

I pared down Steve's code to just the bits I need at this paste link: http://paste.openstack.org/show/486050/

When I try to use the heat output-show command, I get the following response:

$ heat output-show resourcegroup-test server_ips

Error: The Referenced Attribute (0 outputs) is incorrect.

Has anyone else seen similar messages when trying to access ResourceGroup output? I'm on Kilo (2015.1.1)

Thanks!

Sample Code included below in case the URL is not allowed:

# software_config_server.yaml
heat_template_version: 2014-10-16

resources:
  server:
    type: OS::Nova::Server
    properties:
      image: ubuntu-14.04-server-amd64
      flavor: m1.small
      key_name: demo-keypair
      user_data_format: SOFTWARE_CONFIG
      networks:
        - network: demo-network
outputs:
  server_id:
    value: {get_resource: server}
  server_ip:
    value: {get_attr: [server, networks, demo-network, 0]}

# software_config_servers.yaml
heat_template_version: 2014-10-16

parameters:
  server_count:
    type: number
    default: 2

resources:
  servers:
    type: OS::Heat::ResourceGroup
    properties:
      count: {get_param: server_count}
      resource_def:
        type: software_config_server.yaml

outputs:
  servers:
    value: {get_attr: [servers, outputs, server_id]}
  server_ips:
    value: {get_attr: [servers, outputs, server_ip]}
edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
3

answered 2016-02-06 19:54:42 -0500

hcc gravatar image

updated 2016-02-06 19:57:39 -0500

To answer your specific question, yes, I get that error all the time (-:

I was successful with the following:

software_config_server.yaml

outputs:
  server_id:
    value: {get_resource: server}
  server_ip:
    value: {get_attr: [server, networks, private, 0]}

software_config_servers.yaml

outputs:
  server_ids:
    value: {get_attr: [servers, server_id]}
  server_ips:
    value: {get_attr: [servers, server_ip]}
edit flag offensive delete link more

Comments

Thank you, hcc!

A new "problem that I I have noticed is that my user needs to be an admin if the following line is specified in the software_config_server.yaml file:

user_data_format: SOFTWARE_CONFIG

Is there any way to get around this requirement short of modifying policy.json?

VMTrooper gravatar imageVMTrooper ( 2016-02-09 13:40:56 -0500 )edit
0

answered 2017-07-25 02:21:13 -0500

Dilshath gravatar image

where to get output syntax

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: 2016-02-05 02:22:23 -0500

Seen: 3,426 times

Last updated: Jul 25 '17