Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

HEAT Formatting list into string for load balancer pool member

FYI I am a user of a stack on the Ocata release. Hello, I have been experimenting and not been able to actually find a working solution. I am defining n node members to start my auto scaling group (I actually don't care about the asg, it's just a convenient way to spin up many nodes in a single block once just by using a parameter) and I would like to place n members into lbaas pool memberbership. The closest I can get is a retrieval of the IP addresses of all nodes as a list, however the address field in pool member wants only one string of an ip, not a list. Worst, that field won't allow any manipulation using a split. I've tried using repeat here too and it didn't work, it would just add only the last address. Code:

heat_template_version: 2017-02-24 parameters: .... resources: asg: type: OS::Heat::AutoScalingGroup properties: min_size: 1 desired_capacity: {get_param: servercount} max_size: {get_param: servercount} resource: type: OS::Nova::Server properties: name: perf flavor: { get_param: instance_type } image: { get_param: image_id } networks: - network: <defined> tags: [{get_param: environment}] user_data: str_replace: template: {get_file: my_instance_user_data.sh} params: ...

lb: type: OS::Neutron::LBaaS::LoadBalancer properties: name: {get_param: environment} provider: vmwareedge vip_subnet: DMZLow-LS-Net lblistener: type: OS::Neutron::LBaaS::Listener properties: loadbalancer: {get_resource: lb} name: {get_param: environment} protocol: HTTPS protocol_port: 443 lbpool: type: OS::Neutron::LBaaS::Pool properties: lb_algorithm: ROUND_ROBIN listener: {get_resource: lblistener} name: {get_param: environment} protocol: HTTPS

lbpoolmember: type: OS::Neutron::LBaaS::PoolMember properties: address: <how do="" i="" populate="" n="" number="" of="" servers="" without="" statically="" copying="" this="" block?="" even="" then="" how="" do="" i="" get="" just="" one="" server="" ip="" here="" if="" it="" won't="" let="" me="" split="" from="" a="" list?=""> pool: {get_resource: lbpool} protocol_port: 8443 subnet: DMZLow-LS-Net

lbhealthcheck: type: OS::Neutron::LBaaS::HealthMonitor properties: delay: 5 max_retries: 4 pool: {get_resource: lbpool} timeout: 10 type: TCP url_path: /status outputs: server_ips: description: > This is a list of first ip addresses of the servers in the group for a specified network. value: {get_attr: [asg, outputs_list, first_address]}

HEAT Formatting list into string for load balancer pool member

FYI I am a user of a stack on the Ocata release. Hello, I have been experimenting and not been able to actually find a working solution. I am defining n node members to start my auto scaling group (I actually don't care about the asg, it's just a convenient way to spin up many nodes in a single block once just by using a parameter) and I would like to place n members into lbaas pool memberbership. The closest I can get is a retrieval of the IP addresses of all nodes as a list, however the address field in pool member wants only one string of an ip, not a list. Worst, that field won't allow any manipulation using a split. I've tried using repeat here too and it didn't work, it would just add only the last address. Code:

heat_template_version: 2017-02-24
parameters:
 ....
resources:
  asg:
    type: OS::Heat::AutoScalingGroup
    properties:
      min_size: 1
      desired_capacity: {get_param: servercount}
      max_size: {get_param: servercount}
      resource:
        type: OS::Nova::Server
        properties:
          name: perf
          flavor: { get_param: instance_type }
          image: { get_param: image_id }
          networks:
            - network: <defined>
          tags: [{get_param: environment}]
          user_data:
            str_replace:
              template: {get_file: my_instance_user_data.sh}
              params:
   ...

... lb: type: OS::Neutron::LBaaS::LoadBalancer properties: name: {get_param: environment} provider: vmwareedge vip_subnet: DMZLow-LS-Net lblistener: type: OS::Neutron::LBaaS::Listener properties: loadbalancer: {get_resource: lb} name: {get_param: environment} protocol: HTTPS protocol_port: 443 lbpool: type: OS::Neutron::LBaaS::Pool properties: lb_algorithm: ROUND_ROBIN listener: {get_resource: lblistener} name: {get_param: environment} protocol: HTTPS

HTTPS lbpoolmember: type: OS::Neutron::LBaaS::PoolMember properties: address: <how do="" i="" populate="" n="" number="" of="" servers="" without="" statically="" copying="" this="" block?="" even="" then="" how="" do="" i="" get="" just="" one="" server="" ip="" here="" if="" it="" won't="" let="" me="" split="" from="" a="" list?=""> do I populate n number of servers without statically copying this block? even then how do I get just one server ip here if it won't let me split from a list?> pool: {get_resource: lbpool} protocol_port: 8443 subnet: DMZLow-LS-Net

DMZLow-LS-Net lbhealthcheck: type: OS::Neutron::LBaaS::HealthMonitor properties: delay: 5 max_retries: 4 pool: {get_resource: lbpool} timeout: 10 type: TCP url_path: /status outputs: server_ips: description: > This is a list of first ip addresses of the servers in the group for a specified network. value: {get_attr: [asg, outputs_list, first_address]}

first_address]}