Configuring Cloud Foundry for BOSH Backup and Restore

This topic describes the configuration you need for your Cloud Foundry (CF) deployment to work with BOSH Backup and Restore (BBR).

This topic assumes that you use cf-deployment with ops files for your Cloud Foundry deployment.

If you do not use ops files for customization, you can still customize your Cloud Foundry to use BBR. Examine the contents of the ops files on this page, and use them as a guide to customize your deployment manifest directly.

Warning:
  • Backup artifacts can contain secrets. Secure backup artifacts with encryption or by other means.
  • The restore is a destructive operation. BBR is designed to restore CF after a disaster. If it fails, the environment can be left in an unusable state and require re-provisioning. For the generic method of restoring a deployment, see Restoring with BOSH Backup and Restore.
  • Developers are unable to push apps for a few minutes during backup and restore. This is because the Cloud Controller API (CC API) stops sending and receiving calls between the pre-backup-lock and post-backup-unlock stages of the process.
  • BBR does not back up any service data. Back up Service data, such as Redis or RabbitMQ data, separately.

Supported CF Configurations

To enable backup and restore for your cf-deployment, deploy it with the enable-backup-restore.yml ops file. This enables BBR backup and restore for default CF components, including the internal blobstore.

When using the default configuration, all apps return to a running state after a restore.

To enable BBR backup and restore for different configurations, you must also use the appropriate backup and restore ops files. For information about the available backup and restore ops files, see the cf-deployment README file in GitHub.

Supported External Databases

Cloud Foundry components use the backup and restore SDK to interface with databases for backup and restore. For supported databases and versions, see backup-and-restore-sdk-release in GitHub.

Selective Backup and Restore Configurations for Blobstores

When configuring your blobstore, you can choose to use an external blobstore instead of the default internal blobstore. For more information about supported external blobstores, see Backup and Restore for External Blobstores.

When BBR backs up and restores your Cloud Foundry blobstore, it includes droplets, buildpacks, and packages by default. You can choose to omit specific blobstore content from your backup and restore using the following ops files:

Selective Backup Ops File Content Included in Backup
skip-backup-restore-droplets.yml Buildpacks, Packages
skip-backup-restore-droplets-and-packages.yml Buildpacks

Warning: Selective backups increase your overall recovery time. When you use selective backup ops files, apps require extra steps to return to a running state after a restore. For more information, see the Restoring Applications when Using Selective Backups section below.

Restoring Applications when Using Selective Backups

When using the skip-backup-restore-droplets.yml ops file, do the following to get your apps running after a restore:

  1. For each user-pushed application, run cf restage.
  2. For each application pushed using a BOSH errand, you can either run cf restage or re-run the BOSH errand.

When using the skip-backup-restore-droplets-and-packages.yml ops file, do the following to get your apps running after a restore:

  1. For each user-pushed application, run cf push.
  2. For each application pushed using a BOSH errand, re-run the BOSH errand.

Applying Ops Files in the Correct Order

When enabling backup and restore for a cf-deployment component, you must apply the component ops files first, then enable-backup-restore.yml, and then any additional backup and restore ops files required by the components. See the following sections for examples of applying ops files in the correct order.

External Database

To configure cf-deployment to use an external database with backup and restore enabled, apply the ops files in the following order:

  1. use-external-db.yml
  2. enable-backup-restore.yml

S3-Compatible Unversioned Blobstore with Selective Backup and Restore

To configure cf-deployment to use an S3-compatible unversioned blobstore with selective backup and restore enabled, apply the ops files in the following order:

  1. use-external-blobstore.yml
  2. use-s3-blobstore.yml
  3. enable-backup-restore.yml
  4. enable-backup-restore-s3-unversioned.yml
  5. skip-backup-and-restore-droplets-and-packages.yml

Note: You can apply other component ops files before the backup and restore ops files. For example, you can apply other component ops file between use-s3-blobstore.yml and enable-backup-restore.yml.

Next Steps

After you have configured Cloud Foundry to be compatible with BBR, you can back up and restore Cloud Foundry.

Follow the procedures in the Back up a BOSH Deployment section of Backing up with BOSH Backup and Restore and the Restore a BOSH Deployment section of Restoring with BOSH Backup and Restore.

At minimum, run the pre-backup check against your Cloud Foundry deployment by following the first two steps of the Back up a BOSH Deployment section of Backing up with BOSH Backup. This lists the scripts that run during a backup and the order in which they are applied.

View the source for this page in GitHub