2a8c23358051367f718c9a817efacca0b139f1ba
[parser.git] /
1 heat_template_version: 2013-05-23
2
3 description: >
4   TOSCA simple profile with server and attached block storage using the normative
5   AttachesTo Relationship Type.
6
7 parameters:
8   cpus:
9     type: number
10     description: Number of CPUs for the server.
11     default: 1
12     constraints:
13     - allowed_values:
14       - 1
15       - 2
16       - 4
17       - 8
18   storage_location:
19     type: string
20     description: Block storage mount point (filesystem path).
21     default: /dev/vdc
22   storage_size:
23     type: number
24     description: Size of the storage to be created.
25     default: 2
26   storage_snapshot_id:
27     type: string
28     description: "Optional identifier for an existing snapshot to use when creating storage."
29     default: ssid
30
31 resources:
32   my_server:
33     type: OS::Nova::Server
34     properties:
35       flavor: m1.small
36       image: fedora-amd64-heat-config
37       key_name: userkey
38       user_data_format: SOFTWARE_CONFIG
39     depends_on:
40     - my_storage
41
42   my_storage:
43     type: OS::Cinder::Volume
44     properties:
45       size:
46         get_param: storage_size
47       snapshot_id:
48         get_param: storage_snapshot_id
49
50   attachesto_1:
51     type: OS::Cinder::VolumeAttachment
52     properties:
53       instance_uuid:
54         get_resource: my_server
55       mountpoint:
56         get_param: storage_location
57       volume_id:
58         get_resource: my_storage
59
60 outputs:
61   private_ip:
62     description: The private IP address of the newly created compute instance.
63     value:
64       get_attr:
65       - my_server
66       - networks
67       - private
68       - 0
69   volume_id:
70     description: The volume id of the block storage instance.
71     value:
72       get_resource: my_storage