Bug 1868045 - [v2v]kubevirt-vmware objects are not cleaned
Summary: [v2v]kubevirt-vmware objects are not cleaned
Alias: None
Product: Container Native Virtualization (CNV)
Classification: Red Hat
Component: V2V
Version: 2.5.0
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
: 2.5.0
Assignee: Piotr Kliczewski
QA Contact: Ilanit Stein
Depends On:
TreeView+ depends on / blocked
Reported: 2020-08-11 13:42 UTC by Filip Krepinsky
Modified: 2020-11-17 13:24 UTC (History)
7 users (show)

Fixed In Version: v2.5.0-6
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2020-11-17 13:24:21 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Github ManageIQ manageiq-v2v-conversion_host pull 84 0 None closed Add temporary label support 2020-12-31 10:28:23 UTC
Red Hat Product Errata RHEA-2020:5127 0 None None None 2020-11-17 13:24:32 UTC

Description Filip Krepinsky 2020-08-11 13:42:57 UTC
Description of problem:
V2VVMWare or OvirtProvider objects are not cleaned up

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. visit VM Import Wizard
2. select instance
3. kill browser window
4. mentioned objects live forever

Expected results:
Objects are deleted after some time 1-several hours

Comment 1 Filip Krepinsky 2020-08-11 13:55:24 UTC
kubevirt.io/temporary label was changed in recent versions to cnv.io/temporary. This label is not acted upon by OvirtProvider. 
@Piotr can we add a support for this to OvirtProvider or should we compute TTL and patch it once OvirtProvider object was created?

Comment 2 Piotr Kliczewski 2020-08-11 14:05:52 UTC
Ovirt provider was based on vmware provider and it uses the same mechanism based on ttl -> https://github.com/ManageIQ/manageiq-v2v-conversion_host/blob/5cc55e51bf7cc641e9b650c5e6bfae2159f022a3/kubevirt-vmware/pkg/apis/v2v/v1alpha1/ovirtprovider_types.go#L29. The cleanup logic is here https://github.com/ManageIQ/manageiq-v2v-conversion_host/blob/5cc55e51bf7cc641e9b650c5e6bfae2159f022a3/kubevirt-vmware/pkg/controller/gcovirtprovider/ovirtprovider_garbagecollector.go#L114 and should work exactly the same as for vmware.

@Filip have you tried to use TimeToLive attribute?

Comment 3 Filip Krepinsky 2020-08-11 14:18:54 UTC
there were two options for vmware provider TTL and temporary label. 
For ovirt there is only TTL which needs a special handling in the UI. First you have to create the resource and then patch it with TTL (not atomic).

We can implement this in the UI, but there will have to be additional logic for this. 
Wouldn't it be easier to support temporary label in the backend?

Comment 4 Piotr Kliczewski 2020-08-11 14:24:24 UTC
The label is not available in ovirt. I will add label support to be consistent with how vmware works.

Comment 5 Filip Krepinsky 2020-08-11 15:02:35 UTC

Comment 6 Yaacov Zamir 2020-08-12 06:58:22 UTC
I see that this will be fixed in the operator, updating component to v2v

@Piotr hi, feel free to change back / create a UI bug if you think this should also be addressed in the UI too.

Comment 7 Piotr Kliczewski 2020-08-12 07:17:12 UTC
My understanding it that when we add changes to vm provider there is work needed on the UI to use it.

Comment 8 Yaacov Zamir 2020-08-12 09:36:25 UTC
> My understanding it that when we add changes to vm provider there is work needed on the UI to use it.

IFAIU: the ui currently adds the label
kubevirt.io/temporary: "true"

but it needs to add the label:
cnv.io/temporary: "true"

@Filip, is this a correct UI bug ?

Comment 9 Yaacov Zamir 2020-08-12 11:34:59 UTC
Ref to UI BZ:

Comment 10 Filip Krepinsky 2020-08-12 11:48:37 UTC
yes, the UI bug will fix the use case for both providers. We just had a wrong label and we were already passing the label to both providers.

Comment 12 Filip Krepinsky 2020-09-01 11:26:03 UTC

oc get ovirtproviders.v2v.kubevirt.io

you should see a new object (few seconds old) when you select RHV instance in the wizard. This object should disappear when you replicate steps to reproduce

Comment 13 Filip Krepinsky 2020-09-01 11:27:28 UTC
it might take some time before it disappears though (approx 1h)

Comment 14 Ilanit Stein 2020-10-01 17:31:16 UTC
Verified on CNV-2.5 deployed on Sep 30 2020.

Entered the VM import wizard, picked VM from VMware/RHV providers, and closed the browser window.

$ oc get ovirtproviders.v2v.kubevirt.io
$ oc get V2VVMWare.v2v.kubevirt.io

showed that after 1 hours both object were indeed removed.

Comment 17 errata-xmlrpc 2020-11-17 13:24:21 UTC
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 (OpenShift Virtualization 2.5.0 Images), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


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