forked from cloudfoundry/docs-bosh
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopenstack-cpi.html.md.erb
270 lines (215 loc) · 8.37 KB
/
openstack-cpi.html.md.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
---
title: OpenStack CPI
---
This topic describes cloud properties for different resources created by the OpenStack CPI.
## <a id='azs'></a> AZs
Schema for `cloud_properties` section:
* **availability_zone** [String, required]: Availability zone to use for creating instances. Example: `east`.
Example:
```yaml
azs:
- name: z1
cloud_properties:
availability_zone: east
```
---
## <a id='networks'></a> Networks
Schema for `cloud_properties` section used by dynamic network or manual network subnet:
* **net_id** [String, required]: Network ID containing the subnet in which the instance will be created. Example: `net-b98ab66e-6fae-4c6a-81af-566e630d21d1`.
* **security_groups** [Array, optional]: Array of security groups to apply for all VMs that are placed on this network. Defaults to security groups specified by `default_security_groups` in the global CPI settings unless security groups are specified on a resource pool/vm type for a VM. If security groups are specified on a resource pool and a network, the resource pool security groups takes precedence since CPI v34+. In older CPI versions prior v34, security groups can either be specified for a network or a resource pool.
Example of manual network:
```yaml
networks:
- name: default
type: manual
subnets:
- range: 10.10.0.0/24
gateway: 10.10.0.1
cloud_properties:
net_id: net-b98ab66e-6fae-4c6a-81af-566e630d21d1
security_groups: [my-sec-group]
```
Example of dynamic network:
```yaml
networks:
- name: default
type: dynamic
cloud_properties:
net_id: net-b98ab66e-6fae-4c6a-81af-566e630d21d1
```
Example of vip network:
```yaml
networks:
- name: default
type: vip
```
---
## <a id='resource-pools'></a> Resource Pools / VM Types
Schema for `cloud_properties` section:
* **instance_type** [String, required]: Type of the instance. Example: `m1.small`.
* **availability_zone** [String, required]: Availability zone to use for creating instances. Example: `east`.
* **security_groups** [Array, optional]: Array of security groups to apply for all VMs that are in this resource pool. Defaults to security groups specified by `default_security_groups` in the global CPI settings unless security groups are specified on one of the VM networks. If security groups are specified on a resource pool and a network, the resource pool security groups takes precedence since CPI v34+. In older CPI versions prior v34, security groups can either be specified for a network or a resource pool.
* **key_name** [String, optional]: Key pair name. Defaults to key pair name specified by `default_key_name` in the global CPI settings. Example: `bosh`.
* **scheduler_hints** [Hash, optional]: Data passed to the OpenStack Filter scheduler to influence its decision where new VMs can be placed. See [VM Anti-Affinity](vm-anti-affinity.html#openstack) for a detailed example. Example: `{ group: af09abf2-2283... }`
* **root_disk** [Hash, optional]: Custom root disk properties. Requires [`boot_from_volume: true`](https://bosh.io/jobs/openstack_cpi?source=github.com/cloudfoundry-incubator/bosh-openstack-cpi-release#p=openstack.boot_from_volume) to enable cinder-backed boot volumes. Available in v25+.
* **size** [Integer, required]: Specifies the disk size in gigabytes.
* **loadbalancer_pools** [Array, optional]: Array of Hashes defining LBaaSv2 pools to attach this instance to. Requires neutron LBaaSv2 extension and OpenStack Mitaka or newer. Available in v32+.
* **name** [String, required]: The name of the LBaaSv2 loadbalancer pool
* **port** [Integer, required]: The port exposed on the instance
Example of an `m1.small` instance:
```yaml
resource_pools:
- name: default
network: default
stemcell:
name: bosh-openstack-kvm-ubuntu-trusty-go_agent
version: latest
cloud_properties:
instance_type: m1.small
availability_zone: east
```
Example of an `m1.small` instance, attached to LBaaSv2 pool named 'my-lb-pool'. Instance exposes port 8080 and is locked down by specific security groups:
```yaml
resource_pools:
- name: web-workers
network: default
stemcell:
name: bosh-openstack-kvm-ubuntu-trusty-go_agent
version: latest
cloud_properties:
instance_type: m1.small
availability_zone: east
security_groups: [bosh-vms, lb-accessible]
loadbalancer_pools:
- name: my-lb-pool
port: 8080
```
Example of an `m1.small` instance with custom root disk size of 50GB:
```yaml
resource_pools:
- name: default
network: default
stemcell:
name: bosh-openstack-kvm-ubuntu-trusty-go_agent
version: latest
cloud_properties:
instance_type: m1.small
availability_zone: east
root_disk:
size: 50
```
---
## <a id='disk-pools'></a> Disk Pools / Disk Types
Schema for `cloud_properties` section:
* **type** [String, optional]: Volume type as configured in your OpenStack installation. Example: `SSD`
Cinder volumes are created in the availability zone of an instance that volume will be attached.
Example of 10GB SSD disk:
```yaml
disk_pools:
- name: default
disk_size: 10_240
cloud_properties:
type: SSD
```
---
## <a id='global'></a> Global Configuration
See [CPI job configuration](https://bosh.io/jobs/openstack_cpi?source=github.com/cloudfoundry-incubator/bosh-openstack-cpi-release) for details.
Schema:
* **default_volume_type** [String, optional]: sets volume type for persistent disks unless overridden in resource pool/VM Type. `cinder type-list` will return the available volume types. Example: `SSD`.
Example with Keystone V3:
```yaml
properties:
openstack:
auth_url: http://pistoncloud.com:5000/v3
username: christopher
api_key: QRoqsenPsNGX6
project: Bosh
domain: sample-domain
region: RegionOne
default_key_name: bosh
default_security_groups: [bosh]
```
Example with Keystone V2 and default volume type `ceph`:
```yaml
properties:
openstack:
auth_url: http://pistoncloud.com:5000/v2.0
username: christopher
api_key: QRoqsenPsNGX6
tenant: Bosh
region: RegionOne
default_key_name: bosh
default_security_groups: [bosh]
default_volume_type: ceph
```
---
## <a id='cloud-config'></a> Example Cloud Config
```yaml
azs:
- name: z1
cloud_properties:
availability_zone: east1
- name: z2
cloud_properties:
availability_zone: east2
vm_types:
- name: default
cloud_properties:
instance_type: small
- name: large
cloud_properties:
instance_type: large
disk_types:
- name: default
disk_size: 3000
- name: large
disk_size: 50_000
networks:
- name: default
type: manual
subnets:
- range: 10.10.0.0/24
gateway: 10.10.0.1
az: z1
dns: [8.8.8.8]
cloud_properties:
net_id: net-b98ab66e-6fae-4c6a-81af-566e630d21d1
- range: 10.10.1.0/24
gateway: 10.10.1.1
az: z2
dns: [8.8.8.8]
cloud_properties:
net_id: net-85940t48-8ffe-3c3a-81af-27d499ff9842
- name: vip
type: vip
compilation:
workers: 5
reuse_compilation_vms: true
az: z1
vm_type: large
network: default
```
---
## <a id='errors'></a> Errors
```
Command 'deploy' failed:
Deploying:
Creating instance 'bosh/0':
Waiting until instance is ready:
Starting SSH tunnel:
Parsing private key file './bosh.pem':
asn1: structure error: superfluous leading zeros in length
```
If you're using OpenStack Liberty or Mitaka, you cannot use SSH keys generated by nova with BOSH CLI [due to an OpenStack bug](https://bugs.launchpad.net/nova/+bug/1483132). OpenStack versions before Liberty and after Mitaka are not affected. As a workaround, [generate your ssh key manually](https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/#generating-a-new-ssh-key) and import it to nova.
```
Bosh::Clouds::VMCreationFailed
```
This error is raised if OpenStack is unable to create a VM. That may happen because:
- not enough resources (vCPUs, RAM, disk) to run the VM. For example if you have selected `m1.xlarge` flavor that uses 10 vCPUs and you have 4 hypervisors and each one of them only has 3 vCPUs available, OpenStack is unable to start the VM anywhere even though, total vCPUs across all hypervisors is more than enough.
```
Image `4c1d6840-6ac7-4b42-bf29-c95fef6d986e' not found
```
It's possible that image was deleted from OpenStack directly and BOSH is not aware of it. You can recover with `bosh upload stemcell X --fix` to reupload the stemcell.
---
[Back to Table of Contents](index.html#cpi-config)
Next: [Using Keystone v2 API](openstack-keystonev2.html)