Add NovaInstanceWithCinderVolume_Native F18 HOT template.
A template showing how to create a Nova instance, a Cinder volume and attach the volume to the instance using Cinder VolumeAttachment. The template uses only Heat OpenStack native resource types. Change-Id: I07459a76a4ae859e53185c273d1f20a3985cc74d
This commit is contained in:
parent
a5313989cf
commit
bee6d663db
62
hot/F18/NovaInstanceWithCinderVolume_Native.yaml
Normal file
62
hot/F18/NovaInstanceWithCinderVolume_Native.yaml
Normal file
@ -0,0 +1,62 @@
|
||||
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] }
|
Loading…
Reference in New Issue
Block a user