Ask Your Question
1

Is a load balancer required for autoscaling to work? [closed]

asked 2014-09-18 13:23:09 -0500

Heather gravatar image

updated 2014-09-18 16:32:53 -0500

SamYaple gravatar image

I do not have a LB setup and I'm trying to test autoscaling. Is a LB Required? I can see the alarms firing when I stress the box but no new instances are started. heat-cfn is running. I don't see anything but alarms in the logs

+--------------------------------------+--------------------------------------+-------------------+---------+------------+---------------------------------+------------------+
| Alarm ID                             | Name                                 | State             | Enabled | Continuous | Alarm condition                 | Time constraints |
+--------------------------------------+--------------------------------------+-------------------+---------+------------+---------------------------------+------------------+
| 89bb4d76-19d6-4222-9386-b96484dcdb15 | Sprint8a-cpu_alarm_low-t5tcjdaquczf  | insufficient data | True    | False      | cpu_util < 15.0 during 1 x 600s | None             |
| d73b73fe-b5b2-48b7-8fd8-1c656e1eef6d | Sprint8a-cpu_alarm_high-t3ji7d42qajm | insufficient data | True    | False      | cpu_util > 50.0 during 1 x 60s  | None             |
+--------------------------------------+--------------------------------------+-------------------+---------+------------+---------------------------------+------------------+

Where should I be looking? Thanks.

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by SamYaple
close date 2014-09-27 23:21:24.159922

3 answers

Sort by ยป oldest newest most voted
1

answered 2014-09-19 11:40:32 -0500

Heather gravatar image

updated 2014-09-24 11:02:17 -0500

I got this working the way I wanted. Thanks for the help! I'm going to attach the two files in case they can help someone else out though they are not materially that different from the examples provided above.

A couple of notes if you try to use these files. Some IP's on the DNS have been obfuscated and some of the paths to pick up user_data have been modified. You would have to change those for your environment anyway.

I still have some questions on the alarm state(s) - especially insufficient data vs. ok. If there is a good explanation of what exactly those mean somewhere it would be helpful. Insufficient data seems to mean "normal", but I'm not sure how that is different from ok. This should probably be an independent question.

    heat_template_version: 2013-05-23

########################################################################
# Sprint 8 Deliverable -
########################################################################
description: Sprint 8 -- Get autoscaling to work


########################################################################
# Define Parameters
########################################################################
parameters:
  # declaration of input parameters

  ###############################
  # Auto-scaling params
  ###############################
  desired_capacity_requested:
    type: number
    label:  Desired Capacity
    description:  Normal Capacity
    default: 1

  max_capacity_requested:
    type: number
    label:  Max Capacity
    description:  Max Capacity
    default: 2

  min_capacity_requested:
    type: number
    label:  Min Capacity
    description:  Min Capacity
    default: 1

  cooldown_period:
    type: number
    label:  Cooldown Time
    description: Cooldown Period 
    default: 60

  #############################


  tenant_net_id:
    type: string
    label:  Tenant Network ID
    description: Tenant Network ID
    default: 4e25c321632e42e7a32ec311c8ff99c2
    constraints:
      - allowed_values:
        # widgetco
        - 4e25c321632e42e7a32ec311c8ff99c2
        # admin
        - 4b46643a490d459db937ef81e5ebbdfe

  ip_ver:
    type: string
    label:  IP Version
    description: IP Version (4 or 6)
    default: "4"
    constraints:
      - allowed_values:
        - "4"
        - "6"
        description: select 4 or 6


  instance_type:
    type: string
    label: Flavor Type
    description: Type of instance (flavor) to be used
    default: m1.small
    constraints:
      - allowed_values:
        - m1.tiny
        - m1.small
        - m1.medium
        - m1.large
        description:  must select from list


  image_id:
    type: string
    label: Image
    description:  Image Type
    default: centos65-x86_64
    constraints:
      - allowed_values:
        - centos-6.5-x86_64
        - centos65-x86_64
        - cirros-0.3.2-x86_64
        - redhat65-x86_64


#  floating_ip_id:
#    description: ID of a floating IP
#    type: string
#    label: FloatingIPId
#    default: 

  dns_servers:
    type: comma_delimited_list
    label:  Name Servers
    description: List the name servers
    default: ['XXX.XXX.84.13'] 
    #default: ["XXX.XXX.84.13", "XXX.XXX.90.250"]


  #ext-net uuid
  ext_net_id:
    type: string
    label: Ext-NetID
    default: 1a521eeb-afad-409f-b56e-78631ff77059

  ext-net-name:
    type: string
    label: Private Net
    default: ext-net
    description: ID of private network into which servers get deployed
    constraints:
      - allowed_values:
        - demo-net
        - ext-net
        - hot-net
        description: available networks

  ssh_key_name:
    type: string
    label: SSH Key Name
    default: widgetco


resources:
  #############################################################
  # Create the networks
  #############################################################

  CustNetZone1:
    type: OS::Neutron::Net
    properties:
      name: zone1
      shared: False
      tenant_id: { get_param: tenant_net_id }  
      value_specs: {}

  CustNetZone2:
    type: OS::Neutron::Net
    properties:
      name: zone2
      shared: False
      tenant_id: { get_param: tenant_net_id }  
      value_specs: {}

  Zone1_Subnet:
    type: OS::Neutron::Subnet
    properties:
      name: zone1-subnet
      network_id: { get_resource: CustNetZone1 }
      allocation_pools: [ { "start": 192.168.3.2, "end": 192.168.3.14 } ]
      cidr: 192.168.3.0/28
      #dns_nameservers: [ { get_param: dns_servers } ]
      dns_nameservers: [ 'XXX.XXX.84.13', 'XXX.XXX.90.250' ]
      enable_dhcp: True
      gateway_ip: 192.168.3.1
      #host_routes: []
      ip_version: { get_param: ip_ver }
      tenant_id: { get_param: tenant_net_id }
      value_specs: {}


  Zone2_Subnet:
    type: OS::Neutron::Subnet
    properties:
      name: zone2-subnet
      network_id: { get_resource: CustNetZone2 }
      allocation_pools: [ { "start": 192.168.4.2, "end": 192.168.4.6 } ]
      cidr: 192.168.4.0/29
      #dns_nameservers: [ { get_param: dns_servers } ]
      dns_nameservers: [ 'XXX.XXX.84.13', 'XXX ...
(more)
edit flag offensive delete link more

Comments

You can use haproxy for testing.

SamYaple gravatar imageSamYaple ( 2014-09-19 12:40:43 -0500 )edit
1

answered 2014-09-18 18:33:43 -0500

fgorbat gravatar image

updated 2014-09-19 08:34:01 -0500

Yes, guess you can't create auto-scaling without LBA. The idea that, LBA will route the traffic to one or more instances, also LBA will be aware about the environment in both cases of scaling up and scaling down. Here is nice autoscaling diagram.

edit flag offensive delete link more
0

answered 2014-09-19 14:21:54 -0500

larsks gravatar image

updated 2014-09-19 14:22:23 -0500

To clarify the above answers:

You do not need a load balancer to experiement with autoscaling, although it certainly makes your life easier. Even without a load balancer in place, the autoscaling alarms will trigger and Heat will activate your autoscaling policies.

I recently ran a hangout in which I ran through several Heat template examples, including (a) one with autoscaling and no load balancer and (b) another with the load balancer in place. You can watch the hangout here:

You can find the templates in this repository:

In particular, this one implements autoscaling with the load balancer, while this one is the same but with a load balancer.

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

2 followers

Stats

Asked: 2014-09-18 13:23:09 -0500

Seen: 362 times

Last updated: Sep 24 '14