Skip to content

feat(usb): add fast fail attach#2067

Draft
danilrwx wants to merge 5 commits intofeat/improve-scheduling-for-hs-ss-hubsfrom
fix/usb/add-fast-fail-attach
Draft

feat(usb): add fast fail attach#2067
danilrwx wants to merge 5 commits intofeat/improve-scheduling-for-hs-ss-hubsfrom
fix/usb/add-fast-fail-attach

Conversation

@danilrwx
Copy link
Contributor

@danilrwx danilrwx commented Mar 5, 2026

Description

This PR now contains two groups of changes:

  1. USB attach fast-fail logic for USBIP port exhaustion:
  • add shared speed-aware USB helpers (pkg/common/usb/speed.go + tests);
  • update VM USB validator to check available USBIP ports per speed class (HS/SS) for new cross-node attachments;
  • update VM USB attach handler to stop futile attach attempts when no compatible free USBIP ports are available on target node (requeue);
  • update USBDevice lifecycle status with explicit NoFreeUSBIPPort reason.
  1. Existing branch fixes included in this PR scope:
  • e2e stabilization (better node diagnostics dump, clearer VM agent readiness error, timeout tuning);
  • switch some e2e image sources from Alpine BIOS image to Ubuntu image;
  • werf bundle import path fix in release-channel-version image stage.

Why do we need it, and what problem does it solve?

For USB flows, attach operations could repeatedly retry even when the target node had no free USBIP ports for the required speed class. This created noisy retries and delayed feedback.

With these changes, validation and reconciliation fail earlier and report a clear reason, so behavior is predictable and troubleshooting is easier.

Additional e2e/werf changes improve test stability and packaging correctness for the current branch content.

What is the expected result?

  1. Run VM with USB devices requiring cross-node USBIP forwarding.
  2. Exhaust HS or SS hub ports on the target node.
  3. Request one more USB device of the exhausted speed class.
  4. Verify:
    • validation rejects over-capacity updates;
    • attach handler does not loop blindly and requeues;
    • USBDevice condition reflects NoFreeUSBIPPort when applicable.
  5. Run affected e2e suites and confirm improved diagnostics and stable image usage.
  6. Verify bundle stage still includes module.yaml correctly after werf import path fix.

Checklist

  • The code is covered by unit tests.
  • e2e tests passed.
  • Documentation updated according to the changes.
  • Changes were tested in the Kubernetes cluster manually.

Changelog entries

section: core
type: fix
summary: "Add fast-fail USB attach checks and speed-aware USBIP port validation for HS/SS hubs."
impact_level: low

yaroslavborbat and others added 5 commits March 2, 2026 22:14
Signed-off-by: Yaroslav Borbat <yaroslav.borbat@flant.com>
Description
Add describe for nodes when test fails.
Also increase timeout for UntilVMAgentReady in VirtualMachineConfiguration
The error output for the error in function UntilVMAgentReady has become clearer

---------

Signed-off-by: Nikita Korolev <nikita.korolev@flant.com>
Co-authored-by: Roman Sysoev <36233932+hardcoretime@users.noreply.github.com>
Signed-off-by: Daniil Antoshin <daniil.antoshin@flant.com>
Signed-off-by: Nikita Korolev <nikita.korolev@flant.com>
Signed-off-by: Daniil Antoshin <daniil.antoshin@flant.com>
…2053)

Description
Сhange image from Alpine to Ubuntu due to problems with lsblk utility output

----------------

Signed-off-by: Dmitry Lopatin <dmitry.lopatin@flant.com>
Signed-off-by: Daniil Antoshin <daniil.antoshin@flant.com>
Signed-off-by: Daniil Antoshin <daniil.antoshin@flant.com>
@danilrwx danilrwx changed the base branch from main to feat/improve-scheduling-for-hs-ss-hubs March 5, 2026 09:12
@yaroslavborbat yaroslavborbat force-pushed the feat/improve-scheduling-for-hs-ss-hubs branch from f93cb5b to 4c89068 Compare March 6, 2026 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants