heat-templates/hot/F18/NovaInstanceWithCinderVolum...

63 lines
2.0 KiB
YAML

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:
key_name:
type: string
description:
Name of an existing key pair to enable SSH access to the instance.
instance_type:
type: string
description: Type of the instance to be created.
default: m1.small
constraints:
- allowed_values: [m1.small, m1.medium, m1.large]
description:
Value must be one of 'm1.small', 'm1.medium' or 'm1.large'.
image_id:
type: string
description: ID of the image to use for the instance to be created.
default: F18-x86_64-cfntools
constraints:
- allowed_values: [ F18-i386-cfntools, F18-x86_64-cfntools ]
description:
Image ID must be either F18-i386-cfntools or F18-x86_64-cfntools.
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.
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 }
key_name: { get_param: key_name }
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/vdc
outputs:
instance_ip:
description: Public IP address of the newly created Nova instance.
value: { get_attr: [nova_instance, first_address] }