From 05c1dce2e3bc5714d0b119b2c0fee100086cf13b Mon Sep 17 00:00:00 2001 From: Thomas Mitchell Date: Thu, 29 Apr 2021 14:51:33 -0400 Subject: [PATCH] persistent disk work and release notes --- MANUAL.md | 3 +- ci/release_notes.md | 38 +++++++++++++++++-- hooks/blueprint | 1 + overlay/db-persistent-disk.yml | 3 ++ .../templates/app-autoscaler-deployment.yml | 1 - 5 files changed, 40 insertions(+), 6 deletions(-) create mode 100644 overlay/db-persistent-disk.yml diff --git a/MANUAL.md b/MANUAL.md index 3bf6593..5f980ce 100644 --- a/MANUAL.md +++ b/MANUAL.md @@ -54,8 +54,9 @@ The following values can be specified in your environment file, under `params:` | `cf_deployment_env` | specify the name of the cf deployment environment | the cf-app-autoscaler environment name | | `cf_deployment_type` | override the type of deployment used for the CF deployment | `cf` | | `cf_core_network` | name of the core CF network. | provided by Exodus data from your CF Genesis kit deployment | -| `cf_system_domain` | thhe system domain for your CF deployment. | provided by Exodus data from your CF Genesis kit deployment | +| `cf_system_domain` | the system domain for your CF deployment. | provided by Exodus data from your CF Genesis kit deployment | | `skip_ssl_validation` | set to false to force ssl validation | true | +| `db_disk_type` | the name of the persistent disk type to use for the local postgres VM. | `10GB` ## Features diff --git a/ci/release_notes.md b/ci/release_notes.md index 40c5f27..2161584 100644 --- a/ci/release_notes.md +++ b/ci/release_notes.md @@ -1,5 +1,35 @@ -# Official Release v1.0.0 +# Attention Required -Replaces `app-autoscaler` feature in the v1.x cf genesis kits (and removed -from v2.x kits). See MANUAL.md for usage details, including how to upgrade -from embedded version in the v1.x cf kit. +* The 1.0.0 version of the kit was released without allocating the local +postgres database node a persistent disk. If you are not using an external +database, this can easily lead to loss of autoscaler service data. This is +fixed in this version of the kit - please follow the following instructions +to avoid data loss. Do not panic. Everything is going to be okay. + +## Taking a Backup of the Existing Database + +Make sure you take this backup before upgrading the kit! + +* `bosh ssh` onto the `postgres_autoscaler` of the deployment. +* become root with `sudo -i` +* Run the following to take a backup `/var/vcap/packages/postgres-9.6.6/bin/pg_dumpall -U vcap >/tmp/pg_dump.sql` +* Fetch the backup from the VM by exiting the VM and running `bosh -e -d scp postgres_autoscaler:/tmp/pg_dump.sql ~/autoscaler_pg_dump.sql` + +## Upgrade the Kit + +* Bump the kit number in your environment file to this version and deploy it with `genesis deploy ` + +## Restore the Database + +Now you have a fresh, empty database. Let's put the data back. + +* Upload the backup you took to the VM with `bosh -e -d scp ~/autoscaler_pg_dump.sql postgres_autoscaler:/tmp/` +* SSH onto the `postgres_autoscaler` VM with `bosh ssh` +* Become root with `sudo -i` +* Perform the restore with `/var/vcap/packages/postgres-9.6.6/bin/psql -U vcap postgres