Skip to content

vm-instance renders both instancetype matcher and explicit domain resources — KubeVirt rejects the VM with a conflict error #2909

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

  1. packages/apps/vm-instance/values.yaml ships a non-empty default instanceType: "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 explicit instanceType: "" works, which the form does not produce.
  2. The virtual-machine.domainResources helper (packages/apps/vm-instance/templates/_helpers.tpl) renders domain.cpu and domain.resources from .Values.resources unconditionally, without checking instanceType.
  3. The validation in templates/vm.yaml only enforces "at least one of instanceType / resources", not mutual exclusion, so a VM carrying both the spec.instancetype matcher and explicit spec.template.spec.domain.cpu / resources gets rendered.
  4. 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

  1. Make the relationship explicit: either fail with a clear message when both instanceType and fully-specified resources are set, or let fully-specified resources take precedence and skip the instancetype matcher.
  2. Consider whether the non-empty u1.medium default 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

  1. added
    kind/bugCategorizes issue or PR as related to a bug
    priority/important-soonMust be staffed and worked on either currently, or very soon, ideally in time for the next release
    triage/acceptedIndicates an issue is ready to be actively worked on
    area/dashboardIssues or PRs related to the dashboard / UI
    area/virtualizationIssues or PRs related to virtualization (kubevirt, cdi, vmi, vm-import)
    on Jun 12, 2026
  2. myasnikovdaniil commented on Aug 16, 2026

    @myasnikovdaniil
    Contributor

    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-instance is where both get rendered. The backend reason the two cannot coexist is KubeVirt's own: validateCPU in pkg/instancetype/apply/cpu.go appends a conflict for domain.resources.requests.cpu, domain.resources.limits.cpu, domain.cpu.sockets and domain.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.

  3. added a commit that references this issue on Sep 10, 2026
    4b6b1dc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/dashboardIssues or PRs related to the dashboard / UIarea/virtualizationIssues or PRs related to virtualization (kubevirt, cdi, vmi, vm-import)kind/bugCategorizes issue or PR as related to a bugpriority/important-soonMust be staffed and worked on either currently, or very soon, ideally in time for the next releasetriage/acceptedIndicates an issue is ready to be actively worked on

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions