Upgrading Ops Manager Director on Azure

Page last updated:

This topic describes how to upgrade Ops Manager 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 topic.

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.

Step 1: Export Environment Variables

  1. Install the Azure CLI 2.0 by following the instructions for your operating system in the Azure documentation.

  2. Set your cloud:

    $ az cloud set --name AzureCloud
    

    If you deployed PCF 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 the latest version of node, 4.x or later.
    • For Azure Government Cloud, replace AzureCloud with AzureUSGovernment.
    • For Azure Germany, replace AzureCloud with AzureGermanCloud.
  3. Log in:

    $ az login
    

    Authenticate by navigating to the URL in the output, entering the provided code, and clicking your account.

  4. Ensure that the following environment variables are set to the names of the resources you created when originally deploying Ops Manager by following the procedures in either the Launching an Ops Manager Director Instance with an ARM Template topic or the Launching an Ops Manager Director Instance on Azure without an ARM Template topic.

    • $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.
  5. 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=KwKQqVXgVcEVBZUY/leiIy/Lprnc5igFxYWsgq016Tu9uGwseOl8bqNBEL/2tp7wX92QMUM19Pz9BYTXt8aq4A=="
    }
    

  6. From the data: field in the output above, record the full value of connectionString from the output above, starting with and including DefaultEndpointsProtocol=.

  7. Export the value of connectionString as the environment variable $AZURE_STORAGE_CONNECTION_STRING.

    $ export AZURE_STORAGE_CONNECTION_STRING="YOUR-ACCOUNT-KEY-STRING"
    

Step 2: Set Up Ops Manager

  1. Navigate to Pivotal Network and download the release of Pivotal Cloud Foundry Ops Manager for Azure you want to upgrade to.

  2. View the downloaded PDF and locate the Ops Manager image URL appropriate for your region.

  3. 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.

  4. Copy the Ops Manager image into your storage account.

    $ az storage blob copy start --source-uri $OPS_MAN_IMAGE_URL \
    --connection-string $AZURE_STORAGE_CONNECTION_STRING \
    --destination-container opsmanager \
    --destination-blob image.vhd 
    

  5. Copying the image may take several minutes. Run the following command and examine the output under "copy":

    $ az storage blob show --name image.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-1.11.3.vhd",
      "status": "success",
      "statusDescription": null
    },
    
    When status reads success, continue to the next step.

Step 3: Configure IP Address

You have two choices for the Ops Manager IP address. Choose one of the following:

Reuse Existing Dynamic Public IP Address

  1. List your VMs and record the name of your Ops Manager VM:
    $ az vm list
  2. Delete your old Ops Manager VM:
    $ az vm delete --name YOUR-OPS-MAN-VM --resource-group $RESOURCE_GROUP
  3. 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

  1. 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"
      }
    }
    

  2. Record the value for ipAddress from the output above. This is the public IP address of Ops Manager.

  3. 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
    

  4. Shut down your old Ops Manager VM:

    $ az vm stop --name ops-manager --resource-group $RESOURCE_GROUP 
    
    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.

  5. Update your DNS record to point to your new public IP address of Ops Manager.

Step 4: Boot Ops Manager

  1. If you want to use the keypair from your previous Ops Manager, locate the path to the file on your local machine. If you want to create a new keypair, enter the following command:

    $ ssh-keygen -t rsa -f opsman -C ubuntu
    

    When prompted for a passphrase, press the enter key to provide an empty passphrase.

  2. Create a managed disk from the Ops Manager image:

    $ az disk create --resource-group $RESOURCE_GROUP \
    --name opsman-disk \
    --source https://$STORAGE_NAME.blob.core.windows.net/opsmanager/image.vhd \
    --location $LOCATION --size-gb 120
    

    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 for more information.
    • For Azure Government Cloud, use blob.core.usgovcloudapi.net. See the Azure documentation for more information.
    • For Azure Germany, use blob.core.cloudapi.de. See the Azure documentation for more information.
  3. Create your Ops Manager VM, replacing PATH-TO-PUBLIC-KEY with the path to your public key .pub file.

     $ az vm create --name ops-manager --resource-group $RESOURCE_GROUP \
     --location $LOCATION --os-type linux \
     --nics ops-manager-nic \
     --attach-os-disk opsman-disk \
     --admin-username ubuntu \
     --size Standard_DS2_v2 \
     --ssh-key-value PATH-TO-PUBLIC-KEY
    

Create a pull request or raise an issue on the source for this page in GitHub