forked from cloudfoundry/docs-bosh
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy-microbosh-to-openstack.html.md.erb
367 lines (281 loc) · 10.9 KB
/
deploy-microbosh-to-openstack.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
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
---
title: Deploying MicroBOSH to OpenStack
---
This topic explains how to deploy MicroBOSH to OpenStack.
<p class="note">Note: Micro CLI plugin is deprecated, but is still supported. To set up a new Director VM or upgrade your MicroBOSH, please follow <a href="/docs/init-openstack.html">Initializing on OpenStack</a> document.</p>
##<a id="create-manifest"></a>Step 1: Create a Deployment Manifest ##
The MicroBOSH deployment manifest is a YAML file that defines the components and
properties of the deployment.
Create a manifest for your deployment as follows:
1. Create a local deployment directory to store your manifest.
<pre class="terminal">
$ mkdir ~/my-micro-deployment
</pre>
1. Create a deployment manifest YAML file.
The example below is a MicroBOSH deployment manifest template.
Copy and paste the template into a text editor and save the manifest to your
deployment directory.
In the template, you must replace the `NETWORK-UUID`,
`SUBNET-POOL-IP-ADDRESS`, `FLOATING-IP`, `OPENSTACK-PASSWORD`,
`IDENTITY-API-ENDPOINT`, `OPENSTACK-TENANT`, and `OPENSTACK-USERNAME`
properties.
We describe replacing these properties in [Step 2: Prepare an OpenStack environment](#prepare-openstack).
<p class="note"><strong>Note</strong>: The example below has the file name
<code>manifest.yml</code>, which we reference in other examples in this
topic.</p>
```yaml
---
name: microbosh
network:
type: manual
vip: FLOATING-IP # Replace with a floating IP address
ip: SUBNET-POOL-IP-ADDRESS # Replace with an address from the subnet IP address allocation pool of your OpenStack internal network
cloud_properties:
net_id: NETWORK-UUID # Replace with your OpenStack internal network UUID
resources:
persistent_disk: 20000
cloud_properties:
instance_type: m1.xlarge
cloud:
plugin: openstack
properties:
openstack:
auth_url: IDENTITY-API-ENDPOINT # Replace with your OpenStack Identity API endpoint
tenant: OPENSTACK-TENANT # Replace with OpenStack tenant name
username: OPENSTACK-USERNAME # Replace with OpenStack username
api_key: OPENSTACK-PASSWORD # Replace with your OpenStack password
default_key_name: microbosh # OpenStack Keypair name
private_key: microbosh.pem # Path to OpenStack Keypair private key
default_security_groups: [bosh]
apply_spec:
properties:
director: {max_threads: 3}
hm: {resurrector_enabled: true}
ntp: [0.north-america.pool.ntp.org, 1.north-america.pool.ntp.org]
```
---
##<a id="prepare-openstack"></a>Step 2: Prepare an OpenStack Environment ##
To prepare your OpenStack project for deploying MicroBOSH, use the OpenStack GUI
to perform the following tasks:
* Verify [Prerequisites](#prerequisites)
* Create a [Keypair](#keypair).
* Create and configure [Security Groups](#security-groups).
* Allocate a [floating IP address](#floating-ip).
### <a id="prerequisites"></a>Prerequisites ###
1. An OpenStack environment running one of the following supported releases:
* [Havana](http://www.openstack.org/software/havana)
* [Icehouse](http://www.openstack.org/software/icehouse)
* [Juno](http://www.openstack.org/software/juno)
1. The following OpenStack services:
* [Identity](http://www.openstack.org/software/openstack-shared-services/):
MicroBOSH authenticates credentials and retrieves the endpoint URLs for
other OpenStack services.
* [Compute](http://www.openstack.org/software/openstack-compute/):
MicroBOSH boots new VMs, assigns floating IPs to VMs, and creates and
attaches volumes to VMs.
* [Image](http://www.openstack.org/software/openstack-shared-services/):
MicroBOSH stores stemcells using the Image service.
* **(Optional)** [OpenStack
Networking](http://www.openstack.org/software/openstack-networking/):
Provides network scaling and automated management functions that are
useful when deploying complex distributed systems.
1. The following OpenStack networks:
* An external network with a subnet.
* An internal network with a subnet. The subnet must have an IP address allocation pool.
1. A new OpenStack project.
<p class="note"><strong>Note</strong>: See the <a href="http://docs.openstack.org/">OpenStack documentation</a> for help finding
more information.</p>
---
### <a id="keypair"></a>Create a Keypair ###
1. Select **Access & Security** from the left navigation panel.
1. Select the **Keypairs** tab.
<%= image_tag("images/micro-openstack/keypair.png") %>
1. Click **Create Keypair**.
1. Name the Keypair "microbosh" and click **Create Keypair**.
<%= image_tag("images/micro-openstack/create-keypair.png") %>
1. Save the `microbosh.pem` file.
<%= image_tag("images/micro-openstack/save-keypair.png") %>
1. Move the `microbosh.pem` file into your local deployment directory.
For example, on UNIX run this command:
<pre class="terminal">
mv ~/Downloads/bosh.pem ~/my-micro-deployment/microbosh.pem
</pre>
---
### <a id="security-groups"></a>Create and Configure Security Groups ###
You must create and configure two Security Groups to restrict incoming network
traffic to the BOSH VMs.
####BOSH Security Group ####
1. Select **Access & Security** from the left navigation panel.
1. Select the **Security Groups** tab.
<%= image_tag("images/micro-openstack/security-groups.png") %>
1. Click **Create Security Group**.
1. Name the security group "bosh" and add the description "BOSH Security Group".
<%= image_tag("images/micro-openstack/create-bosh-sg.png") %>
1. Click **Create Security Group**.
1. Select the BOSH Security Group and click **Edit Rules**.
1. Click **Add Rule**.
<%= image_tag("images/micro-openstack/edit-bosh-sg.png") %>
1. Add the following rules to the BOSH Security Group:
<table border="1" class="nice" >
<tr>
<th><b>Direction</b></th>
<th><b>Ether Type</b></th>
<th><b>IP Protocol</b></th>
<th><b>Port Range</b></th>
<th><b>Remote</b></th>
</tr>
<tr>
<td>Ingress</td>
<td>IPv4</td>
<td>TCP</td>
<td>1-65535</td>
<td>bosh</td>
</tr>
<tr>
<td>Ingress</td>
<td>IPv4</td>
<td>TCP</td>
<td>25777</td>
<td>0.0.0.0/0 (CIDR)</td>
</tr>
<tr>
<td>Ingress</td>
<td>IPv4</td>
<td>TCP</td>
<td>25555</td>
<td>0.0.0.0/0 (CIDR)</td>
</tr>
<tr>
<td>Ingress</td>
<td>IPv4</td>
<td>TCP</td>
<td>25250</td>
<td>0.0.0.0/0 (CIDR)</td>
</tr>
<tr>
<td>Ingress</td>
<td>IPv4</td>
<td>TCP</td>
<td>6868</td>
<td>0.0.0.0/0 (CIDR)</td>
</tr>
<tr>
<td>Ingress</td>
<td>IPv4</td>
<td>TCP</td>
<td>4222</td>
<td>0.0.0.0/0 (CIDR)</td>
</tr>
<tr>
<td>Ingress</td>
<td>IPv4</td>
<td>UDP</td>
<td>68</td>
<td>0.0.0.0/0 (CIDR)</td>
</tr>
<tr>
<td>Ingress</td>
<td>IPv4</td>
<td>TCP</td>
<td>53</td>
<td>0.0.0.0/0 (CIDR)</td>
</tr>
<tr>
<td>Ingress</td>
<td>IPv4</td>
<td>UDP</td>
<td>53</td>
<td>0.0.0.0/0 (CIDR)</td>
</tr>
<tr>
<td>Ingress</td>
<td>IPv4</td>
<td>TCP</td>
<td>22</td>
<td>0.0.0.0/0 (CIDR)</td>
</tr>
<tr>
<td>Egress</td>
<td>IPv4</td>
<td>Any</td>
<td>-</td>
<td>0.0.0.0/0 (CIDR)</td>
</tr>
<tr>
<td>Egress</td>
<td>IPv6</td>
<td>Any</td>
<td>-</td>
<td>::/0 (CIDR)</td>
</tr>
</table>
<p class="note"><strong>Note</strong>: Production environments should have
MicroBOSH deployed without a floating IP address on the private subnet. We
highly recommend against running any production environment with
<code>0.0.0.0/0</code> source IP addresses.</p>
---
###<a id="floating-ip"></a>Allocate a Floating IP Address ###
1. Select **Access & Security** from the left navigation panel.
1. Select the **Floating IPs** tab.
<%= image_tag("images/micro-openstack/create-floating-ip.png") %>
1. Click **Allocate IP to Project**.
1. Select **External** from the **Pool** dropdown menu.
1. Click **Allocate IP**.
<%= image_tag("images/micro-openstack/allocate-ip.png") %>
1. Replace `FLOATING-IP` in your deployment manifest with the allocated
Floating IP Address.
<%= image_tag("images/micro-openstack/floating-ip.png") %>
---
##<a id="download-stemcell"></a>Step 3: Download a Stemcell ##
1. Open [https://bosh.io/stemcells](https://bosh.io/stemcells) in a web browser
to view a list of publicly available BOSH stemcells.
The list displays the most recent build numbers of BOSH stemcells, organized by operating system, target IaaS, and hypervisor.
1. Choose a BOSH stemcell for OpenStack and click the build number to download.
---
##<a id="deploy-microbosh"></a>Step 4: Deploy MicroBOSH ##
1. In a terminal window, run `bosh micro deployment microbosh.yml` from your
deployment directory to instruct MicroBOSH to use your manifest file.
<pre class='terminal'>
$ cd ~/my-micro-deployment
$ bosh micro deployment manifest.yml
WARNING! Your target has been changed to https://173.81.16.12:25555!
Deployment set to ~/my-micro-deployment/manifest.yml
</pre>
<p class="note"><strong>Note</strong>: BOSH displays a red
<code>WARNING!</code> message. This is not an error message.
1. Run `bosh micro deploy STEMCELL-NAME` to deploy MicroBOSH.
<p class="note"><strong>Note</strong>: BOSH may displays a red
<code>No bosh-deployments.yml file found</code> message.
If prompted to allow MicroBOSH to the save state in the current directory,
type <code>yes</code>.</p>
<pre class='terminal'>
$ bosh micro deploy bosh-stemcell-3012-openstack-kvm-ubuntu-trusty-go_agent.tgz
No 'bosh-deployments.yml' file found in current directory.
Is ~/my-micro-deployment a directory where you can save state? (type 'yes' to continue): yes
Deploying new micro BOSH instance ~/my-micro-deployment/manifest.yml to 'https://173.81.16.12:25555' (type 'yes' to continue): yes
Started deploy micro bosh
...
Done deploy micro bosh
Deployed '~/my-micro-deployment/manifest.yml' to 'https://173.81.16.12:25555', took 00:04:51 to complete
</pre>
1. Use `bosh target FLOATING-IP-ADDRESS` to log into your new MicroBOSH server.
The default username and password are `admin` and `admin`.
<pre class="terminal">
$ bosh target 173.81.16.12
Target set to 'microbosh'
Your username: admin
Enter password: *****
Logged in as 'admin'
$ bosh vms
No deployments
</pre>
---
##<a id="troubleshooting"></a>Troubleshooting ##
If the deployment fails, run `bosh micro delete`, then deploy again.
If an API Key error message appears, check the accuracy of the `OPENSTACK-PASSWORD` in the deployment manifest.
If other error messages appear:
* Check your deployment manifest for typographical or formatting errors.
* Review your OpenStack configuration.
---
[Back to Table of Contents](index.html#install)
Previous: [Bootstrapping an environment](bootstrap.html)