Skip to content

Instantly share code, notes, and snippets.

@signed8bit
Last active August 29, 2015 14:06
Show Gist options
  • Save signed8bit/d3459fb3dd65bed6df41 to your computer and use it in GitHub Desktop.
Save signed8bit/d3459fb3dd65bed6df41 to your computer and use it in GitHub Desktop.
CoderFaire Heat Example
heat_template_version: 2013-05-23
description: >
A template showing how to create a Nova instance, a Cinder volume and attach
the volume to the instance. The template uses only Heat OpenStack native
resource types.
parameters:
instance_type:
type: string
description: Type of the instance to be created.
default: m1.nano
constraints:
- allowed_values: [m1.nano, m1.micro, m1.small]
description:
Value must be one of 'm1.nano', 'm1.micro' or 'm1.small'.
image_id:
type: string
description: ID of the image to use for the instance to be created.
default: cirros-0.3.1-x86_64-uec
constraints:
- allowed_values: [ cirros-0.3.1-x86_64-uec, cirros-0.3.2-x86_64-uec ]
description:
Image ID must be either cirros-0.3.1-x86_64-uec or cirros-0.3.2-x86_64-uec.
availability_zone:
type: string
description: The Availability Zone to launch the instance.
default: nova
volume_size:
type: number
description: Size of the volume to be created in GB.
default: 1
constraints:
- range: { min: 1, max: 1024 }
description: must be between 1 and 1024 GB.
resources:
nova_instance:
type: OS::Nova::Server
properties:
availability_zone: { get_param: availability_zone }
image: { get_param: image_id }
flavor: { get_param: instance_type }
security_groups: ["default", "SSH"]
cinder_volume:
type: OS::Cinder::Volume
properties:
size: { get_param: volume_size }
availability_zone: { get_param: availability_zone }
volume_attachment:
type: OS::Cinder::VolumeAttachment
properties:
volume_id: { get_resource: cinder_volume }
instance_uuid: { get_resource: nova_instance }
mountpoint: /dev/vdb
outputs:
instance_ip:
description: Public IP address of the newly created Nova instance.
value: { get_attr: [nova_instance, first_address] }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment