-
Bug
-
Resolution: Done-Errata
-
Normal
-
2.5.0
-
None
-
False
-
None
-
False
-
-
Take the following scenario.
1. Configure wrong URL for the RHV provider (i.e. customer copy paste webadmin link from browser and not API endpoint)
spec:
secret:
name: rhvm-44-fb89g
namespace: openshift-mtv
type: ovirt
url: https://rhvm.virt.home.arpa/ovirt-engine/webadmin/ <--- wrong by mistake
2. It gets stuck forever in Staging state:
$ oc get provider -n openshift-mtv NAME TYPE STATUS READY CONNECTED INVENTORY URL AGE host openshift Ready True True True 14d rhvm-43 ovirt Ready True True True https://rhvm-43.virt.home.arpa/ovirt-engine/api 14d rhvm-44 ovirt Staging True https://rhvm.virt.home.arpa/ovirt-engine/webadmin/ 14d
3. Check statuses or the PR
- category: Required lastTransitionTime: "2023-10-12T00:38:21Z" message: Connection test, succeeded. reason: Tested status: "True" type: ConnectionTestSucceeded
It's misleading. How come connection test with an invalid url succeeded?
Not entirely sure, but I think its because its able to login using the webadmin URL
https://github.com/kubev2v/forklift/blob/main/pkg/controller/provider/container/ovirt/collector.go#L131
4. Even inside the inventory container from the controller pod, its not easy to tell what is wrong with "connection succeeded" messages.
{"level":"info","ts":"2023-10-12 01:01:37.477","logger":"provider|lgjdw","msg":"Waiting connection tested or inventory created.","provider":"openshift-mtv/rhvm-44"} {"level":"info","ts":"2023-10-12 01:01:37.477","logger":"provider|lgjdw","msg":"Conditions.","provider":"openshift-mtv/rhvm-44","all":{"conditions":[{"type":"ConnectionInsecure","status":"True","reason":"SkipTLSVerification","category":"Warn","message":"TLS is susceptible to machine-in-the-middle attacks when certificate verification is skipped.","lastTransitionTime":"2023-09-27T05:29:16Z"},{"type":"ConnectionTestSucceeded","status":"True","reason":"Tested","category":"Required","message":"Connection test, succeeded.","lastTransitionTime":"2023-10-12T00:38:21Z"},{"type":"Validated","status":"True","reason":"Completed","category":"Advisory","message":"Validation has been completed.","lastTransitionTime":"2023-10-12T00:38:21Z"},{"type":"LoadInventory","status":"True","reason":"Started","category":"Advisory","message":"Loading the inventory.","lastTransitionTime":"2023-10-12T00:38:24Z"}]}} {"level":"info","ts":"2023-10-12 01:01:37.477","logger":"provider|lgjdw","msg":"Reconcile ended.","provider":"openshift-mtv/rhvm-44","reQ":3} {"level":"info","ts":"2023-10-12 01:01:40.478","logger":"provider|wkv6v","msg":"Reconcile started.","provider":"openshift-mtv/rhvm-44"} {"level":"info","ts":"2023-10-12 01:01:40.511","logger":"provider","msg":"Connection test succeeded."} {"level":"info","ts":"2023-10-12 01:01:40.511","logger":"provider|wkv6v","msg":"Provider not reconciled, postponing.","provider":"openshift-mtv/rhvm-44"} {"level":"info","ts":"2023-10-12 01:01:40.515","logger":"provider|wkv6v","msg":"Waiting connection tested or inventory created.","provider":"openshift-mtv/rhvm-44"} {"level":"info","ts":"2023-10-12 01:01:40.515","logger":"provider|wkv6v","msg":"Conditions.","provider":"openshift-mtv/rhvm-44","all":{"conditions":[{"type":"ConnectionInsecure","status":"True","reason":"SkipTLSVerification","category":"Warn","message":"TLS is susceptible to machine-in-the-middle attacks when certificate verification is skipped.","lastTransitionTime":"2023-09-27T05:29:16Z"},{"type":"ConnectionTestSucceeded","status":"True","reason":"Tested","category":"Required","message":"Connection test, succeeded.","lastTransitionTime":"2023-10-12T00:38:21Z"},{"type":"Validated","status":"True","reason":"Completed","category":"Advisory","message":"Validation has been completed.","lastTransitionTime":"2023-10-12T00:38:21Z"},{"type":"LoadInventory","status":"True","reason":"Started","category":"Advisory","message":"Loading the inventory.","lastTransitionTime":"2023-10-12T00:38:24Z"}]}} {"level":"info","ts":"2023-10-12 01:01:40.515","logger":"provider|wkv6v","msg":"Reconcile ended.","provider":"openshift-mtv/rhvm-44","reQ":3} {"level":"info","ts":"2023-10-12 01:01:41.358","logger":"collector|ovirt","msg":"Running.","provider":"openshift-mtv/rhvm-44","phase":""} {"level":"info","ts":"2023-10-12 01:01:41.383","logger":"collector|ovirt","msg":"Failed.","provider":"openshift-mtv/rhvm-44","phase":"","error":"Not Found","stacktrace":"\ngithub.com/konveyor/forklift-controller/pkg/lib/error.New()\n\t/remote-source/app/pkg/lib/error/wrap.go:13\ngithub.com/konveyor/forklift-controller/pkg/controller/provider/container/ovirt.(*Client).list()\n\t/remote-source/app/pkg/controller/provider/container/ovirt/client.go:156\ngithub.com/konveyor/forklift-controller/pkg/controller/provider/container/ovirt.(*Collector).noteLastEvent()\n\t/remote-source/app/pkg/controller/provider/container/ovirt/collector.go:230\ngithub.com/konveyor/forklift-controller/pkg/controller/provider/container/ovirt.(*Collector).run()\n\t/remote-source/app/pkg/controller/provider/container/ovirt/collector.go:171\ngithub.com/konveyor/forklift-controller/pkg/controller/provider/container/ovirt.(*Collector).Start.func1()\n\t/remote-source/app/pkg/controller/provider/container/ovirt/collector.go:151\nruntime.goex... {"level":"info","ts":"2023-10-12 01:01:42.531","logger":"collector|ovirt","msg":"Running.","provider":"openshift-mtv/rhvm-43","phase":"refresh"} {"level":"info","ts":"2023-10-12 01:01:42.546","logger":"collector|ovirt","msg":"List event succeeded.","provider":"openshift-mtv/rhvm-43","count":0,"last-id":1750} {"level":"info","ts":"2023-10-12 01:01:43.516","logger":"provider|m7hnf","msg":"Reconcile started.","provider":"openshift-mtv/rhvm-44"} {"level":"info","ts":"2023-10-12 01:01:43.557","logger":"provider","msg":"Connection test succeeded."} {"level":"info","ts":"2023-10-12 01:01:43.557","logger":"provider|m7hnf","msg":"Provider not reconciled, postponing.","provider":"openshift-mtv/rhvm-44"} {"level":"info","ts":"2023-10-12 01:01:43.562","logger":"provider|m7hnf","msg":"Waiting connection tested or inventory created.","provider":"openshift-mtv/rhvm-44"} {"level":"info","ts":"2023-10-12 01:01:43.562","logger":"provider|m7hnf","msg":"Conditions.","provider":"openshift-mtv/rhvm-44","all":{"conditions":[{"type":"ConnectionInsecure","status":"True","reason":"SkipTLSVerification","category":"Warn","message":"TLS is susceptible to machine-in-the-middle attacks when certificate verification is skipped.","lastTransitionTime":"2023-09-27T05:29:16Z"},{"type":"ConnectionTestSucceeded","status":"True","reason":"Tested","category":"Required","message":"Connection test, succeeded.","lastTransitionTime":"2023-10-12T00:38:21Z"},{"type":"Validated","status":"True","reason":"Completed","category":"Advisory","message":"Validation has been completed.","lastTransitionTime":"2023-10-12T00:38:21Z"},{"type":"LoadInventory","status":"True","reason":"Started","category":"Advisory","message":"Loading the inventory.","lastTransitionTime":"2023-10-12T00:38:24Z"}]}} {"level":"info","ts":"2023-10-12 01:01:43.562","logger":"provider|m7hnf","msg":"Reconcile ended.","provider":"openshift-mtv/rhvm-44","reQ":3} {"level":"info","ts":"2023-10-12 01:01:46.384","logger":"collector|ovirt","msg":"Running.","provider":"openshift-mtv/rhvm-44","phase":""} {"level":"info","ts":"2023-10-12 01:01:46.414","logger":"collector|ovirt","msg":"Failed.","provider":"openshift-mtv/rhvm-44","phase":"","error":"Not Found","stacktrace":"\ngithub.com/konveyor/forklift-controller/pkg/lib/error.New()\n\t/remote-source/app/pkg/lib/error/wrap.go:13\ngithub.com/konveyor/forklift-controller/pkg/controller/provider/container/ovirt.(*Client).list()\n\t/remote-source/app/pkg/controller/provider/container/ovirt/client.go:156\ngithub.com/konveyor/forklift-controller/pkg/controller/provider/container/ovirt.(*Collector).noteLastEvent()\n\t/remote-source/app/pkg/controller/provider/container/ovirt/collector.go:230\ngithub.com/konveyor/forklift-controller/pkg/controller/provider/container/ovirt.(*Collector).run()\n\t/remote-source/app/pkg/controller/provider/container/ovirt/collector.go:171\ngithub.com/konveyor/forklift-controller/pkg/controller/provider/container/ovirt.(*Collector).Start.func1()\n\t/remote-source/app/pkg/controller/provider/container/ovirt/collector.go:151\nruntime.goex... {"level":"info","ts":"2023-10-12 01:01:46.562","logger":"provider|j6n8f","msg":"Reconcile started.","provider":"openshift-mtv/rhvm-44"}
5. One may need to look at that ovirt collector code and lines above and check the RHV logs to realize the operator is stuck on some SSO redirect loop due to the wrong URL.
Can we please add a better connection test for RHV and ensure it's reaching the API endpoint? So that it sets this case to ConnectionTestFailed condition.
- links to
-
RHBA-2024:126311 MTV 2.6.0 Images