Skip to content

Tenant admins cannot upload images into VM disks (CDI upload forbidden by tenant RBAC) #3759

Open

Description

@IvanHunters

Description Users with the tenant admin role cannot upload an OS image into a VM disk within their own tenant. The upload fails with an RBAC Forbidden error, because the tenant admin role does not include permissions for the KubeVirt CDI upload API (upload.cdi.kubevirt.io / cdi.kubevirt.io). This blocks a basic tenant-level workflow: a tenant admin has to ask a platform administrator every time a custom image is needed. ## Steps to reproduce 1. Create a tenant and grant a user the tenant admin role. 2. Log in with that user's kubeconfig. 3. Try to upload an image into a VM disk: virtctl image-upload dv <disk-name> \ --size=10Gi \ --image-path=./image.qcow2 \ --namespace=tenant-<name> \ --uploadproxy-url=https://<cdi-uploadproxy> (same result via the Cozystack dashboard when creating a VM disk from an uploaded image) ## Expected behaviour A tenant admin can upload images into VM disks inside their own tenant namespace without involving a platform administrator. ## Actual behaviour The request is rejected with Error from server (Forbidden): ... is forbidden: User "..." cannot create resource ... (please replace with the exact error from your environment). ## Possible fix Add the missing rules to the tenant admin role: yaml - apiGroups: ["upload.cdi.kubevirt.io"] resources: ["uploadtokenrequests"] verbs: ["create"] - apiGroups: ["cdi.kubevirt.io"] resources: ["datavolumes", "datavolumes/source"] verbs: ["get", "list", "watch", "create", "update", "delete"] and make sure the cdi-uploadproxy endpoint is reachable for tenant users. ## Environment - Cozystack version: - Kubernetes version: - Installation method:

Activity

  1. added
    kind/bugCategorizes issue or PR as related to a bug
    triage/needs-triageIndicates an issue needs triage by a maintainer
    on Aug 11, 2026
  2. myasnikovdaniil commented on Aug 16, 2026

    @myasnikovdaniil
    Contributor

    Two things from building #3847 that widen this.

    It is not tenant admins, it is every tenant group. Checked by impersonation: none can create uploadtokenrequests, tenant-root-super-admin included.

    And there is a second wall behind the RBAC one, so fixing this alone will not make the browser path work: the apiserver's services/proxy strips Authorization, and the cdi-uploadproxy ingress uses ssl-passthrough, so CDI's internal cert reaches the browser with an untrusted issuer and no matching SAN. virtctl is unaffected by both, so it is the only path this RBAC fix unblocks.

    Separately, packages/system/kubevirt-cdi/values.yaml leaves uploadProxyURL empty, so CDIConfig.status.uploadProxyURL is blank and virtctl cannot discover the proxy by itself even once the permissions are there.

  3. added
    area/virtualizationIssues or PRs related to virtualization (kubevirt, cdi, vmi, vm-import)
    area/tenantIssues or PRs related to the tenant chart and multi-tenancy
    triage/acceptedIndicates an issue is ready to be actively worked on
    priority/important-soonMust be staffed and worked on either currently, or very soon, ideally in time for the next release
    and removed
    triage/needs-triageIndicates an issue needs triage by a maintainer
    on Sep 23, 2026
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/tenantIssues or PRs related to the tenant chart and multi-tenancyarea/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