Description of problem:
V2VVMWare or OvirtProvider objects are not cleaned up
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. visit VM Import Wizard
2. select instance
3. kill browser window
4. mentioned objects live forever
Objects are deleted after some time 1-several hours
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?
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?
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?
The label is not available in ovirt. I will add label support to be consistent with how vmware works.
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.
My understanding it that when we add changes to vm provider there is work needed on the UI to use it.
> 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
but it needs to add the label:
@Filip, is this a correct UI bug ?
Ref to UI BZ:
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.
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
it might take some time before it disappears though (approx 1h)
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.
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.