[16.0-stable] Configure USB priority in VM boot order#5547
Conversation
|
Setting into Draft until is fully tested locally |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 16.0-stable #5547 +/- ##
===============================================
+ Coverage 19.52% 28.08% +8.55%
===============================================
Files 19 19
Lines 3021 2314 -707
===============================================
+ Hits 590 650 +60
+ Misses 2310 1520 -790
- Partials 121 144 +23 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
LGTM |
|
just left minor comments in the main one... |
|
@rene, yeah, thanks. I’ll update this PR as well. It’s also queued for a local test run (it can take up to 8 hours and I run now for a different branch + for another fix), so I’m not marking it as ready for review until the test is done. |
7f2009f to
89e5b71
Compare
|
Update the PR with the changes from the master-PR. |
89e5b71 to
19dc559
Compare
|
All tests are done |
|
@OhmSpectator can you rebase? Or should I create then a backport of #5558 (review) ? |
@OhmSpectator , please, rebase. |
Refresh dependencies and vendor tree to include boot order fields from lf-edge/eve-api. Update go.mod/go.sum, regenerate vendored protobuf artifacts, and sync modules.txt. No Pillar code changes; dependency sync only. Signed-off-by: Nikolay Martyanov <nikolay@zededa.com>
Extend EveBootOrderLib to read the opt/eve.bootorder fw_cfg file, log the boot options, and push USB entries forward or remove them depending on the “usb”/“nousb” value. This patch adds the fw_cfg reader, prioritization logic, and the necessary UefiLib dependency so future firmware builds can respond to the boot-order hints. Signed-off-by: Nikolay Martyanov <nikolay@zededa.com>
19dc559 to
00cce65
Compare
|
Rebased |
Point the xen-tools and pillar Dockerfiles at the new eve-uefi image that contains the EveBootOrderLib enhancements, ensuring qemu guests pick up the fw_cfg opt/eve.bootorder changes. This is the image hash produced after applying the usb/nousb patch in the UEFI tree. Signed-off-by: Nikolay Martyanov <nikolay@zededa.com>
Introduce boot order plumbing in Pillar types so VMs can apply a consistent boot device priority and report where it came from. This adds a BootOrder field to VmConfig and defines a new global setting (app.boot.order) with validation for supported values. It also extends AppInstanceConfig to keep the controller-provided boot order alongside the effective value and track the selected source, and introduces LPS-facing structs to cache per-app boot config and publish effective boot order + source without triggering unnecessary domain restarts. Signed-off-by: Nikolay Martyanov <nikolay@zededa.com>
Wire zedagent and localcommand together to let the Local Profile Server override per-app VM boot order and keep the effective value consistent across restarts and config refreshes. This adds a small boot order resolver that applies precedence (LPS over controller over device property) and stores the raw controller value so the effective boot order can be re-evaluated when LPS clears an override or app.boot.order changes. Boot order source is tracked alongside the effective setting for LPS reporting. Localcommand gains a dedicated /api/v1/appbootinfo task that periodically posts the effective boot order and processes any boot config returned by LPS, with persistence to disk, cache-based change detection, and throttling behavior when LPS indicates the feature is not configured. A mutex guards the AppInstanceConfig publish read-modify-write path since updates can now arrive from multiple goroutines. Signed-off-by: Nikolay Martyanov <nikolay@zededa.com>
Enable VM boot device prioritization by exporting the resolved boot order into the QEMU config as an OVMF-readable fw_cfg entry. This maps the BootOrder enum to the string values expected by EveBootOrderLib and injects opt/eve.bootorder only for FML/OVMF guests (skipping the virt machine type). Unit tests cover USB and NoUSB settings, absence of the section when unset, and the ARM/virt exclusion. Signed-off-by: Nikolay Martyanov <nikolay@zededa.com>
Handle boot order updates as a special-case FixedResources change so users get a clear, non-fatal indication that a restart is needed to apply the new setting. When the diff between configs shows that only FixedResources.BootOrder changed, zedmanager now records a warning-level status message instead of failing the modify path for missing restart commands. Other FixedResources changes keep the existing stricter behavior and still require an explicit restart request. Signed-off-by: Nikolay Martyanov <nikolay@zededa.com>
00cce65 to
5285a77
Compare
|
/rerun red |
Add user- and developer-facing documentation for runtime VM boot order control, with a focus on USB boot priority and how the setting flows from configuration into OVMF. This expands the firmware docs with the fw_cfg-based mechanism and its interaction with custom OVMF builds, registers the app.boot.order device property in CONFIG-PROPERTIES, and documents the new bidirectional LPS /api/v1/appbootinfo endpoint, including status codes, persistence, and restart semantics. It also introduces a dedicated VM boot order guide plus an internal architecture note covering precedence, data flow, and concurrency protections. Signed-off-by: Nikolay Martyanov <nikolay@zededa.com>
5285a77 to
97d50e6
Compare
|
Rebased by mistake... All was already green... |
|
/rerun red |
Description
Backport of #5507
How to test and validate this PR
https://docs.google.com/document/d/1kpluHl6q-KTCRXG2k421Smn1l2dF3HxAh7l_GleGAjo/edit?usp=sharing
Changelog notes
Added per-VM USB boot order control. Operators can now configure whether each VM prioritizes or deprioritizes USB devices in its boot order. Setting usb makes the VM boot from USB first, setting nousb makes the VM boot from disk first, and an empty value preserves the default behavior. Configuration takes effect on the next VM restart. See docs/VM-BOOT-ORDER.md for configuration methods and details.
Checklist
check them.