oc-cluster-wrapper
oc-cluster-wrapper copied to clipboard
Profile snapshot/restore
Allow for snapshoting a profile. This will tar up the profile contents into a common location, so that later can be restored. This way we can provide a way to mess up clusters and be able to revert back to a working state.
Commands could be:
- snapshot-save
- snapshot-list
- snapshot-restore
The restoration of a profile can have unknown issues if some images are no longer existing, but this is something we need to assume for now.
So if we have a new setting OPENSHIFT_CLUSTER_BACKUP_DIR defaulting to .oc/backup.
snapshot-save will take a profile dir, tar gz it down and put it into .oc/backup.
snapshot-list will just list all the tar files in .oc/backup
snapshot-restore will untar a tar file from .oc/backup into ./oc/profiles
Was that kinda what you had in mind? Or do we need to tar more then just the conents of the profile dir?
Yeah, That was the basic idea, but some things we need to look into:
- snapshot-save
- Is there any problem for snapshoting a running cluster? if yes, then, snapshot should always need to be on a stopped cluster and verification need to happen
- Should we limit the ammount of snapshots and cycle when max reached, removing oldest snapshot? If yes, we should make this clear, and allow for user to delete the snapshot he don't want to preserve before.
- Maybe it's worth to have 2 types of snapshots (temporal, which can be cycled and golden, which need to be removed by the user and are not cycled)
- snapshot-restore:
- Should there be a profile created, option to overwrite.
- When overwriting a profile, if up bring it down restore and then up (or last up make it optional)
- snapshot-list:
- If 2 types of snapshots, list them, as well as number of snapshots in configuration (this brings the fact that, should we need a central configuration file in ($HOME/.oc/config?)
- snapshot-remove <PROFILE_NAME>:
- Remove old snapshots by name for a given progile
- snapshot-clear:
- Remove all snapshots for a given profile
This also introduces the question, should snapshots live in the profile (maybe the temporal yes and the golden not). In this way you can have master configs that can be recreated and safe-points.
Any more ideas?