Upgrading BOSH Director on Azure
Page last updated:
This topic describes how to upgrade BOSH Director for Pivotal Platform on Azure.
Complete the tasks in this topic as part of the Pivotal Operations Manager upgrade process. For more information, see Upgrading Pivotal Platform.
Overview
In this procedure, you create an Ops Manager VM instance to host the upgraded version of Ops Manager. Then, to complete the Ops Manager upgrade, you export your existing Ops Manager installation onto this new VM.
Note: 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.
To create an Ops Manager VM instance, do the following:
Export environment variables. See Export Environment Variables.
Copy the Ops Manager image into your storage account. See Copy the Ops Manager Image.
Configure the Ops Manager IP Address. See Configure Ops Manager IP Address.
Create Ops Manager VM instance. See Create Ops Manager VM Instance.
Prerequisites
To complete the Ops Manager upgrade, you must have your Ops Manager decryption passphrase. You defined this decryption passphrase during the initial installation of Ops Manager.
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 Ops Manager image in the following procedure.
To export environment variables, do the following:
Install the Azure CLI v2.0 by following the instructions for your operating system in the Azure documentation.
Set your cloud:
$ az cloud set --name AzureCloud
If you deployed Pivotal Platform in an environment other than Azure Cloud, consult the following list:- For Azure China, replace
AzureCloud
withAzureChinaCloud
. If logging in toAzureChinaCloud
fails with aCERT_UNTRUSTED
error, use the latest version of node, 4.x or later. - For Azure Government Cloud, replace
AzureCloud
withAzureUSGovernment
. - For Azure Germany, replace
AzureCloud
withAzureGermanCloud
.
- For Azure China, replace
Log in:
$ az login
Authenticate by navigating to the URL in the output, entering the provided code, and clicking your account.Ensure that the following environment variables are set to the names of the resources you created when deploying Ops Manager as part of the procedures in Deploying Ops Manager on Azure Manually.
$RESOURCE_GROUP
: This should be set to the name of your resource group. Runaz group list
to list the resource groups for your subscription.$LOCATION
: This should be set to your location, such aswestus
. For a list of available locations, runaz account list-locations
.$STORAGE_NAME
: This should be set to your BOSH storage account name. Runaz storage account list
to list your storage accounts.
Retrieve the connection string for the account.
$ az storage account show-connection-string \ --name $STORAGE_NAME --resource-group $RESOURCE_GROUP
The command returns output similar to the following:{ "connectionString": "DefaultEndpointsProtocol=https;EndpointSuffix=core.windows.net;AccountName=cfdocsboshstorage;AccountKey=EXAMPLEaaaaaaaaaleiIy/Lprnc5igFxYWsgq016Tu9uGwseOl8bqNBEL/2tp7wX92QMUM19Pz9BYTXt8aq4A==" }
From the
data:
field in the output above, record the full value ofconnectionString
from the output above, starting with and includingDefaultEndpointsProtocol=
.Export the value of
connectionString
as the environment variable$AZURE_STORAGE_CONNECTION_STRING
.$ export AZURE_STORAGE_CONNECTION_STRING="YOUR-ACCOUNT-KEY-STRING"
Copy the Ops Manager Image
Copy the Ops Manager image into your storage account. You use the Ops Manager image to create the VM that hosts that the new version of Ops Manager.
To copy the Ops Manager image into your storage account, do the following:
Navigate to Pivotal Network and download the release of Pivotal Ops Manager for Azure you want to upgrade to.
View the downloaded PDF and locate the Ops Manager image URL appropriate for your region.
Export the Ops Manager image URL as an environment variable.
$ export OPS_MAN_IMAGE_URL="YOUR-OPS-MAN-IMAGE-URL"
This command overrides the old Ops Manager image URL with the new Ops Manager image URL.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
opsman-image-version
in the following examples withopsman-image-2.0.1
.$ 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
Copying the image may take several minutes. Run the following command and examine the output under
"copy"
:$ 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": "https://opsmanagerwestus.blob.core.windows.net/images/ops-manager-2.0.x.vhd", "status": "success", "statusDescription": null },
Whenstatus
readssuccess
, continue to the next step.
Configure Ops Manager IP Address
Remove the old Ops Manager VM and record the IP address for the Ops Manager network interface. You use this IP address when creating the new Ops Manager VM that hosts the upgraded version of Ops Manager.
To configure the Ops Manager IP address, do one of the following:
Reuse Existing Dynamic Public IP Address
To reuse an existing dynamic public IP address, do the following:
List your VMs and record the name of your Ops Manager VM:
$ az vm list
Delete your old Ops Manager VM:
$ az vm delete --name YOUR-OPS-MAN-VM --resource-group $RESOURCE_GROUP
List your network interfaces and record the name of the Ops Manager network interface:
$ az resource list --resource-group $RESOURCE_GROUP \ --resource-type Microsoft.Network/networkInterfaces
Use a New Dynamic Public IP Address
To use a new dynamic public IP address, do the following:
Create a new public IP address named
ops-manager-ip-new
.$ 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" } }
Record the value for
ipAddress
from the output above. This is the public IP address of Ops Manager.Create a network interface for Ops Manager.
$ 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
Shut down your old Ops Manager VM, if it still exists:
$ az vm deallocate --name ops-manager --resource-group $RESOURCE_GROUP
If your Ops Manager VM is not namedops-manager
, provide the correct name. To list all VMs in your account, useaz vm list
.Update your DNS record to point to your new public IP address of Ops Manager.
Create Ops Manager VM Instance
Create an Ops Manager VM instance to host the new version of Ops Manager.
To create an Ops Manager VM instance, do the following:
To use the key pair from your previous Ops Manager, locate the path to the file on your local machine. To create a new key pair, enter the following command:
$ ssh-keygen -t rsa -f opsman -C ubuntu
When prompted for a passphrase, press theenter
key to provide an empty passphrase.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 replacingopsman-image-version
with the version of Ops Manager you are deploying, for exampleopsman-image-2.0.1
:$ 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
Replacemy-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. - 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 exampleopsman-image-2.0.1
.:- Create a managed image from the Ops Manager VHD file:
$ 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
If you are using Azure China, Azure Government Cloud, or Azure Germany, replaceblob.core.windows.net
with the following:- For Azure China, use
blob.core.chinacloudapi.cn
. For more information, see the Azure documentation. - For Azure Government Cloud, use
blob.core.usgovcloudapi.net
. For more information, see the Azure documentation. - For Azure Germany, use
blob.core.cloudapi.de
. For more information, see the Azure documentation.
- For Azure China, use
- Create your Ops Manager VM, replacing
PATH-TO-PUBLIC-KEY
with the path to your public key.pub
file, and replacingopsman-version
andopsman-image-version
with the version of Ops Manager you are deploying, for exampleopsman-2.0.1
,opsman-2.0.1-osdisk
, andopsman-image-2.0.1
.$ 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
- Create a managed image from the Ops Manager VHD file:
- If you are using unmanaged disks, run the following command to create your Ops Manager VM, replacing
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.
Note: If you use Azure Stack, you must increase the Ops Manager VM disk size using the Azure Stack UI.
- 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 exampleopsman-2.0.1
:$ az vm deallocate --name opsman-version \ --resource-group $RESOURCE_GROUP
- Run the following command to resize the disk to 128 GB, replacing
opsman-version
with the version of Ops Manager you are deploying, for exampleopsman-2.0.1
:$ az disk update --size-gb 128 --name opsman-version-osdisk \ --resource-group $RESOURCE_GROUP
- Run the following command to start the VM, replacing
opsman-version
with the version of Ops Manager you are deploying, for exampleopsman-2.0.1
:$ az vm start --name opsman-version --resource-group $RESOURCE_GROUP
- Run the following command to stop the VM and detach the disk, replacing
Next Steps
After you complete this procedure, continue the upgrade instructions in Upgrading Pivotal Platform.