forked from NeCTAR-RC/heat-templates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsingle_instance_with_cinder_volume.yaml
84 lines (67 loc) · 2.55 KB
/
single_instance_with_cinder_volume.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# http://docs.openstack.org/developer/heat/template_guide/hot_spec.html#heat-template-version
heat_template_version: 2014-10-16
description: >
NeCTAR Sample Template showing how to create a Nova instance,
a Cinder volume and attach the volume to the instance.
This template is a customization for the NeCTAR environment of the template
named NovaInstanceWithCinderVolume_Native.yaml in the OpenStack heat
template repository.
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: m2.tiny
constraints:
- allowed_values: [m2.tiny, m2.xsmall, m2.small]
description:
Must be a valid NeCTAR flavour, limited to the smaller ones available
image_id:
type: string
description: ID of the image to use for the instance to be created
default: fc48b5bb-e67d-4e39-b9ba-b6725c8b0c88
availability_zone:
type: string
description: The NeCTAR zone in which the VM is to run (must have block storage)
default: melbourne-qh2
constraints:
- allowed_values: [melbourne-qh2, melbourne-np, monash, qld]
description:
The NeCTAR zones to launch the instance.
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:
# http://docs.openstack.org/hot-reference/content/OS__Nova__Server.html
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 }
user_data_format: RAW # if on ubuntu will turn user from ec2-user to ubuntu !
cinder_volume:
# http://docs.openstack.org/hot-reference/content/OS__Cinder__Volume.html
type: OS::Cinder::Volume
properties:
size: { get_param: volume_size }
availability_zone: { get_param: availability_zone }
volume_attachment:
# http://docs.openstack.org/hot-reference/content/OS__Cinder__VolumeAttachment.html
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] }