KVM agent: VDDK auto-detection runs find / repeatedly, so the agent misses the Ready timeout and gets stuck in a reconnect loop
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 58/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- java
- Área
- backend, infrastructure
Línea de trabajo
Start by reading LibvirtComputingResource.resolveVddkLibDir(), detectVddkLibDir() and the VDDK capability checks named in the issue, then trace their calls from initialize() and LibvirtReadyCommandWrapper. Check how empty or invalid vddk.lib.dir values are handled and how often detection runs on hosts without virt-v2v. Done means the scans no longer delay ReadyCommand past its 60-second wait or trigger repeated agent reinitialization.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
problem
Since VDDK support was added for VMware to KVM migration (#12970, extended in #13656 and restored in #14256), the KVM agent scans the whole filesystem many times while it starts up and while it handles ReadyCommand:
find / -type d -name 'vmware-vix-disklib-distrib' 2>/dev/null | head -n 1
On our hosts each scan takes about 20 seconds. The agent runs it repeatedly:
configure() (agent start) -> 2 two scans -> ~47s
initialize() (before StartupRoutingCommand) -> 5 scans -> ~108s
The management server sends ReadyCommand with "wait":"60", but the agent needs about 107 s to answer it. This sets off a loop that keeps repeating:
- The agent sends Startup, and the management server sends ReadyCommand.
- The ReadyAnswer is still not sent when the next ping goes out. The PingAnswer comes ba("Management server requested startup command to reinitialize the agent"), so the agentruns initialize() again, which means 5 more scans in parallel.
- The agent sends a second Startup, and the management server closes the connection righost connection to host ... Attempting reconnection while we still have 1 commands inprogress).
- The agent reconnects and step 1 starts again, roughly every 5 minutes.
The agent never gets to a stable connected state. A full agent restart takes more than a minute before it even sends its first Startup.
Root cause
In LibvirtComputingResource:
- resolveVddkLibDir() calls detectVddkLibDir() (the find /) whenever vddkLibDir is blank out VDDK this is always the case, so the (empty) result is never cached and every callscans again.
- hostSupportsVddk(String) calls resolveVddkLibDir() before it checks hostSupportsInstancerefore runs even on hosts where virt-v2v isn't installed (in our log: Failed to detectvirt-v2v password option: Cannot run program "virt-v2v").
- hostSupportsVddk(), hostSupportsVddkBlockCopy(), hostSupportsVddkBlockCopyInPlaceFinaliBlockCopyRbd() and hostSupportsVddkRbdDirectImport() all end up in hostSupportsVddk(). They are called one after another in initialize() and in LibvirtReadyCommandWrapper, so each of them runs its own scan.
10:18:41,716 DEBUG [cloud.agent.Agent] Sending Startup: Seq 19-0
10:18:42,815 INFO [cloud.agent.Agent] Processing agent ready command, agent id = 19
10:18:43,403 DEBUG [utils.script.Script] Executing command [/bin/bash -c find / -type d -name 'vmware-vix-disklib-distrib' 2>/dev/null | head -n 1 ].
10:19:03,098 DEBUG [utils.script.Script] Successfully executed process [...] for command [/bin/bash -c find / -type d -name 'vmware-vix-disklib-distrib' ...].
10:19:03,115 DEBUG [utils.script.Script] Executing command [/bin/bash -c find / -type d -name 'vmware-vix-disklib-distrib' 2>/dev/null | head -n 1 ].
10:19:24,828 DEBUG [utils.script.Script] Successfully executed process [...] for command [/bin/bash -c find / -type d -name 'vmware-vix-disklib-distrib' ...].
10:19:41,918 DEBUG [cloud.agent.Agent] Received response: Seq 19-1: { ... "PingAnswer": { ... "sendStartup":"true" ... } }
10:19:41,919 INFO [cloud.agent.Agent] Management server requested startup command to reinitialize the agent
10:20:29,354 DEBUG [cloud.agent.Agent] ... ReadyAnswer ...
10:21:31,629 DEBUG [cloud.agent.Agent] Sending Startup: Seq 19-3
10:21:31,659 DEBUG [utils.nio.NioClient] Closing socket Socket[addr=/<mgmt-ip>,port=8250,...]
10:21:36,661 INFO [cloud.agent.Agent] Lost connection to host: <mgmt-ip>. Attempting reconnection while we still have 1 commands in progress.
10:23:28,740 DEBUG [cloud.agent.Agent] Sending Startup: Seq 0-4
10:24:28,922 INFO [cloud.agent.Agent] Management server requested startup command to reinitialize the agent
10:26:14,006 DEBUG [utils.nio.NioClient] Closing socket Socket[addr=/<mgmt-ip>,port=8250,...]
... (the cycle repeats)
Workaround
None that is reliable. Setting vddk.lib.dir in agent.properties stops the scans only if it points to a valid VDDK installation (lib64/libvixDiskLib.so*). An invalid or empty value still falls back to find /.
versions
- CloudStack: latest main
- Hypervisor: KVM, no VDDK and no virt-v2v installed
The steps to reproduce the bug
- Use a KVM host without VMware VDDK (and without virt-v2v), running a build that includes the latest main
- Restart cloudstack-agent.
- Check agent.log: find / runs many times, the ReadyAnswer comes long after the 60s wait, and the agent keeps reconnecting.
What to do about it?
No response
- Lenguaje dominante
- Java
- Estrellas
- 3.1k
- Forks
- 1.4k
- Merge medio
- 7 d 16 h
- PR fusionados (30 d)
- 15
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de apache/cloudstack
-
resizeVolume of a running system VM's volume is accepted but the VM never sees the new sizePosiblemente ocupada @bhouse-nexthop la tomó hace 3 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
apache/cloudstack#14645 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
VR reports a load balancer change as applied when haproxy.cfg cannot be replacedPosiblemente ocupada @bhouse-nexthop la tomó hace 3 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
apache/cloudstack#14633 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
restartNetwork reports a ResourceUnavailableException as an unexpected error (530), unlike restartVPC (534)Posiblemente ocupada @bhouse-nexthop la tomó hace 3 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
apache/cloudstack#14631 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
apache/cloudstack#14625 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Remote access VPN users are disconnected on every LB, ACL, port forward or firewall change (xl2tpd restarted on every iptables pass)Posiblemente ocupada @willbennett-devops la tomó hace 12 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
apache/cloudstack#14545 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de apache/cloudstack
Issues similares
-
[Bug]: Nullable implicit operator on string extensible enums still throws for a null stringPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertobug emitter:client:csharp
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
microsoft/typespec#12572 · 1 comentario · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
[BUG]: Java SDK MountRequest always sends update-optional fields, resetting stored mount settingsAbiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
GCC 15.2: -Wcast-qual warning - cast discards const qualifier from pointer target type (H5trace.c)Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
Los mantenedores suelen responder en 1 día
-
[Bug] RemotingHelper.connect swaps the socket send and receive buffer configurationPosiblemente ocupada @amalsaidov la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
needs-area-label
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 2 días