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