Bug 1669163 - VM is stuck in pending state without showing error when PVC already exists
Summary: VM is stuck in pending state without showing error when PVC already exists
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Container Native Virtualization (CNV)
Classification: Red Hat
Component: Storage
Version: 1.4
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: 2.0
Assignee: Irit Goihman
QA Contact: Kevin Alon Goldblatt
URL:
Whiteboard:
: 1703009 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-01-24 14:00 UTC by Radim Hrazdil
Modified: 2019-07-29 07:24 UTC (History)
8 users (show)

Fixed In Version: 1.6.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-07-29 07:24:05 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
VM manifest (978 bytes, text/plain)
2019-01-24 14:00 UTC, Radim Hrazdil
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github kubevirt containerized-data-importer pull 647/ 0 None None None 2020-08-28 03:47:36 UTC

Description Radim Hrazdil 2019-01-24 14:00:29 UTC
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:

Comment 1 David Vossel 2019-01-25 22:45:58 UTC
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?

Comment 2 Alexander Wels 2019-01-29 12:51:38 UTC
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

Comment 3 Federico Simoncelli 2019-02-11 09:55:46 UTC
Anything that you want documented in 1.4 about this, and if yes where do you track it?

Comment 4 Adam Litke 2019-02-18 17:36:55 UTC
Created a documentation bug here https://bugzilla.redhat.com/show_bug.cgi?id=1678410

Comment 5 Guohua Ouyang 2019-04-25 22:42:49 UTC
*** Bug 1703009 has been marked as a duplicate of this bug. ***

Comment 6 Kevin Alon Goldblatt 2019-05-15 12:00:47 UTC
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!


Note You need to log in before you can comment on or make changes to this bug.