cloudfoundry-attic / bosh-init

bosh-init is a tool used to create and update the Director VM
Apache License 2.0
31 stars 33 forks source link

Feature Request: bosh blobstore/compiled_package_cache migration path #111

Closed kitsirota closed 7 years ago

kitsirota commented 7 years ago

We're in the process of migrating from local blobstores and compiled_package_caches to S3, however there does not appear to be a migration path at this point.

Here is the process we're following right now:

  1. Update bosh director manifest with S3 blobstore and compiled_package_cache
  2. Delete all deployments
  3. Delete all releases and stemcells
  4. Upload all releases and stemcells (this time things actually go to S3)
  5. Re-deploy all deployments

This is very time consuming and requires a lot of downtime. Ideally when a blobstore location changes, we should be able to sync the artifacts to the new location. At the very least, bosh upload release --fix should upload the release to the new location and replace the location of the artifact in the director db.

kitsirota commented 7 years ago

I found another migration path that seems to be working across our environments.

In our case, we were moving from local to s3 blobstore backends, but it looks like this should apply to other migrations as well.

This is a bit sloppy, but here are the raw steps... -ssh into director and cd /var/vcap/store/blobstore -tar up store and scp it onto a server you can work with freely to install s3cmd and python-support packages -untar and flatten the blobs into a single dir with something like mv store/**/* /flat (assumes you create a dir called flat and your blobstore is in a dir called store) -upload everything in the flat dir to your blobstore s3 bucket -profit!

cppforlife commented 7 years ago
- ssh into director and cd /var/vcap/store/blobstore
- tar up store and scp it onto a server you can work with freely to install s3cmd and python-support packages
- untar and flatten the blobs into a single dir with something like mv store/**/* /flat (assumes you create a dir called flat and your blobstore is in a dir called store)
- upload everything in the flat dir to your blobstore s3 bucket

looks about right. i'm not sure it's worth adding any script since moving blobstores is not a common activity at this point.

kitsirota commented 7 years ago

Yep sounds good to me, we can probably close this then.

I'd more than happy to submit a PR for a blobstore-migration-tips.md with the notes in case it helps anyone else with this. Let me know.

Thanks! Kit