heat_template_version: 2014-10-16 description: A simple auto scaling group. parameter_groups: label: configuration_data description: configuration of the instances. parameters: key_name: type: string description: Name of keypair to assign to servers default: userkey image: type: string description: Name of image to use for servers default: cirros flavor: type: string description: Flavor to use for servers default: m1.tiny label: network_parameters description: thse values are used to configure the load balancer and the instances. parameters: public_net_id: type: string description: ID of public network for which floating IP @ will be allocated default: 5bfc0aa4-cf22-486c-afae-34bf9032d8fc private_net_id: type: string description: ID of private network into which servers get deployed default: 8af8618c-8ae4-43b2-b58e-9f54b09343e1 private_subnet_id: type: string description: ID of private sub network into which servers get deployed default: 633dbac8-192a-4e69-8275-9562f84c081f resources: group: type: OS::Heat::AutoScalingGroup properties: cooldown: 60 desired_capacity: 1 max_size: 3 min_size: 1 resource: type: OS::Nova::Server::Cirros scaleup_policy: type: OS::Heat::ScalingPolicy properties: adjustment_type: change_in_capacity auto_scaling_group_id: { get_resource: group } cooldown: 60 scaling_adjustment: 1 scaledown_policy: type: OS::Heat::ScalingPolicy properties: adjustment_type: change_in_capacity auto_scaling_group_id: { get_resource: group } cooldown: 60 scaling_adjustment: -1 cpu_alarm_high: type: OS::Ceilometer::Alarm properties: meter_name: cpu_util statistic: avg period: 60 evaluation_periods: 1 threshold: 50 alarm_actions: - {get_attr: [scaleup_policy, alarm_url]} comparison_operator: gt matching_metadata: {'metadata.user_metadata.stack': {get_param: "OS::stack_id"}} cpu_alarm_low: type: OS::Ceilometer::Alarm properties: meter_name: cpu_util statistic: avg period: 60 evaluation_periods: 1 threshold: 15 alarm_actions: - {get_attr: [scaledown_policy, alarm_url]} comparison_operator: lt matching_metadata: {'metadata.user_metadata.stack': {get_param: "OS::stack_id"}} lb_vip_port: type: OS::Neutron::Port properties: network_id: { get_param: private_net_id } fixed_ips: - subnet_id: { get_param: private_subnet_id } lb_vip_floating_ip: type: OS::Neutron::FloatingIP properties: floating_network_id: { get_param: public_net_id } port_id: { get_resource: lb_vip_port } lb_pool_vip: type: OS::Neutron::FloatingIPAssociation properties: floating_id: { get_resource: lb_vip_floating_ip } port_id: { 'Fn::Select': ['port_id', {get_attr: [pool, vip]}]} monitor: type: OS::Neutron::HealthMonitor properties: type: TCP delay: 3 max_retries: 5 timout: 5 pool: type: OS::Neutron::Pool properties: #admin_state_up: Boolean description: String lb_method: LEAST_CONNECTIONS protocol: TCP subnet_id: {get_param: private_subnet_id} vip: protocol_port: 80 lb: type: OS::Neutron::LoadBalancer properties: protocol_port: 80 pool_id: {get_resource: pool}