Hide Forgot
Created attachment 1523120 [details] VM manifest Description of problem: When I try to create a vm with specified PVC volume and the PVC already exists, VM is stuck in Pending state and there is no error in its events. The error message is in namespace events: 3m 3m 1 cdi-dv-cirros-01.157ccbee54d079cc PersistentVolumeClaim Normal ProvisioningSucceeded persistentvolume-controller Successfully provisioned volume pvc-14621376-1fdc-11e9-b1d1-fa163e6dd567 using kubernetes.io/glusterfs 2m 2m 1 cdi-vm-dv-cirros.157ccbfd3b115a9e VirtualMachine Normal SuccessfulDataVolumeCreate virtualmachine-controller Created DataVolume cdi-dv-cirros-01 1m 2m 2 cdi-dv-cirros-01.157ccbfd5831ffbf DataVolume Warning ErrResourceExists datavolume-controller Resource "cdi-dv-cirros-01" already exists and is not managed by DataVolume There should be an error in the VM's events reporting that Resource already exists. Version-Release number of selected component (if applicable): How reproducible: 100% Steps to Reproduce: 1. have pvc named cdi-dv-cirros-01 2. Create and start VM defined in attachment Actual results: VM events don't show any error Expected results: VM should show error saying PVC/resource already exists Additional info:
The error is actually occurring in the DataVolume controller which is a CDI component. KubeVirt is just posting the DataVolume object and waiting for it to succeed before the VMI is launched. If the DataVolume is in the Pending Phase and cannot move forward because a PVC with the same name already exists, then I think we should consider failing the DataVolume. It's possible in this scenario that CDI should prevent the DataVolume from even being able to be posted to the cluster through the use of a validation webhook. @Adam, can we get someone in the storage team to comment on this?
The error exsists in the DataVolume event list as well. But I agree we should probably simply not allow the creation of the data volume due to the PVC already existing. I created a bug in GH https://github.com/kubevirt/containerized-data-importer/issues/627
Anything that you want documented in 1.4 about this, and if yes where do you track it?
Created a documentation bug here https://bugzilla.redhat.com/show_bug.cgi?id=1678410
*** Bug 1703009 has been marked as a duplicate of this bug. ***
Verified with the following code: -------------------------------------- CDI 1.9 Verified with the following scenario: -------------------------------------- Steps to Reproduce: 1. have pvc named cdi-dv-cirros-01 2. Create and start VM defined in attachment Actual results: VM should show error saying PVC/resource already exists The following error appears in the event log: ---------------------------------------------- 4m9s Warning FailedDataVolumeCreate virtualmachine/cdi-vm-dv-cirros Error creating DataVolume cdi-dv-cirros-01: admission webhook "datavolume-create-validator.cdi.kubevirt.io" denied the request: Destination PVC already exists 12s Warning FailedDataVolumeCreate virtualmachine/cdi-vm-dv-cirros Error creating DataVolume cdi-dv-cirros-01: admission webhook "datavolume-create-validator.cdi.kubevirt.io" denied the request: Destination PVC already exists Moving to VERIFIED!