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 are using 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 applications 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 as shown in this table:

Configuration Configuration Ops File Backup and Restore Ops File
A versioned S3-compatible external blobstore. For instructions, see Backup and Restore with External Blobstores. use-s3-blobstore.yml enable-backup-restore-s3-versioned.yml
An un-versioned S3-compatible external blobstore. For instructions, see Backup and Restore with External Blobstores. use-s3-blobstore.yml enable-backup-restore-s3-unversioned.yml
An Azure blobstore with soft delete enabled. For instructions, see Backup and Restore with External Blobstores. use-azure-blobstore.yml enable-backup-restore-azure.yml
A GCS external blobstore. For instructions, see Backup and Restore with External Blobstores. use-gcs-blobstore.yml enable-backup-restore-gcs.yml
A supported external database use-external-dbs.yml No BBR ops file required
An NFS broker and volume driver for volume support enable-nfs-volume-service.yml enable-backup-restore-nfs-broker.yml

BBR can communicate with external blobstores and databases over TLS if they are configured accordingly.

Supported External Databases

Cloud Foundry components use the backup and restore SDK to interface with databases for backup and restore. The backup and restore SDK supports the following database versions:

Name Version
MariaDB 10.1.x
MySQL 5.5.x
MySQL 5.6.x
MySQL 5.7.x
Postgres 9.4.x
Postgres 9.6.x

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. If you configure an external blobstore, you can choose to omit 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, applications 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 applications 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 applications 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