Using intrinsic function get_attr in hot template
Hi,
I am trying to create a heat stack with three VMs. I am using get_attr to get some attribute. Below is the excerpt of my template
=======
heat_template_
description: >
Heat template
parameters:
key_name:
type: string
description : Name of a KeyPair to enable SSH access to the instance
default: CtrlKey
instance_type:
type: string
description: Instance type for NECC instance
default: m1.small
constraints:
- allowed_values: [m1.small, m1.medium, m1.large]
image_id:
type: string
description: ID of the image to use for the WordPress server
default: test
constraints:
- allowed_values: [ test, test1]
Image ID must be either test or test1
network_id:
type: string
description: ID of the network
default: 0160deac-
subnet_id:
type: string
description: ID of the subnet
default: d0cd8dc3-
file_name:
type: string
description : Name of a test file
default: /root/install_file
resources:
serv_port:
type: OS::Neutron::Port
properties:
fixed_ips:
- ip_address: 172.31.31.100
network_id: {get_param: network_id}
webserv:
type: OS::Nova::Server
properties:
image: { get_param: image_id }
flavor: { get_param: instance_type }
key_name: { get_param: key_name }
networks:
- port: {get_resource: serv_port}
user_data:
template: |
echo "Installing" > file
echo $IP >> file
params:
file: { get_param: file_name }
$IP: { get_attr: [serv_port, fixed_ips, 0, ip_address] }
=======
When I am creating the stack I am getting a long traceback ...
-------
Traceback (most recent call last):
File "/usr/lib/
**args)
File "/usr/lib/
result = getattr(proxyobj, method)(ctxt, **kwargs)
File "/usr/lib/
return func(self, ctx, *args, **kwargs)
File "/usr/lib/
self.
File "/usr/lib/
if not stack.requires_
File "/usr/lib/
return any(res.
File "/usr/lib/
return iter(self.
File "/usr/lib/
self.
File "/usr/lib/
resource.
File "/usr/lib/
self.
File "/usr/lib/
self.
File "/usr/lib/
self.
File "/usr/lib/
self.
File "/usr/lib/
self.
File "/usr/lib/
self.
File "/usr/lib/
value, att = value
ValueError: too many values to unpack
-------
If I remove the get_attr part from the template my stack is getting created. Can anyone help me regarding this?
Question information
- Language:
- English Edit question
- Status:
- Answered
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask Nilanjan Roy for more information if necessary.