0f122238005b407077c7adf5cb656635acae0e44
[apex-tripleo-heat-templates.git] / cinder-storage.yaml
1 heat_template_version: 2014-10-16
2 description: 'Common Block Storage Configuration'
3 parameters:
4   Image:
5     default: overcloud-cinder-volume
6     type: string
7   CinderISCSIHelper:
8     default: tgtadm
9     description: The iSCSI helper to use with cinder.
10     type: string
11   CinderLVMLoopDeviceSize:
12     default: 5000
13     description: The size of the loopback file used by the cinder LVM driver.
14     type: number
15   VirtualIP:
16     default: ''
17     type: string
18   ExtraConfig:
19     default: {}
20     description: |
21       Additional configuration to inject into the cluster. The JSON should have
22       the following structure:
23         {"FILEKEY":
24           {"config":
25             [{"section": "SECTIONNAME",
26               "values":
27                 [{"option": "OPTIONNAME",
28                   "value": "VALUENAME"
29                  }
30                 ]
31              }
32             ]
33           }
34         }
35       For instance:
36         {"nova":
37           {"config":
38             [{"section": "default",
39               "values":
40                 [{"option": "force_config_drive",
41                   "value": "always"
42                  }
43                 ]
44              },
45              {"section": "cells",
46               "values":
47                 [{"option": "driver",
48                   "value": "nova.cells.rpc_driver.CellsRPCDriver"
49                  }
50                 ]
51              }
52             ]
53           }
54         }
55     type: json
56   Flavor:
57     description: Flavor for block storage nodes to request when deploying.
58     type: string
59     constraints:
60       - custom_constraint: nova.flavor
61   GlancePort:
62     default: "9292"
63     description: Glance port.
64     type: string
65   KeyName:
66     default: default
67     description: Name of an existing EC2 KeyPair to enable SSH access to the instances
68     type: string
69   RabbitPassword:
70     default: ''
71     type: string
72   RabbitUserName:
73     default: ''
74     type: string
75   SnmpdReadonlyUserName:
76     default: ro_snmp_user
77     description: The user name for SNMPd with readonly rights running on all Overcloud nodes
78     type: string
79   SnmpdReadonlyUserPassword:
80     default: unset
81     description: The user password for SNMPd with readonly rights running on all Overcloud nodes
82     type: string
83     hidden: true
84 resources:
85   BlockStorage:
86     type: OS::Nova::Server
87     properties:
88       image:
89         {get_param: Image}
90       flavor: {get_param: Flavor}
91       key_name: {get_param: KeyName}
92       user_data_format: SOFTWARE_CONFIG
93       networks:
94         - network: ctlplane
95   BlockStorageDeployment:
96     type: OS::Heat::StructuredDeployment
97     properties:
98       server: {get_resource: BlockStorage}
99       config: {get_resource: BlockStorageConfig}
100       input_values:
101         controller_virtual_ip: {get_param: VirtualIP}
102         cinder_dsn: {list_join: ['', ['mysql://cinder:unset@', {get_param: VirtualIP} , '/cinder']]}
103         snmpd_readonly_user_name: {get_param: SnmpdReadonlyUserName}
104         snmpd_readonly_user_password: {get_param: SnmpdReadonlyUserPassword}
105       signal_transport: NO_SIGNAL
106   BlockStorageConfig:
107     type: OS::Heat::StructuredConfig
108     properties:
109       group: os-apply-config
110       config:
111         keystone:
112           host: {get_input: controller_virtual_ip}
113         cinder:
114           db: {get_input: cinder_dsn}
115           volume_size_mb:
116             get_param: CinderLVMLoopDeviceSize
117           iscsi-helper:
118             get_param: CinderISCSIHelper
119         snmpd:
120           export_MIB: UCD-SNMP-MIB
121           readonly_user_name: {get_input: snmpd_readonly_user_name}
122           readonly_user_password: {get_input: snmpd_readonly_user_password}
123         rabbit:
124           host: {get_input: controller_virtual_ip}
125           username: {get_param: RabbitUserName}
126           password: {get_param: RabbitPassword}
127         glance:
128           host: {get_input: controller_virtual_ip}
129           port: {get_param: GlancePort}
130 outputs:
131   hosts_entry:
132     value:
133       str_replace:
134         template: "IP HOST HOST.novalocal"
135         params:
136           IP: {get_attr: [BlockStorage, networks, ctlplane, 0]}
137           HOST: {get_attr: [BlockStorage, name]}