-
Notifications
You must be signed in to change notification settings - Fork 140
/
azure-om-upgrade.html.md.erb
335 lines (251 loc) · 15.5 KB
/
azure-om-upgrade.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
---
title: Upgrading BOSH Director on Azure
owner: Ops Manager
---
This topic describes how to upgrade BOSH Director for <%= vars.platform_name %> on Azure.
Complete the tasks in this topic as part of the <%= vars.ops_manager %> upgrade process. For more information, see [Upgrading <%= vars.platform_name %>](upgrading-pcf.html#upgrade_ops).
## <a id='overview'></a> Overview
<%# Find this partial in GitHub at `pivotal-cf/docs-partials` %>
<%= partial "/pcf/core/#{vars.current_major_version.sub('.', '-')}/om_upgrade_overview" %>
<p class="note"><strong>Note:</strong> The Azure portal sometimes displays the names of resources with incorrect capitalization. Always use the Azure CLI to retrieve the correctly capitalized name of a resource.</p>
To create an <%= vars.ops_manager %> VM instance:
1. Export environment variables. For more information, see [Export Environment Variables](#env-vars).
1. Copy the <%= vars.ops_manager %> image into your storage account. For more information, see [Copy the <%= vars.ops_manager %> Image](#setup).
1. Configure the <%= vars.ops_manager %> IP Address. For more information, see [Configure <%= vars.ops_manager %> IP Address](#config-ip).
1. Create <%= vars.ops_manager %> VM instance. For more information, see [Create <%= vars.ops_manager %> VM Instance](#boot).
## <a id='prerequisites'></a> Prerequisites
<%# Find this partial in GitHub at `pivotal-cf/docs-partials` %>
<%= partial "/pcf/core/#{vars.current_major_version.sub('.', '-')}/om_upgrade_prerequisite" %>
## <a id='env-vars'></a> Export Environment Variables
Export the `connectionString` variable for your Azure account and assign it to a new environment variable. You use the `connectionString` environment variable when you copy the <%= vars.ops_manager %> image in the following procedure.
To export environment variables:
1. Install the Azure CLI v2.0 by following the instructions for your operating system in [Install the Azure CLI](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli) in the Microsoft Azure documentation.
1. Set your cloud by running:
```
az cloud set --name AzureCloud
```
If you deployed <%= vars.platform_name %> in an environment other than Azure Cloud, consult the following list:
* For Azure China, replace `AzureCloud` with `AzureChinaCloud`. If logging in to `AzureChinaCloud` fails with a `CERT_UNTRUSTED` error, use Node v4 or later.
* For Azure Government Cloud, replace `AzureCloud` with `AzureUSGovernment`.
* For Azure Germany, replace `AzureCloud` with `AzureGermanCloud`.
1. Log in:
```
az login
```
Authenticate by navigating to the URL in the output, entering the provided code, and clicking your account.
1. Ensure that the following environment variables are set to the names of the resources you created when deploying <%= vars.ops_manager %> as part of the procedures in [Deploying <%= vars.ops_manager %> on Azure Manually](/platform/ops-manager/<%= vars.current_major_version.sub('.', '-') %>/azure/deploy-manual.html):
* `$RESOURCE_GROUP`: This should be set to the name of your resource group. To list the resource groups for your subscription, run:
```
az group list
```
* `$LOCATION`: This should be set to your location, such as `westus`. To view a list of available locations, run:
```
az account list-locations
```
* `$STORAGE_NAME`: This should be set to your BOSH storage account name. To list your storage accounts, run:
```
az storage account list
```
1. Retrieve the connection string for the account by running:
```
az storage account show-connection-string \
--name $STORAGE_NAME --resource-group $RESOURCE_GROUP
```
The command returns output similar to the following:
<pre class="terminal">
{
"connectionString": "DefaultEndpointsProtocol=https;EndpointSuffix=core.windows.net;AccountName=cfdocsboshstorage;AccountKey=EXAMPLEaaaaaaaaaleiIy/Lprnc5igFxYWsgq016Tu9uGwseOl8bqNBEL/2tp7wX92QMUM19Pz9BYTXt8aq4A=="
}
</pre>
1. From the `data:` field in the output above, record the full value of `connectionString` from the output above, starting with and including `DefaultEndpointsProtocol=`.
1. Export the value of `connectionString` as the environment variable `$AZURE_STORAGE_CONNECTION_STRING` by running:
```
export AZURE_STORAGE_CONNECTION_STRING="ACCOUNT-KEY-STRING"
```
Where `ACCOUNT-KEY-STRING` is the value of `connectionString`.
## <a id='setup'></a> Copy the <%= vars.ops_manager %> Image
Copy the <%= vars.ops_manager %> image into your storage account. You use the <%= vars.ops_manager %> image to create the VM that hosts that the new version of <%= vars.ops_manager %>.
To copy the <%= vars.ops_manager %> image into your storage account:
1. Navigate to the [<%= vars.ops_manager %>](https://network.pivotal.io/products/ops-manager) page on VMware Tanzu Network and download the release of **<%= vars.ops_manager %> for Azure** to which you want to upgrade.
1. View the downloaded PDF and locate the <%= vars.ops_manager %> image URL appropriate for your region.
1. Export the <%= vars.ops_manager %> image URL as an environment variable by running:
```
export OPS_MAN_IMAGE_URL="OPS-MANAGER-IMAGE-URL"
```
Where `OPS-MANAGER-IMAGE-URL` is the URL of your <%= vars.ops_manager %> image.
<br>
<br>
This command overrides the old <%= vars.ops_manager %> image URL with the new <%= vars.ops_manager %> image URL.
1. Copy the <%= vars.ops_manager %> image into your storage account. For compatibility when upgrading to future versions of <%= vars.ops_manager %>, choose a unique name for the image that includes the <%= vars.ops_manager %> version number. For example, replace `opsman-image-version` in the following examples with `opsman-image-2.0.1`. Run:
```
az storage blob copy start --source-uri $OPS_MAN_IMAGE_URL \
--connection-string $AZURE_STORAGE_CONNECTION_STRING \
--destination-container opsmanager \
--destination-blob opsman-image-version.vhd
```
1. Copying the image may take several minutes. Run:
```
az storage blob show --name opsman-image-version.vhd \
--container-name opsmanager \
--account-name $STORAGE_NAME
```
Examine the output under `"copy"`, as in the example below:
<pre class="terminal">
"copy": {
"completionTime": "2017-06-26T22:24:11+00:00",
"id": "b9c8b272-a562-4574-baa6-f1a04afcefdf",
"progress": "53687091712/53687091712",
"source": "https<span>:</span>//opsmanagerwestus.blob.core.windows.net/images/ops-manager-2.0.x.vhd",
"status": "success",
"statusDescription": null
},
</pre>
When `status` reads `success`, continue to the next step.
## <a id='config-ip'></a> Configure <%= vars.ops_manager %> IP Address
Remove the old <%= vars.ops_manager %> VM and record the IP address for the <%= vars.ops_manager %> network interface. You use this IP address when creating the new <%= vars.ops_manager %> VM that hosts the upgraded version of <%= vars.ops_manager %>.
To configure the <%= vars.ops_manager %> IP address, follow one of these procedures:
* [Reuse Existing Dynamic Public IP Address](#reuse-dynamic)
* [Use a New Dynamic Public IP Address](#new-ip)
### <a id='reuse-dynamic'></a> Reuse Existing Dynamic Public IP Address
To reuse an existing dynamic public IP address:
1. List your VMs and record the name of your <%= vars.ops_manager %> VM by running:
```
az vm list
```
1. Delete your old <%= vars.ops_manager %> VM by running:
```
az vm delete --name OPS-MANAGER-VM --resource-group $RESOURCE_GROUP
```
Where `OPS-MANAGER-VM` is your old <%= vars.ops_manager %> VM.
1. List your network interfaces and record the name of the <%= vars.ops_manager %> network interface. Run:
```
az resource list --resource-group $RESOURCE_GROUP \
--resource-type Microsoft.Network/networkInterfaces
```
### <a id='new-ip'></a> Use a New Dynamic Public IP Address
To use a new dynamic public IP address:
1. Create a new public IP address named `ops-manager-ip-new` by running:
```
az network public-ip create --name ops-manager-ip-new \
--resource-group $RESOURCE_GROUP --location $LOCATION \
--allocation-method Static
{
"publicIp": {
"dnsSettings": null,
"etag": "W/\"4450ebe2-9e97-4b17-9cf2-44838339c661\"",
"id": "/subscriptions/995b7eed-77ef-45ff-a5c9-1a405ffb8243/resourceGroups/cf-docs/providers/Microsoft.Network/publicIPAddresses/ops-manager-ip-new",
"idleTimeoutInMinutes": 4,
"ipAddress": "40.83.148.183",
"ipConfiguration": null,
"location": "westus",
"name": "ops-manager-ip-new",
"provisioningState": "Succeeded",
"publicIpAddressVersion": "IPv4",
"publicIpAllocationMethod": "Static",
"resourceGroup": "cf-docs",
"resourceGuid": "950d4831-1bec-42da-8a79-959bcddea9dd",
"tags": null,
"type": "Microsoft.Network/publicIPAddresses"
}
}
```
1. Record the value for `ipAddress` from the output above. This is the public IP address of <%= vars.ops_manager %>.
1. Create a network interface for <%= vars.ops_manager %> by running:
```
az network nic create --vnet-name <%= vars.product_name_lc %>-net \
--subnet <%= vars.product_name_lc %> --network-security-group opsmgr-nsg \
--private-ip-address 10.0.0.5 \
--public-ip-address ops-manager-ip-new \
--resource-group $RESOURCE_GROUP \
--name ops-manager-nic-new --location $LOCATION
```
1. Shut down your old <%= vars.ops_manager %> VM, if it still exists. Run:
```
az vm deallocate --name ops-manager --resource-group $RESOURCE_GROUP
```
If your <%= vars.ops_manager %> VM is not named `ops-manager`, provide the correct name. To list all VMs in your account, run:
```
az vm list
```
1. Update your DNS record to point to your new public IP address of <%= vars.ops_manager %>.
## <a id='boot'></a> Create <%= vars.ops_manager %> VM Instance
Create an <%= vars.ops_manager %> VM instance to host the new version of <%= vars.ops_manager %>.
To create an <%= vars.ops_manager %> VM instance:
1. To use the key pair from your previous <%= vars.ops_manager %>, locate the path to the file on your local machine. To create a new key pair, enter:
```
ssh-keygen -t rsa -f opsman -C ubuntu
```
When prompted for a passphrase, press the `Enter` key to provide an empty passphrase.
1. Create the <%= vars.ops_manager %> VM.
* If you are using unmanaged disks, create your <%= vars.ops_manager %> VM by running:
```
az vm create --name OPS-MANAGER-VERSION --resource-group $RESOURCE_GROUP \
--location $LOCATION \
--nics opsman-nic \
--image https://$STORAGE_NAME.AZURE-INSTANCE-URL.com/opsmanager/OPS-MANAGER-IMAGE-VERSION.vhd \
--os-disk-name OPS-MANAGER-VERSION-osdisk \
--os-disk-size-gb 128 \
--os-type Linux \
--use-unmanaged-disk \
--storage-account $STORAGENAME \
--storage-container-name opsmanager \
--admin-username ubuntu \
--ssh-key-value PATH-TO-PUBLIC-KEY
```
Where:
* `OPS-MANAGER-VERSION` is the version of <%= vars.ops_manager %> you are deploying. For example, `opsman-2.0.1`.
* `AZURE-INSTANCE-URL.com` is the URL of your Azure instance. Find the complete source URL in the Azure UI by viewing the **Blob properties** of the <%= vars.ops_manager %> image you created earlier in this procedure.
* `OPS-MANAGER-IMAGE-VERSION` is the image version of <%= vars.ops_manager %> you are deploying. For example, `opsman-image-2.0.1`.
* `PATH-TO-PUBLIC-KEY` is the path to your public key .pub file.
* If you are using Azure managed disks:
1. Create a managed image from the <%= vars.ops_manager %> VHD file by running:
```
az image create --resource-group $RESOURCE_GROUP \
--name OPS-MANAGER-VERSION \
--source https://$STORAGE_NAME.blob.core.windows.net/opsmanager/OPS-MANAGER-VERSION.vhd \
--location $LOCATION \
--os-type Linux
```
Where `OPS-MANAGER-VERSION` is the version of <%= vars.ops_manager %> you are deploying.
<br>
If you are using Azure China, Azure Government Cloud, or Azure Germany, replace `blob.core.windows.net` with the following:
* For Azure China, use `blob.core.chinacloudapi.cn`. For more information, see [Azure China developer guide](https://docs.microsoft.com/en-us/azure/china/china-get-started-developer-guide) in the Microsoft Azure documentation.
* For Azure Government Cloud, use `blob.core.usgovcloudapi.net`. For more information, see [Azure Government storage](https://docs.microsoft.com/en-us/azure/azure-government/documentation-government-services-storage) in the Microsoft Azure documentation.
* For Azure Germany, use `blob.core.cloudapi.de`. For more information, see [Azure Germany developer guide](https://docs.microsoft.com/en-us/azure/germany/germany-developer-guide) in the Microsoft Azure documentation.
1. Create your <%= vars.ops_manager %> VM by running: replacing `PATH-TO-PUBLIC-KEY` with the path to your public key `.pub` file, and replacing `opsman-version` and `opsman-image-version` with the version of <%= vars.ops_manager %> you are deploying, for example `opsman-2.0.1`, `opsman-2.0.1-osdisk`, and `opsman-image-2.0.1`.
```
az vm create --name opsman-version --resource-group $RESOURCE_GROUP \
--location $LOCATION \
--nics opsman-nic \
--image OPS-MANAGER-IMAGE-VERSION \
--os-disk-name OPS-MANAGER-VERSION-osdisk \
--admin-username ubuntu \
--size Standard_DS2_v2 \
--storage-sku Standard_LRS \
--ssh-key-value PATH-TO-PUBLIC-KEY
```
Where:
* `OPS-MANAGER-IMAGE-VERSION` is the image version of <%= vars.ops_manager %> you are deploying. For example, `opsman-image-2.0.1`.
* `OPS-MANAGER-VERSION` is the version of <%= vars.ops_manager %> you are deploying. For example, `opsman-2.0.1`.
* `PATH-TO-PUBLIC-KEY` is the path to your public key .pub file.
1. If you have deployed more than one tile in this <%= vars.ops_manager %> installation, increase the size of the <%= vars.ops_manager %> VM disk. You can repeat this process and increase the disk again at a later time if necessary.
<p class="note"><strong>Note:</strong> If you use Azure Stack, you must increase the <%= vars.ops_manager %> VM disk size using the Azure Stack UI.</p>
1. Stop the VM and detach the disk by running:
```
az vm deallocate --name OPS-MANAGER-VERSION \
--resource-group $RESOURCE_GROUP
```
Where `OPS-MANAGER-VERSION` is the version of <%= vars.ops_manager %> you are deploying. For example, `opsman-2.0.1`.
1. Resize the disk to 128 GB by running:
```
az disk update --size-gb 128 --name OPS-MANAGER-VERSION-osdisk \
--resource-group $RESOURCE_GROUP
```
Where `OPS-MANAGER-VERSION` is the version of <%= vars.ops_manager %> you are deploying. For example, `opsman-2.0.1`.
1. Start the VM by running:
```
az vm start --name OPS-MANAGER-VERSION --resource-group $RESOURCE_GROUP
```
Where `OPS-MANAGER-VERSION` is the version of <%= vars.ops_manager %> you are deploying. For example, `opsman-2.0.1`.
## <a id='next'></a> Next Steps
After you complete this procedure, continue to the upgrade instructions in [Upgrading <%= vars.platform_name %>](upgrading-pcf.html).