Merge "Add support for isolating swift storage nets"
[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
92 resources:
93   SwiftConfig:
94     type: OS::Heat::StructuredConfig
95     properties:
96       group: os-apply-config
97       config:
98         snmpd:
99           export_MIB: UCD-SNMP-MIB
100           readonly_user_name: {get_input: snmpd_readonly_user_name}
101           readonly_user_password: {get_input: snmpd_readonly_user_password}
102         swift:
103           hash: { get_input: swift_hash_suffix }
104           part-power: { get_input: swift_part_power }
105           min-part-hours: { get_input: swift_min_part_hours }
106           mount-check: { get_input: swift_mount_check }
107           replicas: {get_input: swift_replicas }
108         neutron:
109           ovs:
110             local_ip: { get_input: neutron_local_ip }
111   SwiftStorage:
112     type: OS::Nova::Server
113     properties:
114       image: {get_param: Image}
115       flavor: {get_param: Flavor}
116       key_name: {get_param: KeyName}
117       networks:
118         - network: ctlplane
119       user_data_format: SOFTWARE_CONFIG
120       user_data: {get_resource: NodeUserData}
121
122   NodeUserData:
123     type: OS::TripleO::NodeUserData
124
125   InternalApiPort:
126     type: OS::TripleO::SwiftStorage::Ports::InternalApiPort
127     properties:
128       ControlPlaneIP: {get_attr: [SwiftStorage, networks, ctlplane, 0]}
129
130   StoragePort:
131     type: OS::TripleO::SwiftStorage::Ports::StoragePort
132     properties:
133       ControlPlaneIP: {get_attr: [SwiftStorage, networks, ctlplane, 0]}
134
135   StorageMgmtPort:
136     type: OS::TripleO::SwiftStorage::Ports::StorageMgmtPort
137     properties:
138       ControlPlaneIP: {get_attr: [SwiftStorage, networks, ctlplane, 0]}
139
140   NetworkConfig:
141     type: OS::TripleO::ObjectStorage::Net::SoftwareConfig
142     properties:
143       InternalApiIpSubnet: {get_attr: [InternalApiPort, ip_subnet]}
144       StorageIpSubnet: {get_attr: [StoragePort, ip_subnet]}
145       StorageMgmtIpSubnet: {get_attr: [StorageMgmtPort, ip_subnet]}
146
147   NetworkDeployment:
148     type: OS::TripleO::SoftwareDeployment
149     properties:
150       config: {get_resource: NetworkConfig}
151       server: {get_resource: SwiftStorage}
152
153   SwiftStorageDeploy:
154     type: OS::Heat::StructuredDeployment
155     properties:
156       server: {get_resource: SwiftStorage}
157       config: {get_resource: SwiftConfig}
158       signal_transport: NO_SIGNAL
159       input_values:
160         neutron_local_ip: {get_attr: [SwiftStorage, networks, ctlplane, 0]}
161         snmpd_readonly_user_name: {get_param: SnmpdReadonlyUserName}
162         snmpd_readonly_user_password: {get_param: SnmpdReadonlyUserPassword}
163         swift_hash_suffix: {get_param: HashSuffix}
164         swift_mount_check: {get_param: MountCheck}
165         swift_min_part_hours: {get_param: MinPartHours}
166         swift_part_power: {get_param: PartPower}
167         swift_replicas: { get_param: Replicas}
168
169 outputs:
170   hosts_entry:
171     value:
172       str_replace:
173         template: "IP HOST"
174         params:
175           IP: {get_attr: [SwiftStorage, networks, ctlplane, 0]}
176           HOST: {get_attr: [SwiftStorage, name]}
177   nova_server_resource:
178     description: Heat resource handle for the swift storage server
179     value:
180       {get_resource: SwiftStorage}
181   swift_device:
182     description: Swift device formatted for swift-ring-builder
183     value:
184       str_replace:
185         template: 'r1z1-IP:%PORT%/d1'
186         params:
187           IP: {get_attr: [SwiftStorage, networks, ctlplane, 0]}
188   internal_api_ip_address:
189     description: IP address of the server in the internal_api network
190     value: {get_attr: [InternalApiPort, ip_address]}
191   storage_ip_address:
192     description: IP address of the server in the storage network
193     value: {get_attr: [StoragePort, ip_address]}
194   storage_mgmt_ip_address:
195     description: IP address of the server in the storage_mgmt network
196     value: {get_attr: [StorageMgmtPort, ip_address]}