Migrating PCF to a New Datastore in vSphere

This topic describes how to migrate your Pivotal Cloud Foundry (PCF) installation to a new vSphere datastore.


Both the new and existing vSphere datastores must reside in the same datacenter.

To avoid service disruption, Pivotal recommends that you configure your overall PCF deployment for high availability. In addition, check for configurations necessary to achieve high availability in each of your installed product tiles.

If your environment has any single points of failure, service may be disrupted as a result of the migration.

Before You Begin

This section describes the steps you should perform prior to the migration.

Step 1: Back Up Your Environment

Ensure that your PCF environment is fully backed up.

For more information about how to backup PCF, see Backing up Pivotal Cloud Foundry.

Step 2: Document Current Environment Settings

Document your current environment settings before proceeding with the datastore migration. Record which VMs are running and in which datastore they reside. If you experience any issues during or after the migration, you must have this information to restore your environment.

To obtain this information, perform the following steps:

  1. Run the bosh instances command.

    • If you use BOSH CLI v2+, run the following command, replacing MY-ENV with the alias you assigned to your BOSH Director:
      $ bosh -e MY-ENV instances --details > instances.txt
    • If you use the original version of the BOSH CLI, run the following command:
      $ bosh-old instances --details > instances.txt
  2. Save the resulting file instances.txt to a safe location.

  3. Note the datastore where each VM resides in vSphere.

Step 3: Check System Health

In Pivotal Application Service (PAS), check the Status tab and make sure there are no errors or reported issues.

Step 4: Check Installed Products Health

In each tile installed in your PCF deployment, check the Status tab and make sure there are no errors or reported issues.

Step 5: Check BOSH Director Status

  1. Check that there are no pending changes and that the status of all tiles is green.

  2. Make sure the last Installation Log does not contain any errors.

  3. Before proceeding with the migration, click Review Pending Changes and Apply Changes to make sure there are no errors in the Installation Log.

Procedure: Migrate PCF to a New Datastore

  1. In BOSH Director, navigate to the vCenter Config page.

  2. Update the Ephemeral Datastore Names and Persistent Datastore Names field to reflect the new datastore names, then click Save.

    Note: If you use the Datastore Clustering feature in vSphere, provide only the individual names of the datastores in the cluster. Do not provide the name of the cluster that contains them.

  3. Click Review Pending Changes, then Apply Changes.

  4. Confirm that the BOSH Director VM has persistent disk on the new datastore.

    1. Navigate to vCenter Resource Pools and select the Resource Pool that contains your PCF deployment VMs and new datastore.
    2. Click the Related Objects and Virtual Machines.
    3. Locate the Ops Manager VM and verify that the VM has an expected value in the Provisioned Space column. Vsphere web client
  5. In BOSH Director, navigate to the Director Config page, and select the Recreate all VMs option.

  6. Click Review Pending Changes, then Apply Changes.

After the Migration

When BOSH moves disks, it waits for up to 60 minutes for the operation to complete. If the operation does not complete in time, BOSH can enter a state where it claims that the disks are out of sync.

Fix Failed BOSH Deployment with Out-of-Sync Error

If your PCF deployment gets into this state, you can resolve the issue by performing the steps in the KB article How to recover from a failed bosh deployment when VMs are out of sync on vSphere.

Prevent Out-of-Sync Error

You can also prevent the out of sync BOSH error by increasing the CPI timeout to a larger value before performing the migration. Follow the instructions in the KB article How to Increase the Timeout on Bosh CPI Command Calls.