Support offline restore on proxy deployments - #684
Conversation
|
In first read of the PR, this should work with #611 with this so we can claim proxy backup-restore really brings proxy to backed up state. Otherwise we'll require a complete proxy sync after restore to handle container gateway. I'll test both PRs together and see if we need any updates. |
|
I did some testing of this with Cheyenne's restore PR and Ian's container_gateway PR with this. Was able to backup container_gateway DB and restore the DB and redeploy proxy with correct features, content and container_gateway. Will keep this in draft till the restore PR goes in so the commits can be cleaned up. Backup on proxy with pulp and container_gateway Restore validate: Restore: |
| import_playbook: ../deploy-proxy/deploy-proxy.yaml | ||
| when: | ||
| - not validate | default(false) | ||
| - restore_flavor | default('') is match('foreman-proxy.*') |
There was a problem hiding this comment.
This can work for now, but this will really need to change to be feature based or to have a separate command (e.g. restore-proxy).
There was a problem hiding this comment.
+1 for making this deploy and the one below feature-based instead of using flavor. Since enabled_features are informed by flavors and features I'd use them as a source of truth.
| - not validate | default(false) | ||
| - restore_flavor | default('') == 'katello' | ||
|
|
||
| - name: Verify restore completion |
There was a problem hiding this comment.
Can we rely on a subset of our existing checks here instead?
There was a problem hiding this comment.
We can remove the entire section post deploy cause deploy has these checks built in.
There was a problem hiding this comment.
+1 to that. If there are any additional checks needed you should add them as a role to ./checks.
qcjames53
left a comment
There was a problem hiding this comment.
I've been working on testing this playbook all day. Backup / restore seems to work great for empty proxies but I haven't yet had a content backup go through. It's some sort of pulpcore versioning issue I'm working through; hoping to get this addressed ASAP and approve the PR.
| - not validate | default(false) | ||
| - restore_flavor | default('') == 'katello' | ||
|
|
||
| - name: Verify restore completion |
There was a problem hiding this comment.
+1 to that. If there are any additional checks needed you should add them as a role to ./checks.
| import_playbook: ../deploy-proxy/deploy-proxy.yaml | ||
| when: | ||
| - not validate | default(false) | ||
| - restore_flavor | default('') is match('foreman-proxy.*') |
There was a problem hiding this comment.
+1 for making this deploy and the one below feature-based instead of using flavor. Since enabled_features are informed by flavors and features I'd use them as a source of truth.
There was a problem hiding this comment.
WOW that took a long time to fully test. Two full workdays. You'll have to excuse a little weariness and mental fog in this review :)
I haven't been able to validate proxy restore works at all. I think it's my fault but I want to document what's failed for me:
- I set up foreman on quadlet + proxy on another vagrant VM using the
foreman-proxyfeature. Content sync worked. Backup went through but restore did not function due to some obsah_state issues encountered on restore setup? - I set up foreman and the smart proxy on different RHEL 9 satlab hosts. Foreman was configured regularly and then I created an auth bundle and used
./foremanctl deploy-proxy --auth-bundle ...to register the proxy. Backup would not go through with this proxy. According to Claude it was attempting to back up the foreman and candlepin dbs in addition to pulp and they were not being found on the proxy.
Based on this I have a couple of questions:
- Is restore supposed to work on a quadlet-based environment?
- Should that satlab proxy backup have gone through?
- I don't think
--forcedoes anything? It seems to always be enabled when restoring a proxy due to broken obsah handling on the local VM proxy I tried to restore. It might work on a remote proxy but I did not get that far.
Also a few requests:
- The postgreql service shutdown is really flakey in
src/roles/restore/tasks/prepare_system.yamlandsrc/roles/backup/tasks/main.yaml. I had to do it manually on 9/10 runs across multiple installs. I know this isn't a part of this PR but could we address both before saying backup/restore is good to go? I'd really want to see this improved. docs/user/backup-restore.mdseverely needs reformatted. It is 400 lines of AI-generated filler and it is so hard to find useful info in that file. I think we could get away with like 40 lines of info in that file. Can you please give this an honest try? I'd personally do commands and common params, a BRIEF list of what is backed up, and supported configs like external DBs. We don't need to include anything about compression ratios or tell users they need to rotate the backups. Why does BACKUP_DIR, the most important param, not say anything about it being a remote directory? Please 🥺
qcjames53
left a comment
There was a problem hiding this comment.
Samir, thank you for meeting up yesterday morning to explain the details of proxy backup/restore with me. For future reference, the missing pieces were this:
- Foremanctl backup and restore currently requires a single-environment foremanctl client like foreman-maintain. We can't support multi-host foremanctl for backup/restore until obsah can support mutli-host cleanly.
--forceis single-environment only for now- Documentation is a lot of carryover from various satellite docs mixed together.
I was able to verify backup/restore of a proxy hosted on a local VM functions great provided you have two foremanctl instances configured (one for the quadlet and one for the proxy VMs). --force works great for overriding an existing install. Restore onto a blank VM also functioned provided Foreman was pre-configured to use that VM as a proxy. I imagine configuring the proxy in Foreman itself would have worked as well. Existing content (+Pulp db) restores okay and new content can sync after restore.
I didn't have much luck getting #611 to work in conjunction with my environment. Nothing related to this PR; I just couldn't get the container gateway feature enabled properly for some reason (It looks like the PR is still in flux, anyways). I'd be happy to revisit this if it's a hard requirement but I'm thinking if something is broken we can fix it down the road.
|
I'd love if you could add some of these critical details to the backup/restore docs but I'm happy to merge as-is. |
|
Had some discussions with @qcjames53 and opened a PR here: #778 which has some documentation about using backup/restore in dev setups. The current backup-restore doc in user docs does not talk about non-localhost deployments which is correct since user installs always map quadlet and proxy to localhost. In dev setups, one has to consider some things I am trying to document here: #778 |
|
Thanks @qcjames53 @ehelms .. This is good to merge now. |
Why are you introducing these changes? (Problem description, related links)
Support offline restore on proxies. Built on top of offline restore commit hence marking draft.
What are the changes introduced in this pull request?
How to test this pull request
Checklist