qvm-template-upgrade: add orchestration workflow and in-VM agent#213
qvm-template-upgrade: add orchestration workflow and in-VM agent#213nihalxkumar wants to merge 5 commits into
Conversation
ben-grande
left a comment
There was a problem hiding this comment.
Yay, started. As I've done a review now, I will receive a notification every time you commit. Let me know when you need another look or have doubts by mentioning me.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #213 +/- ##
==========================================
- Coverage 71.42% 69.31% -2.12%
==========================================
Files 12 31 +19
Lines 1344 3021 +1677
==========================================
+ Hits 960 2094 +1134
- Misses 384 927 +543 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
PipelineRetryFailed |
|
Some tests are not enabled on this repo, such as mypy, black and pylint. See this as an example: https://github.com/QubesOS/qubes-core-admin/blob/main/.gitlab-ci.yml. Can you create a separate PR to enable those checks? |
|
Sure, will do |
|
We can squash here if it's looks fine. Will also have to rebase as this is 24 commits behind. |
|
Looks fine to squash. |
71dee9e to
6c3d431
Compare
|
Oh no, commit message in the other PR closed it ... |
|
I see a conflict here - CI will not run until it's resolved. |
16b99f5 to
f1f8fc1
Compare
ben-grande
left a comment
There was a problem hiding this comment.
I have taken a look through the new code. Thanks for the progress, I like to see it evolving. Just minor review though
ad97dca to
a0289a7
Compare
|
Can you share more details of what fails on cleanup? |
|
When I tried upgrading fedora 41 -> 42 there was a cleanup failure which happened after the successful version upgrade. logs as shared privately on tuesday: https://gist.github.com/nihalxkumar/01fb990deab3960cb28d680773bb1089#file-upgrade42-log-L48-L55 we can see https://gist.github.com/nihalxkumar/0e4edccb4f4409b1a4daf5c44b6f576f After
|
|
But we can't ignore all cleanup failures. We don't know what is causing it, so this needs to be investigated. |
|
Unsure about this one also. If shutdown failed, the upgrade might have failed despite the package manager not returning an error during upgrade. Which exception were you receiving? |
By "all" I thought we are including the regular-updates cleanup behavior as well, which were untouched. On the version-upgrade path, though, you're right: once the upgrade returned I've since dropped that tolerance change. As in every run |
The exception was an It's raised in the pre-existing To your concern that a failed shutdown could mean a failed upgrade: in this case it didn't. The agent finishes cleanly: My dom0 is on
We could also harden the source instead, |
Can you upgrade to R4.3? It would make testing much easier, cause currently you are testing an EOL release.
The exception should be raised so the command fails. It won't be raised when you have R4.3. |
bd9a723 to
d3ab852
Compare
|
I upgraded my system to R4.3 and the upgrade ran successfully end to end upgrade with no errors. I have reset the branch to d3ab852 as of june15. The shutdown exception propagates, and failure detail it was trying to surface is already in Next thing is disk handling for temporary cache volume |
ben-grande
left a comment
There was a problem hiding this comment.
Hi. Could you also take a look at:
- Debian integration
- API usage for better progress reporting
|
In the future, this tool will be tested by openqa and when it is good enough, it should serve this use case: In other words, it should be able to do, what this command from the link, does. After you add API support, check if upgrading simultaneously with CLI and API breaks things or it is safely handled. |
|
@ben-grande Should debian integration be also included in this PR? |
|
Yes please. |
3f7bb44 to
1271315
Compare
|
dom0 creates a sparse 5GB image on disk, formats it ext4, and attaches it to the clone as a loop device through qvm-block, same as the manual steps. The one deliberate difference from the doc is that the agent mounts it by filesystem UUID rather than a device path like /dev/xvdi which isn't guaranteed stable. Everything is torn down afterwards regardless of outcome: the loop device is detached and the image deleted on success, failure, or rollback, and a lock file lets a later run detect and reclaim an image left behind by one that got killed mid-way. Open to design decisions, after the reviews I will test it on my system and then we can take on Debian upgrade. |
Add a new qvm-template-upgrade command to safely upgrade TemplateVMs and StandaloneVMs. The command validates the source qube, derives the next release clone name, clones the template, updates metadata, and removes failed clones unless told to keep them. The in-VM upgrade agent is stubbed for now, letting the orchestration and tests land first. fixes: QubesOS/qubes-issues#8605
1271315 to
8d7ce28
Compare
Add dnf support for upgrading templates to the next major release. Add a version_upgrade method to the package manager that dnf implements to check the distribution, only allow single-step updates, and sync to the target release. On dom0, run the clone through the existing vmupdate qrexec transport and show progress in the log. Clean up the clone and keep its inherited features if it's a standalone VM.
8d7ce28 to
0a8f8ac
Compare
0a8f8ac to
80e3d99
Compare
parulin
left a comment
There was a problem hiding this comment.
I have some suggestion for better integration with the rest of the docs. If you have any question, feel free to ask.
This file is in doc/tools instead of doc/manpages, why?
|
As I understand, this tool should also be promoted in qubes-doc, in the |
|
@parulin you are mistaking this repository as qubes-core-admin-client |
Add Debian release upgrade support in APTCLI to upgrade templates to the next release. Reuse the shared release-upgrade checks and reporting code from the dnf implementation by moving them to PackageManager. Read os-release once instead of multiple times, remove single-use helper functions.
Add in-qube version upgrade path via DNFCLI, dom0 orchestrator, and qrexec transport with streamed progress logging.
80e3d99 to
c3f550e
Compare
|
Debian upgrade end-to-end successful https://gist.github.com/nihalxkumar/3f64e3a056e9ce367e9787d5bd94b9df |


This PR introduces the
qvm-template-upgradedom0 command-line utility, that performs an in-place N -> N+1 distribution upgrade of Debian and Fedora TemplateVM or StandaloneVMfixes: QubesOS/qubes-issues#8605
GSoC 2026 project: Automate Template Version Upgrade