Repository navigation
Tenant admins cannot upload images into VM disks (CDI upload forbidden by tenant RBAC) #3759
Copy link
Copy link
Open
Labels
area/tenantIssues or PRs related to the tenant chart and multi-tenancyIssues or PRs related to the tenant chart and multi-tenancyarea/virtualizationIssues or PRs related to virtualization (kubevirt, cdi, vmi, vm-import)Issues or PRs related to virtualization (kubevirt, cdi, vmi, vm-import)kind/bugCategorizes issue or PR as related to a 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 releaseMust 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 onIndicates an issue is ready to be actively worked on
Description
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:
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area/tenantIssues or PRs related to the tenant chart and multi-tenancyIssues or PRs related to the tenant chart and multi-tenancyarea/virtualizationIssues or PRs related to virtualization (kubevirt, cdi, vmi, vm-import)Issues or PRs related to virtualization (kubevirt, cdi, vmi, vm-import)kind/bugCategorizes issue or PR as related to a 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 releaseMust 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 onIndicates an issue is ready to be actively worked on
Activity
myasnikovdaniil commentedon Aug 16, 2026
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-adminincluded.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/proxystripsAuthorization, and thecdi-uploadproxyingress usesssl-passthrough, so CDI's internal cert reaches the browser with an untrusted issuer and no matching SAN.virtctlis unaffected by both, so it is the only path this RBAC fix unblocks.Separately,
packages/system/kubevirt-cdi/values.yamlleavesuploadProxyURLempty, soCDIConfig.status.uploadProxyURLis blank andvirtctlcannot discover the proxy by itself even once the permissions are there.feat(console): show image-upload state on the VMDisk detail page
feat(console): show image-upload state on the VMDisk detail page