Merge "Define Glance Pacemaker resources on $pacemaker_master node only"
[apex-tripleo-heat-templates.git] / cinder-storage.yaml
1 heat_template_version: 2015-04-30
2 description: 'Common Block Storage Configuration'
3 parameters:
4   Image:
5     default: overcloud-cinder-volume
6     type: string
7   CinderEnableIscsiBackend:
8     default: true
9     description: Whether to enable or not the Iscsi backend for Cinder
10     type: boolean
11   CinderISCSIHelper:
12     default: tgtadm
13     description: The iSCSI helper to use with cinder.
14     type: string
15   CinderLVMLoopDeviceSize:
16     default: 5000
17     description: The size of the loopback file used by the cinder LVM driver.
18     type: number
19   VirtualIP:
20     default: ''
21     type: string
22   ExtraConfig:
23     default: {}
24     description: |
25       Additional configuration to inject into the cluster. The JSON should have
26       the following structure:
27         {"FILEKEY":
28           {"config":
29             [{"section": "SECTIONNAME",
30               "values":
31                 [{"option": "OPTIONNAME",
32                   "value": "VALUENAME"
33                  }
34                 ]
35              }
36             ]
37           }
38         }
39       For instance:
40         {"nova":
41           {"config":
42             [{"section": "default",
43               "values":
44                 [{"option": "force_config_drive",
45                   "value": "always"
46                  }
47                 ]
48              },
49              {"section": "cells",
50               "values":
51                 [{"option": "driver",
52                   "value": "nova.cells.rpc_driver.CellsRPCDriver"
53                  }
54                 ]
55              }
56             ]
57           }
58         }
59     type: json
60   Flavor:
61     description: Flavor for block storage nodes to request when deploying.
62     type: string
63     constraints:
64       - custom_constraint: nova.flavor
65   GlancePort:
66     default: "9292"
67     description: Glance port.
68     type: string
69   KeyName:
70     default: default
71     description: Name of an existing EC2 KeyPair to enable SSH access to the instances
72     type: string
73   RabbitPassword:
74     default: 'guest'
75     type: string
76   RabbitUserName:
77     default: 'guest'
78     type: string
79   RabbitClientUseSSL:
80     default: false
81     description: >
82         Rabbit client subscriber parameter to specify
83         an SSL connection to the RabbitMQ host.
84     type: string
85   RabbitClientPort:
86     default: 5672
87     description: Set rabbit subscriber port, change this if using SSL
88     type: number
89   SnmpdReadonlyUserName:
90     default: ro_snmp_user
91     description: The user name for SNMPd with readonly rights running on all Overcloud nodes
92     type: string
93   SnmpdReadonlyUserPassword:
94     default: unset
95     description: The user password for SNMPd with readonly rights running on all Overcloud nodes
96     type: string
97     hidden: true
98 resources:
99   BlockStorage:
100     type: OS::Nova::Server
101     properties:
102       image:
103         {get_param: Image}
104       flavor: {get_param: Flavor}
105       key_name: {get_param: KeyName}
106       networks:
107         - network: ctlplane
108       user_data_format: SOFTWARE_CONFIG
109       user_data: {get_resource: NodeUserData}
110
111   NodeUserData:
112     type: OS::TripleO::NodeUserData
113
114   InternalApiPort:
115     type: OS::TripleO::BlockStorage::Ports::InternalApiPort
116     properties:
117       ControlPlaneIP: {get_attr: [BlockStorage, networks, ctlplane, 0]}
118
119   StoragePort:
120     type: OS::TripleO::BlockStorage::Ports::StoragePort
121     properties:
122       ControlPlaneIP: {get_attr: [BlockStorage, networks, ctlplane, 0]}
123
124   StorageMgmtPort:
125     type: OS::TripleO::BlockStorage::Ports::StorageMgmtPort
126     properties:
127       ControlPlaneIP: {get_attr: [BlockStorage, networks, ctlplane, 0]}
128
129   NetworkConfig:
130     type: OS::TripleO::BlockStorage::Net::SoftwareConfig
131     properties:
132       InternalApiIpSubnet: {get_attr: [InternalApiPort, ip_subnet]}
133       StorageIpSubnet: {get_attr: [StoragePort, ip_subnet]}
134       StorageMgmtIpSubnet: {get_attr: [StorageMgmtPort, ip_subnet]}
135
136   NetworkDeployment:
137     type: OS::TripleO::SoftwareDeployment
138     properties:
139       config: {get_resource: NetworkConfig}
140       server: {get_resource: BlockStorage}
141
142   BlockStorageDeployment:
143     type: OS::Heat::StructuredDeployment
144     properties:
145       server: {get_resource: BlockStorage}
146       config: {get_resource: BlockStorageConfig}
147       input_values:
148         controller_virtual_ip: {get_param: VirtualIP}
149         cinder_dsn: {list_join: ['', ['mysql://cinder:unset@', {get_param: VirtualIP} , '/cinder']]}
150         snmpd_readonly_user_name: {get_param: SnmpdReadonlyUserName}
151         snmpd_readonly_user_password: {get_param: SnmpdReadonlyUserPassword}
152       signal_transport: NO_SIGNAL
153   BlockStorageConfig:
154     type: OS::Heat::StructuredConfig
155     properties:
156       group: os-apply-config
157       config:
158         keystone:
159           host: {get_input: controller_virtual_ip}
160         cinder:
161           db: {get_input: cinder_dsn}
162           volume_size_mb:
163             get_param: CinderLVMLoopDeviceSize
164           iscsi-helper:
165             get_param: CinderISCSIHelper
166         snmpd:
167           export_MIB: UCD-SNMP-MIB
168           readonly_user_name: {get_input: snmpd_readonly_user_name}
169           readonly_user_password: {get_input: snmpd_readonly_user_password}
170         rabbit:
171           host: {get_input: controller_virtual_ip}
172           username: {get_param: RabbitUserName}
173           password: {get_param: RabbitPassword}
174         glance:
175           host: {get_input: controller_virtual_ip}
176           port: {get_param: GlancePort}
177 outputs:
178   hosts_entry:
179     value:
180       str_replace:
181         template: "IP HOST"
182         params:
183           IP: {get_attr: [BlockStorage, networks, ctlplane, 0]}
184           HOST: {get_attr: [BlockStorage, name]}
185   internal_api_ip_address:
186     description: IP address of the server in the internal_api network
187     value: {get_attr: [InternalApiPort, ip_address]}
188   storage_ip_address:
189     description: IP address of the server in the storage network
190     value: {get_attr: [StoragePort, ip_address]}
191   storage_mgmt_ip_address:
192     description: IP address of the server in the storage_mgmt network
193     value: {get_attr: [StorageMgmtPort, ip_address]}