Ask Your Question
0

HEAT Formatting list into string for load balancer pool member

asked 2019-02-08 16:14:23 -0500

btorretta gravatar image

updated 2019-02-12 00:30:31 -0500

zaneb gravatar image

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]}
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2019-02-12 00:33:49 -0500

zaneb gravatar image

You want to create a template that contains a single Server and a PoolMember. Then use the name of that template (instead of OS::Nova::Server) as the 'type' of the asg's 'resource' property. That way you'll have a scaling group where the scaled unit is a server that is a member of the load balancer pool.

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: 2019-02-08 16:14:23 -0500

Seen: 70 times

Last updated: Feb 12