Merge "Allow control of hostname formatting"
[apex-tripleo-heat-templates.git] / swift-storage.yaml
1 heat_template_version: 2015-04-30
2 description: 'Common Swift Storage Configuration'
3 parameters:
4   ExtraConfig:
5     default: {}
6     description: |
7       Additional configuration to inject into the cluster. The JSON should have
8       the following structure:
9         {"FILEKEY":
10           {"config":
11             [{"section": "SECTIONNAME",
12               "values":
13                 [{"option": "OPTIONNAME",
14                   "value": "VALUENAME"
15                  }
16                 ]
17              }
18             ]
19           }
20         }
21       For instance:
22         {"nova":
23           {"config":
24             [{"section": "default",
25               "values":
26                 [{"option": "force_config_drive",
27                   "value": "always"
28                  }
29                 ]
30              },
31              {"section": "cells",
32               "values":
33                 [{"option": "driver",
34                   "value": "nova.cells.rpc_driver.CellsRPCDriver"
35                  }
36                 ]
37              }
38             ]
39           }
40         }
41     type: json
42   Flavor:
43     description: Flavor for Swift storage nodes to request when deploying.
44     type: string
45     constraints:
46       - custom_constraint: nova.flavor
47   HashSuffix:
48     default: unset
49     description: A random string to be used as a salt when hashing to determine mappings
50       in the ring.
51     hidden: true
52     type: string
53   Image:
54     default: overcloud-swift-storage
55     type: string
56   KeyName:
57     default: default
58     description: Name of an existing EC2 KeyPair to enable SSH access to the instances
59     type: string
60   MountCheck:
61     default: 'false'
62     description: Value of mount_check in Swift account/container/object -server.conf
63     type: boolean
64   MinPartHours:
65     type: number
66     default: 1
67     description: The minimum time (in hours) before a partition in a ring can be moved following a rebalance.
68   PartPower:
69     default: 10
70     description: Partition Power to use when building Swift rings
71     type: number
72   Replicas:
73     type: number
74     default: 3
75     description: How many replicas to use in the swift rings.
76   SnmpdReadonlyUserName:
77     default: ro_snmp_user
78     description: The user name for SNMPd with readonly rights running on all Overcloud nodes
79     type: string
80   SnmpdReadonlyUserPassword:
81     default: unset
82     description: The user password for SNMPd with readonly rights running on all Overcloud nodes
83     type: string
84     hidden: true
85   UpdateIdentifier:
86     default: ''
87     type: string
88     description: >
89       Setting to a previously unused value during stack-update will trigger
90       package update on all nodes
91   Hostname:
92     type: string
93     default: '' # Defaults to Heat created hostname
94
95 resources:
96   SwiftConfig:
97     type: OS::Heat::StructuredConfig
98     properties:
99       group: os-apply-config
100       config:
101         snmpd:
102           export_MIB: UCD-SNMP-MIB
103           readonly_user_name: {get_input: snmpd_readonly_user_name}
104           readonly_user_password: {get_input: snmpd_readonly_user_password}
105         swift:
106           hash: { get_input: swift_hash_suffix }
107           part-power: { get_input: swift_part_power }
108           min-part-hours: { get_input: swift_min_part_hours }
109           mount-check: { get_input: swift_mount_check }
110           replicas: {get_input: swift_replicas }
111         neutron:
112           ovs:
113             local_ip: { get_input: neutron_local_ip }
114   SwiftStorage:
115     type: OS::Nova::Server
116     properties:
117       image: {get_param: Image}
118       flavor: {get_param: Flavor}
119       key_name: {get_param: KeyName}
120       networks:
121         - network: ctlplane
122       user_data_format: SOFTWARE_CONFIG
123       user_data: {get_resource: NodeUserData}
124       name: {get_param: Hostname}
125
126   NodeUserData:
127     type: OS::TripleO::NodeUserData
128
129   InternalApiPort:
130     type: OS::TripleO::SwiftStorage::Ports::InternalApiPort
131     properties:
132       ControlPlaneIP: {get_attr: [SwiftStorage, networks, ctlplane, 0]}
133
134   StoragePort:
135     type: OS::TripleO::SwiftStorage::Ports::StoragePort
136     properties:
137       ControlPlaneIP: {get_attr: [SwiftStorage, networks, ctlplane, 0]}
138
139   StorageMgmtPort:
140     type: OS::TripleO::SwiftStorage::Ports::StorageMgmtPort
141     properties:
142       ControlPlaneIP: {get_attr: [SwiftStorage, networks, ctlplane, 0]}
143
144   NetworkConfig:
145     type: OS::TripleO::ObjectStorage::Net::SoftwareConfig
146     properties:
147       InternalApiIpSubnet: {get_attr: [InternalApiPort, ip_subnet]}
148       StorageIpSubnet: {get_attr: [StoragePort, ip_subnet]}
149       StorageMgmtIpSubnet: {get_attr: [StorageMgmtPort, ip_subnet]}
150
151   NetworkDeployment:
152     type: OS::TripleO::SoftwareDeployment
153     properties:
154       config: {get_resource: NetworkConfig}
155       server: {get_resource: SwiftStorage}
156
157   SwiftStorageDeploy:
158     type: OS::Heat::StructuredDeployment
159     properties:
160       server: {get_resource: SwiftStorage}
161       config: {get_resource: SwiftConfig}
162       signal_transport: NO_SIGNAL
163       input_values:
164         neutron_local_ip: {get_attr: [SwiftStorage, networks, ctlplane, 0]}
165         snmpd_readonly_user_name: {get_param: SnmpdReadonlyUserName}
166         snmpd_readonly_user_password: {get_param: SnmpdReadonlyUserPassword}
167         swift_hash_suffix: {get_param: HashSuffix}
168         swift_mount_check: {get_param: MountCheck}
169         swift_min_part_hours: {get_param: MinPartHours}
170         swift_part_power: {get_param: PartPower}
171         swift_replicas: { get_param: Replicas}
172
173 outputs:
174   hosts_entry:
175     value:
176       str_replace:
177         template: "IP HOST"
178         params:
179           IP: {get_attr: [SwiftStorage, networks, ctlplane, 0]}
180           HOST: {get_attr: [SwiftStorage, name]}
181   nova_server_resource:
182     description: Heat resource handle for the swift storage server
183     value:
184       {get_resource: SwiftStorage}
185   swift_device:
186     description: Swift device formatted for swift-ring-builder
187     value:
188       str_replace:
189         template: 'r1z1-IP:%PORT%/d1'
190         params:
191           IP: {get_attr: [SwiftStorage, networks, ctlplane, 0]}
192   internal_api_ip_address:
193     description: IP address of the server in the internal_api network
194     value: {get_attr: [InternalApiPort, ip_address]}
195   storage_ip_address:
196     description: IP address of the server in the storage network
197     value: {get_attr: [StoragePort, ip_address]}
198   storage_mgmt_ip_address:
199     description: IP address of the server in the storage_mgmt network
200     value: {get_attr: [StorageMgmtPort, ip_address]}