v0.57.0: re-assert a raw drive's guest-bind (ReassertGuestBinds mount-table fallback)

ReassertGuestBinds mapped durable-id->mount from Observe() only, so a raw enrolled
drive was never found and its in-guest bind wasn't re-asserted after reboot/re-mount
(drive showed "Leválasztva"). Augment the map from the mount table (raw /mnt/<name>
-> device fs-UUID via HostReader), skipping the /mnt/felhom-drives bind; Observe
failure no longer aborts. Completes v0.56.0's raw-drive durability.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-01 18:37:31 +02:00
parent e593fb277a
commit 67e2144f11
3 changed files with 39 additions and 7 deletions
+21 -2
View File
@@ -852,8 +852,27 @@ func (s *Server) ReassertGuestBinds(ctx context.Context) {
}
}
} else {
s.logger.Warn("reconcile: storage view unavailable — skipping", "err", err)
return
// Observe failing is not fatal — a RAW enrolled drive wouldn't be in it anyway; fall through to
// the mount-table scan below so raw drives still get re-asserted.
s.logger.Warn("reconcile: storage view unavailable — using mount-table only", "err", err)
}
// Impl-2b: a RAW enrolled drive is NOT a PVE storage, so Observe misses it and its guest-bind would
// never be re-asserted (post-reboot/reconnect). Augment the map from the mount table: each raw
// /mnt/<name> mount → its device fs-UUID (uuid:<…>). Skip the /mnt/felhom-drives bind (AttachDrive
// wants the RAW mount path). Observe entries win (already set).
if s.host != nil {
if mounts, err := s.host.Mounts(); err == nil {
for _, m := range mounts {
if strings.HasPrefix(m.MountPoint, "/mnt/felhom-drives") {
continue // the bind, not the raw mount
}
if uuid, ok := s.host.ResolveUUID(m.Device); ok && uuid != "" {
if _, exists := mountByDurable["uuid:"+uuid]; !exists {
mountByDurable["uuid:"+uuid] = m.MountPoint
}
}
}
}
}
for vmid, ids := range s.guestBinds.Guests() {
for _, id := range ids {