upstream/openstack/python-heat/python-heat/templates/hot/simple/OS_Heat_AutoScalingGroup.yaml

78 lines
2.2 KiB
YAML

################################################################################
# Copyright (c) 2013-2015 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
################################################################################
#
# Objective:
# Demonstrate constructing the heat resource OS::Heat::AutoScalingGroup
# To see a better example, refer to scenarios/NestedAutoScale.yaml
#
# Pre-Reqs:
# Normal lab setup. Capable of launching 3 VMs
# A flavor called: small (nova flavor-list)
# A glance image called: wrl6 (glance image-list)
# A network called: private-net0 (neutron net-list)
# A template file OS_Nova_Server.yaml in the same folder as this yaml.
#
# Optional Template Parameters:
# FLAVOR: A nova flavor name or UUID for the VMs (nova flavor-list)
# IMAGE: A glance image name or UUID when launching VMs (glance image-list)
# NETWORK: Name or UUID of the network to use for the VMs (neutron net-list)
#
# Tenant Considerations:
# None
#
# Sample CLI syntax:
# heat stack-create -f OS_Heat_AutoScalingGroup.yaml STACK
#
# Expected Outcome:
# VMs running the guest image (nova list)
#
################################################################################
heat_template_version: 2015-04-30
description: >
Demonstrate the OS::Heat::AutoScalingGroup heat resource
parameters:
FLAVOR:
description: Nova flavor to use (nova flavor-list)
type: string
default: small
constraints:
- custom_constraint: nova.flavor
IMAGE:
description: Name of the glance image to use (glance image-list)
type: string
default: wrl6
constraints:
- custom_constraint: glance.image
NETWORK:
description: Name of the network to use (neutron net-list)
type: string
default: private-net0
constraints:
- custom_constraint: neutron.network
resources:
OS_Heat_AutoScalingGroup:
type: OS::Heat::AutoScalingGroup
properties:
cooldown: 60
desired_capacity: 1
max_size: 3
min_size: 1
resource:
type: OS_Nova_Server.yaml
properties:
FLAVOR: { get_param: FLAVOR }
IMAGE: { get_param: IMAGE }
NETWORK: { get_param: NETWORK }