NAS-140626 / 26.0.0-BETA.2 / Prevent duplicate device attachment on VMs and containers (by Qubad786) (#18767)
## Problem
Currently, users can add the same USB or PCI device multiple times to
the same VM or container. This results in duplicate device assignments,
causing libvirt to fail with an error during startup.
## Solution
Added validation to ensure device uniqueness for both libvirt devices.
A validation error is now raised if the same device is added more than
once to a VM or container, preventing invalid configurations.
Original PR: https://github.com/truenas/middleware/pull/18763
Co-authored-by: M. Rehan <mrehanlm93 at gmail.com>
NAS-140711 / 26.0.0-BETA.2 / Robustize helper to reset-failed (by anodos325) (#18769)
This commit handles edge-case where maybe our CI is trying to reset a
unit that is unloaded. This allows us to surface what may be a more
useful error condition later on in tests.
Original PR: https://github.com/truenas/middleware/pull/18762
Co-authored-by: Andrew Walker <andrew.walker at truenas.com>
Robustize helper to reset-failed
This commit handles edge-case where maybe our CI is trying to
reset a unit that is unloaded. This allows us to surface what
may be a more useful error condition later on in tests.
(cherry picked from commit 6ab6b07017c0fea31a0f254444934316f337a1d3)
NAS-140711 / 27.0.0-BETA.1 / Robustize helper to reset-failed (#18762)
This commit handles edge-case where maybe our CI is trying to reset a
unit that is unloaded. This allows us to surface what may be a more
useful error condition later on in tests.
NAS-138933 / 25.10.3.1 / Load auth_rpcgss at boot to fix Kerberos NFS after manual start (by ixhamza) (by bugclerk) (#18768)
gssproxy writes 1 to `/proc/net/rpc/use-gss-proxy` once at startup. If
the proc file doesn't exist yet (`auth_rpcgss` not loaded), it silently
gives up. v0.9.2 [adds a 10-second retry timer for this
case](https://github.com/gssapi/gssproxy/pull/85), but TrueNAS ships
v0.9.1.
When NFS is started manually with auto-start disabled, `gssproxy` has
already started and given up. The kernel's `use_gss_proxy` flag stays -1
and the first Kerberos client locks it to 0 (one-shot latch), breaking
`RPCSEC_GSS` until reboot. Loading `auth_rpcgss` early ensures the proc
file exists before gssproxy starts.
### Testing
Tested with NFS auto-start disabled and rebooting. Before fix,
`use-gss-proxy` stayed -1 after manual NFS start and a raw
`RPCSEC_GSS_INIT` request locked it to 0. After fix, `use-gss-proxy` is
1.
[13 lines not shown]
Load auth_rpcgss at boot to fix Kerberos NFS after manual start
gssproxy writes 1 to `/proc/net/rpc/use-gss-proxy` once at startup. If
the proc file doesn't exist yet (`auth_rpcgss` not loaded), it silently
gives up. v0.9.2 adds a 10-second retry timer for this case,
but TrueNAS ships v0.9.1.
When NFS is started manually with auto-start disabled, `gssproxy` has
already started and given up. The kernel's `use_gss_proxy` flag stays -1
and the first Kerberos client locks it to 0 (one-shot latch), breaking
`RPCSEC_GSS` until reboot. Loading `auth_rpcgss` early ensures the proc
file exists before gssproxy starts.
Tested with NFS auto-start disabled and rebooting. Before fix,
`use-gss-proxy` stayed -1 after manual NFS start and a raw
`RPCSEC_GSS_INIT` request locked it to 0. After fix, `use-gss-proxy`
is 1.
(cherry picked from commit f592af1014970a81a98b7a03052c2b7fdc557380)
(cherry picked from commit eb0cd965ec7795ede47665fd93dc8f5e7bf793a1)
NAS-140626 / 27.0.0-BETA.1 / Prevent duplicate device attachment on VMs and containers (#18763)
## Problem
Currently, users can add the same USB or PCI device multiple times to
the same VM or container. This results in duplicate device assignments,
causing libvirt to fail with an error during startup.
## Solution
Added validation to ensure device uniqueness for both libvirt devices.
A validation error is now raised if the same device is added more than
once to a VM or container, preventing invalid configurations.