Description of problem: VM cannot be started while creating from a template which has 2nd disk added. 1. If the storage class is HPP, below annotation is missing in the VM PVC: "cdi.kubevirt.io/storage.bind.immediate.requested: 'true'" 2. If the storage class is OCS, the error for the VM is: Failed to create DataVolume: the namespace of the provided object does not match the namespace sent on the request Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. clone a template from centos7 2. add 2nd disk to the template 3. create vm from the template Actual results: VM is not able to be started Expected results: VM is started Additional info:
It's a regression from 4.12. And this problem only happens while creating VM not from 'openshift' namespace.
Another scenario is: 1. clone a template, create vm from it in 'default' ns is fine 2. clone a template, edit the rootdisk, save it without actually change anything, create vm from it in 'default' ns, vm is not in stopped status because of error: Failed to create DataVolume: the namespace of the provided object does not match the namespace sent on the request The difference between the two templates are "storageClassName: hostpath-csi-basic"m one template has it and one doesn't. dataVolumeTemplates: - metadata: namespace: openshift name: '${NAME}' spec: storage: resources: requests: storage: 30Gi storageClassName: hostpath-csi-basic preallocation: false sourceRef: kind: DataSource name: '${DATA_SOURCE_NAME}' namespace: '${DATA_SOURCE_NAMESPACE}'
(In reply to Guohua Ouyang from comment #2) > Another scenario is: > 1. clone a template, create vm from it in 'default' ns is fine > 2. clone a template, edit the rootdisk, save it without actually change > anything, create vm from it in 'default' ns, vm is not in stopped status > because of error: Failed to create DataVolume: the namespace of the provided > object does not match the namespace sent on the request > > The difference between the two templates are "storageClassName: > hostpath-csi-basic"m one template has it and one doesn't. > dataVolumeTemplates: > - metadata: > namespace: openshift It looks the 'namespace: openshift' is the problem, edit the disk will add this line to the template which prevent disk clone.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (Moderate: OpenShift Virtualization 4.13.0 Images security, bug fix, and enhancement update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2023:3205