summaryrefslogtreecommitdiffstats
path: root/docker/storperf-master/storperf/resources/hot/storperf-volume.yaml
blob: d64d0c29368cfeeb00605973746c6d8684011914 (plain)
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
##############################################################################
# Copyright (c) 2018 Dell EMC and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################

heat_template_version: newton

parameters:
  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.
  volume_type:
    type: string
    default: None
  agent_instance_uuid:
    type: string

conditions: {
  'without_type': {equals: [{get_param: volume_type}, 'None']},
  'with_type': {not: {equals: [{get_param: volume_type}, 'None']}}
}

resources:
  agent_volume_type:
    type: OS::Cinder::Volume
    condition: 'with_type'
    properties:
      size: { get_param: volume_size }
      volume_type: { get_param: volume_type}

  agent_volume_type_att:
    type: OS::Cinder::VolumeAttachment
    condition: 'with_type'
    properties:
      instance_uuid: { get_param: agent_instance_uuid }
      volume_id: { get_resource: agent_volume_type}

  agent_volume:
    type: OS::Cinder::Volume
    condition: 'without_type'
    properties:
      size: { get_param: volume_size }

  agent_volume_att:
    type: OS::Cinder::VolumeAttachment
    condition: 'without_type'
    properties:
      instance_uuid: { get_param: agent_instance_uuid }
      volume_id: { get_resource: agent_volume}