Configuring Cloud Foundry for BOSH Backup and Restore (Experimental)

This topic describes the configuration you need for your Cloud Foundry 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.

WARNING: The enable-backup-restore.yml, enable-backup-restore-s3.yml, enable-nfs-broker-backup.yml, and enable-backup-restore-credhub.yml ops files are currently experimental and should be used with caution.

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.

  • 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 reprovisioning. 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

Unless otherwise stated, the described functionality is available in cf-deployment v1.3.0 and later.

Your CF deployment is compatible with BBR if the following requirements are met:

  • An enable-backup-restore.yml ops file is deployed.
  • An internal MySQL database or a supported external database is present.
  • An internal WebDAV/NFS blobstore is present.
  • No optional components, such as a runtime CredHub store or an NFS volume service, are deployed.

If your CF deployment does not fit the above requirements, then you might be able to use BBR by applying additional ops files as described in the table below and by using a later version of cf-deployment.

To use BBR with… Use this ops file… And…
An external blobstore hosted on Amazon S3 or a compatible storage solution that supports S3 versioning and AWS Signature Version 4
enable-backup-restore-s3.yml cf-deployment v1.4.0 or later.
For instructions, see Backup and Restore with External Blobstores.
An NFS volume service component
enable-nfs-broker-backup.yml n/a
CredHub data store component
enable-backup-restore-credhub.yml n/a

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

Apply Ops Files in the Correct Order

Select the ops files you need and apply them in the following order:

Note: This is the relative order. You do not have to apply all ops files listed below and you can apply other ops files in between.
For example, you can apply an ops file between use-external-dbs.yml and enable-backup-restore.yml, but do not apply enable-backup-restore.yml before use-external-dbs.yml.

  1. use-s3-blobstore.yml

  2. use-external-dbs.yml

  3. enable-backup-restore.yml

  4. enable-backup-restore-s3.yml

  5. enable-nfs-broker-backup.yml

  6. enable-backup-restore-credhub.yml

Next Steps

After Cloud Foundry is configured to be compatible with BBR, it can be backed up and restored.

Follow the procedures in Back Up a BOSH Deployment and Restore a BOSH Deployment.

At minimum, run the pre-backup check against your Cloud Foundry deployment. Follow the first two steps of Back Up a BOSH Deployment. This lists the scripts that run during a backup and the order that they are applied in.

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