Repository navigation
Description
Summary
Creating a VM with explicit resources (cpu/sockets/memory) instead of an instanceType is effectively impossible from the dashboard, and the error is misleading: the chart renders both the instancetype matcher and explicit domain resources, which the KubeVirt admission webhook rejects with a conflict error. Reported in the community chat on v1.4.2; the relevant templates are identical on main.
Symptom
A user clears the instanceType field in the dashboard form and sets cpu/ram, then gets a KubeVirt error complaining that the resource fields conflict with the selected instance type — from the user's perspective the instance type "never disappears".
Mechanism
packages/apps/vm-instance/values.yamlships a non-empty defaultinstanceType: "u1.medium". Clearing the field in the dashboard removes the key from user values, which just re-enables the chart default — "no instance type" cannot be expressed by omitting the key; only an explicitinstanceType: ""works, which the form does not produce.- The
virtual-machine.domainResourceshelper (packages/apps/vm-instance/templates/_helpers.tpl) rendersdomain.cpuanddomain.resourcesfrom.Values.resourcesunconditionally, without checkinginstanceType. - The validation in
templates/vm.yamlonly enforces "at least one of instanceType / resources", not mutual exclusion, so a VM carrying both thespec.instancetypematcher and explicitspec.template.spec.domain.cpu/resourcesgets rendered. - KubeVirt's VM admission webhook rejects such a VM with a "conflicts with the selected instance type" error, which surfaces to the user as a confusing failure unrelated to anything they can fix from the form.
Proposed fix
- Make the relationship explicit: either
failwith a clear message when bothinstanceTypeand fully-specifiedresourcesare set, or let fully-specifiedresourcestake precedence and skip the instancetype matcher. - Consider whether the non-empty
u1.mediumdefault belongs in the chart at all, since any non-empty default makes "no instance type" inexpressible from schema-generated forms.
Related
The missing instance-type dropdown in the 1.4 dashboard is a separate, already-addressed concern: on main the instanceType schema field carries x-cozystack-options: {source: instancetype} (#2778), so the dropdown returns in v1.5.
Workaround
Set instanceType: "" explicitly (empty string, not key removal) together with full resources (cpu, sockets, memory — sockets is required too).
Activity
myasnikovdaniil commentedon Aug 16, 2026
State: this is a chart bug rather than a console one, so it will not be fixed by the dashboard batch in #3837.
packages/apps/vm-instanceis where both get rendered. The backend reason the two cannot coexist is KubeVirt's own:validateCPUinpkg/instancetype/apply/cpu.goappends a conflict fordomain.resources.requests.cpu,domain.resources.limits.cpu,domain.cpu.socketsanddomain.cpu.cores, and a conflict is a rejection rather than a merge. So a VM cannot reference an instancetype and carry explicit CPU at the same time, and the form is rendering a combination the API will refuse.#3121's precedence pattern is the shape to port.
fix(vm-instance): let complete resources replace the instance type (c…