forked from pivotal-cf/docs-pcf-install
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-om-upgrade.html.md.erb
232 lines (193 loc) · 12.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
---
title: Upgrading BOSH Director on Azure
owner: Ops Manager
---
<strong><%= modified_date %></strong>
This topic describes how to upgrade BOSH Director for Pivotal Cloud Foundry (PCF) on Azure.
Follow the procedures below as part of the upgrade process documented in the [Upgrading Pivotal Cloud Foundry](upgrading-pcf.html) topic.
<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>
## <a id='env-vars'></a> Step 1: Export Environment Variables
1. Install the Azure CLI v2.0 by following the instructions for your operating system in the [Azure documentation](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli).
1. Set your cloud:
<pre class="terminal">
$ az cloud set --name AzureCloud
</pre>
If you deployed PCF in an environment other than Azure Cloud, consult the following list:
* For Azure China, replace <code>AzureCloud</code> with <code>AzureChinaCloud</code>. If logging in to <code>AzureChinaCloud</code> fails with a <code>CERT_UNTRUSTED</code> <a href="https://github.com/Azure/azure-xplat-cli/issues/2725">error</a>, use the latest version of node, 4.x or later.
* For [Azure Government Cloud](../om/azure/gov-cloud.html), replace `AzureCloud` with `AzureUSGovernment`.
* For [Azure Germany](../om/azure/german-cloud.html), replace `AzureCloud` with `AzureGermanCloud`.
1. Log in:
<pre class="terminal">
$ az login
</pre>
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 that you
created when originally deploying Ops Manager by following the procedures in
[Deploying Ops Manager on Azure Manually](../om/azure/deploy-manual.html).
* `$RESOURCE_GROUP`: This should be set to the name of your resource group. Run `az group list` to list the resource groups for your subscription.
* `$LOCATION`: This should be set to your location, such as `westus`. For a list of available locations, run `az account list-locations`.
* `$STORAGE_NAME`: This should be set to your BOSH storage account name. Run `az storage account list` to list your storage accounts.
1. Retrieve the connection string for the account.
<pre class="terminal">
$ az storage account show-connection-string \
--name $STORAGE_NAME --resource-group $RESOURCE_GROUP
</pre>
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`.
<pre class="terminal">
$ export AZURE_STORAGE_CONNECTION_STRING="YOUR-ACCOUNT-KEY-STRING"
</pre>
## <a id='setup'></a> Step 2: Set Up Ops Manager
1. Navigate to [Pivotal Network](https://network.pivotal.io/products/ops-manager) and download the release of **Pivotal Cloud Foundry Ops Manager for Azure** you want to upgrade to.
1. View the downloaded PDF and locate the Ops Manager image URL appropriate for your region.
1. Export the Ops Manager image URL as an environment variable.
<pre class="terminal">$ export OPS_MAN_IMAGE_URL="YOUR-OPS-MAN-IMAGE-URL"</pre>
This command overrides the old Ops Manager image URL with the new Ops Manager image URL.
1. Copy the Ops Manager image into your storage account. For compatibility when upgrading to future versions of Ops Manager, choose a unique name for the image that includes the Ops Manager version number. For example, replace <code>opsman-image-version</code> in the following examples with <code>opsman-image-2.0.1</code>.
<pre class="terminal">
$ 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
</pre>
1. Copying the image may take several minutes. Run the following command and examine the output under `"copy"`:
<pre class="terminal">
$ az storage blob show --name opsman-image-version.vhd \
--container-name opsmanager \
--account-name $STORAGE_NAME
...
"copy": {
"completionTime": "2017-06-26T22:24:11+00:00",
"id": "b9c8b272-a562-4574-baa6-f1a04afcefdf",
"progress": "53687091712/53687091712",
"source": "http<span>s:/</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> Step 3: Configure IP Address
You have two choices for the Ops Manager IP address. Choose one of the following:
* [Reuse the 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
1. List your VMs and record the name of your Ops Manager VM:
<pre class="terminal">$ az vm list</pre>
1. Delete your old Ops Manager VM:
<pre class="terminal">$ az vm delete --name YOUR-OPS-MAN-VM --resource-group $RESOURCE_GROUP</pre>
1. List your network interfaces and record the name of the Ops Manager network interface:
<pre class="terminal">$ az resource list --resource-group $RESOURCE_GROUP \
--resource-type Microsoft.Network/networkInterfaces</pre>
### <a id='new-ip'></a> Use a New Dynamic Public IP Address
1. Create a new public IP address named `ops-manager-ip-new`.
<pre class="terminal">
$ 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"
}
}
</pre>
1. Record the value for `ipAddress` from the output above. This is the public IP address of Ops Manager.
1. Create a network interface for Ops Manager.
<pre class="terminal">
$ az network nic create --vnet-name pcf-net \
--subnet pcf --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
</pre>
1. Shut down your old Ops Manager VM, if it still exists:
<pre class="terminal">
$ az vm deallocate --name ops-manager --resource-group $RESOURCE_GROUP
</pre>
If your Ops Manager VM is not named `ops-manager`, provide the correct name. To list all VMs in your account, use `az vm list`.
1. Update your DNS record to point to your new public IP address of Ops Manager.
## <a id='boot'></a> Step 4: Boot Ops Manager
1. If you want to use the key pair from your previous Ops Manager, locate the path to the file on your local machine. If you want to create a new key pair, enter the following command:
<pre class="terminal">
$ ssh-keygen -t rsa -f opsman -C ubuntu
</pre>
<br>
When prompted for a passphrase, press the `enter` key to provide an empty passphrase.
1. Create the Ops Manager VM.
* If you are using unmanaged disks, run the following command to create your Ops Manager VM, replacing `PATH-TO-PUBLIC-KEY` with the path to your public key .pub file, and replacing `opsman-image-version` with the version of Ops Manager you are deploying, for example `opsman-image-2.0.1`:
<pre class="terminal">
$ az vm create --name opsman-version --resource-group $RESOURCE_GROUP \
--location $LOCATION \
--nics opsman-nic \
--image https://$STORAGE_NAME.my-azure-instance.com/opsmanager/opsman-image-version.vhd \
--os-disk-name opsman-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
</pre>
Replace `my-azure-instance.com` with the URL of your Azure instance. Find the complete source URL in the Azure UI by viewing the **Blob properties** of the Ops Manager image you created earlier in this procedure.<br><br>
* If you are using Azure managed disks, perform the following steps, replacing `opsman-image-version` with the version of Ops Manager you are deploying, for example `opsman-image-2.0.1`.:
1. Create a managed image from the Ops Manager VHD file:
<pre class="terminal">
$ az image create --resource-group $RESOURCE\_GROUP \
--name opsman-image-version \
--source https://$STORAGE\_NAME.blob.core.windows.net/opsmanager/opsman-image-version.vhd \
--location $LOCATION \
--os-type Linux
</pre>
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`. See the [Azure documentation](https://docs.microsoft.com/en-us/azure/china/china-get-started-developer-guide) for more information.
* For Azure Government Cloud, use `blob.core.usgovcloudapi.net`. See the [Azure documentation](https://docs.microsoft.com/en-us/azure/azure-government/documentation-government-services-storage) for more information.
* For Azure Germany, use `blob.core.cloudapi.de`. See the [Azure documentation](https://docs.microsoft.com/en-us/azure/germany/germany-developer-guide) for more information.
1. Create your Ops Manager VM, 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 Ops Manager you are deploying, for example `opsman-2.0.1`, `opsman-2.0.1-osdisk`, and `opsman-image-2.0.1`.
<pre class="terminal">
$ az vm create --name opsman-version --resource-group $RESOURCE\_GROUP \
--location $LOCATION \
--nics opsman-nic \
--image opsman-image-version \
--os-disk-name opsman-version-osdisk \
--admin-username ubuntu \
--size Standard\_DS2_v2 \
--storage-sku Standard\_LRS \
--ssh-key-value PATH-TO-PUBLIC-KEY
</pre>
1. If you have deployed more than one tile in this Ops Manager installation, perform the following steps to increase the size of the 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 Ops Manager VM disk size using the Azure Stack UI.</p>
1. Run the following command to stop the VM and detach the disk, replacing `opsman-version` with the version of Ops Manager you are deploying, for example `opsman-2.0.1`:
<pre class="terminal">
$ az vm deallocate --name opsman-version \
--resource-group $RESOURCE\_GROUP
</pre>
1. Run the following command to resize the disk to 128 GB, replacing `opsman-version` with the version of Ops Manager you are deploying, for example `opsman-2.0.1`:
<pre class="terminal">
$ az disk update --size-gb 128 --name opsman-version-osdisk \
--resource-group $RESOURCE\_GROUP
</pre>
1. Run the following command to start the VM, replacing `opsman-version` with the version of Ops Manager you are deploying, for example `opsman-2.0.1`:
<pre class="terminal">
$ az vm start --name opsman-version --resource-group $RESOURCE\_GROUP
</pre>