vm_create on an existing VM name overwrites the VM and answers "VirtualMachine created successfully"
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 54/100
Línea de trabajo
Start with pkg/toolsets/kubevirt/vm/create/tool.go, especially the apply call near line 209 and the success response near line 220; the issue also describes a patch with a test, but does not name its test file. Reproduce the overwrite using the three-step scenario in the issue and compare the existing VM’s uid, run strategy, memory, and disks before and after. Done means vm_create handles an existing name as described in the expected behavior and its test covers the result.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Version: v0.1.2 (66553fed). Still present on main (ec37a146, 2026-11-12): pkg/toolsets/kubevirt/vm/create/tool.go is unchanged; reproduced live on main 13bfb96f.
What happens
vm_create renders a VirtualMachine and applies it with Force: true (tool.go:209). Given the name of a VM that already exists, the apply rewrites it:
- the run strategy changes (a running VM with
runStrategy: AlwaysbecomesHaltedunlessautostartis set); - the disks and volumes are replaced (KubeVirt's lists are atomic, so the old disk is gone);
- the memory changes;
- the uid is unchanged.
The tool still answers # VirtualMachine created successfully (tool.go:220). A POST of the same object would return 409 AlreadyExists.
Reproduction (kind, Kubernetes v1.37.0, KubeVirt v1.9.0 CRDs; the identity can get and patch VirtualMachines in demo)
- Create VM
v1indemowithrunStrategy: Always, 1Gi of memory and a diskrootdiskfromfedora. - Call
vm_createwith{"namespace": "demo", "name": "v1", "workload": "ubuntu"}. - The answer is "VirtualMachine created successfully".
kubectl -n demo get vm v1 -o yamlshows the same uid,runStrategy: Halted, different memory (2Gi in our run), and the disk replaced byv1-rootdiskwith the ubuntu image.
Expected: vm_create refuses an existing name (or at least does not report "created"), and changes to an existing VM go through vm_lifecycle or resources_create_or_update.
The annotations (destructiveHint and idempotentHint both true) and the patch-only RBAC metadata suggest the upsert itself may be intended. If so, the result text should say the VM was updated, not created.
Possible fix: read the VM first. If it exists, return an error that names it with its uid and run strategy (this needs get added to the declared RBAC). We have a patch with a test (fix(kubevirt): refuse vm_create over an existing VirtualMachine) and can open a PR. It is a check-then-apply, so a VM created by someone else between the two requests can still be overwritten. Closing that window needs a create instead of an apply, which changes the declared verbs, so we left that for your call.
Found while reviewing the MCP server with AI assistance.
- Lenguaje dominante
- Go
- Estrellas
- 2.3k
- Forks
- 493
- Merge medio
- 2 d 8 h
- PR fusionados (30 d)
- 75
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin 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 containers/kubernetes-mcp-server
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
containers/kubernetes-mcp-server#1715 ·
Los mantenedores suelen responder en 1 día
-
Ensure all config values are logged after validationPosiblemente ocupada @ychampion la tomó hace 7 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
containers/kubernetes-mcp-server#1702 ·
Los mantenedores suelen responder en 1 día
-
Integer tool arguments silently truncate fractional values (gracePeriodSeconds 0.5 becomes an immediate delete)Posiblemente ocupada @sarankumar1325 la tomó hace 27 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
containers/kubernetes-mcp-server#1584 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Fix NetObserv config lookup when toolset name is overriddenQuizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
containers/kubernetes-mcp-server#1496 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
containers/kubernetes-mcp-server#1412 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de containers/kubernetes-mcp-server
Issues similares
-
Area/Agent Lifecycle Aspect/Build & Deploy Severity/Major Type/Bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
wso2/agent-manager#2603 ·
Los mantenedores suelen responder en 1 día
-
[Enhancement] platform-engineer: a definition change does not re-render running Applications; say how to roll it outPosiblemente ocupada @anoop2811 la tomó hoy. Abiertoneeds-triage type/enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Area/Policies Aspect/API Severity/Major Type/Bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
wso2/api-platform#4468 ·
Los mantenedores suelen responder en 1 día
-
review: medium
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
1lck/Lithe-IDEA#2432 ·
Los mantenedores suelen responder en 1 día
-
bug needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
dsx-ai-factory/health-validation#368 ·
Los mantenedores suelen responder en 2 días