retrieve ip address of servers Heat Autoscaling
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Heat |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Hi,
I am testing autoscaling with heat and ceilometer.
so i want to use the IP address and the floating IP address of each server to execute a script in the user_data
i tried this : outputs_list:
value: {'get_attr': [dbserver_group, outputs_list , networks, binetou_
in the outputs section but that does nto work. H ow can i do please?
here is my template.
heat_template_
description: Basic (1 server)
resources:
dbserver_group:
type: OS::Heat:
properties:
min_size: 1
max_size: 3
resource:
type: http://
image: cassandra2
flavor: m1.medium
pool_id: {get_resource: pool}
sh /home/osadmin/
dbserver_
type: OS::Heat:
properties:
adjustmen
auto_
cooldown: 60
scaling_
dbserver_
type: OS::Heat:
properties:
adjustmen
auto_
cooldown: 60
scaling_
cpu_alarm_high:
type: OS::Ceilometer:
properties:
description: Scale-up if the average CPU > 50% for 1 minute
meter_name: cpu_util
statistic: avg
period: 60
evaluatio
threshold: 25
alarm_
- {get_attr: [dbserver_
matching_
compariso
cpu_alarm_low:
type: OS::Ceilometer:
properties:
description: Scale-down if the average CPU < 15% for 10 minutes
meter_name: cpu_util
statistic: avg
period: 600
evaluatio
threshold: 15
alarm_
- {get_attr: [dbserver_
matching_
compariso
lb_vip_port:
type: OS::Neutron::Port
properties:
network_id: "c5bcedd1-
fixed_ips:
- subnet_id: "bfb0153d-
security_
lb_vip_
type: OS::Neutron:
properties:
floating_
port_id: { get_resource: lb_vip_port }
lb_pool_vip:
type: OS::Neutron:
properties:
floatingi
port_id: { 'Fn::Select': ['port_id', {get_attr: [pool, vip]}]}
monitor:
type: OS::Neutron:
properties:
type: TCP
delay: 3
max_retries: 5
timeout: 5
pool:
type: OS::Neutron::Pool
properties:
protocol: HTTP
monitors: [{get_resource: monitor}]
subnet_id: "bfb0153d-
lb_method: ROUND_ROBIN
vip:
member:
type: OS::Neutron:
properties:
pool_id: {get_resource: pool}
address: {get_attr: [lb_vip_port, fixed_ips, 0, ip_address]}
protocol_
loadbalancer:
type: OS::Neutron:
properties:
protocol_
pool_id: {get_resource: pool}
outputs:
scale_up_url:
description: >
This URL is the webhook to scale up the autoscaling group. You
can invoke the scale-up operation by doing an HTTP POST to this
URL; no body nor extra headers are needed.
value: {get_attr: [ dbserver_
scale_dn_url:
description: >
This URL is the webhook to scale down the autoscaling group.
You can invoke the scale-down operation by doing an HTTP POST to
this URL; no body nor extra headers are needed.
value: {get_attr: [ dbserver_
pool_ip_address:
value: {get_attr: [pool, vip, address]}
description: The IP address of the load balancing pool
WebsiteURL:
description: URL for dbserver
value:
str_replace:
template: http://
params:
host: { get_attr: [lb_vip_
Where in your template are you inserting the output_list expression?
Also note that if you were hoping outputs_list will update its values when the autoscaling group grows or shrinks, that is currently broken. I have filed a bug on that: https:/ /bugs.launchpad .net/heat/ +bug/1437524 and am currently working on a solution.