Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1989413

Summary: Migration plan fails if a RHV VM was created from a template
Product: Migration Toolkit for Virtualization Reporter: Tzahi Ashkenazi <tashkena>
Component: InventoryAssignee: Jeff Ortel <jortel>
Status: CLOSED ERRATA QA Contact: David Vaanunu <dvaanunu>
Severity: high Docs Contact: Avital Pinnick <apinnick>
Priority: high    
Version: 2.1.0CC: dvaanunu
Target Milestone: ---   
Target Release: 2.1.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-08-26 07:09:27 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
error 500 none

Description Tzahi Ashkenazi 2021-08-03 07:52:10 UTC
Created attachment 1810368 [details]
error 500

Created attachment 1810368 [details]
error 500

Description of problem:
from MTV UI under > migration plans:
cant access migration plan running/completed - exit on
"Could not load VMs 500:Internal Server Error"
the main error from the inventory log : error":"sql: no rows in result set","stacktrace":

from the inventory log from the controller pod : 

[GIN] 2021/08/03 - 07:13:42 | 200 |    1.967366ms |   192.168.216.1 | GET      "/providers?detail=1"
[GIN] 2021/08/03 - 07:13:45 | 500 |   3.97320015s |   192.168.216.1 | GET      "/providers/ovirt/70ac5ea7-d593-4ce4-a890-87d7270f41d8/vms?detail=1"
{"level":"info","ts":1627974825.655803,"logger":"web|ovirt","msg":"","sql":"\nSELECT\nID\n,Name\n,Description\n,Revision\n,Shared\n,Profile\n,StorageDomain\n,Status\n,ActualSize\n,Backup\n,StorageType\n,ProvisionedSize\nFROM Disk\nWHERE\nID = :ID\n;\n","params":[{"Name":"ID","Value":"9ebb4501-99bd-46e4-86bc-59a49b16086d"}],"url":"/providers/ovirt/70ac5ea7-d593-4ce4-a890-87d7270f41d8/vms?detail=1","error":"sql: no rows in result set","stacktrace":"\ngithub.com/konveyor/controller/pkg/inventory/model.Table.scan()\n\t/remote-source/deps/gomod/pkg/mod/github.com/konveyor/controller.0/pkg/inventory/model/table.go:1009\ngithub.com/konveyor/controller/pkg/inventory/model.Table.Get()\n\t/remote-source/deps/gomod/pkg/mod/github.com/konveyor/controller.0/pkg/inventory/model/table.go:460\ngithub.com/konveyor/controller/pkg/inventory/model.(*Client).Get()\n\t/remote-source/deps/gomod/pkg/mod/github.com/konveyor/controller.0/pkg/inventory/model/client.go:133\ngithub.com/konveyor/forklift-controller/pkg/controller/provider/web/ovirt.(*VM).Expand()\n\t/remote-source/app/pkg/controller/provider/web/ovirt/vm.go:303\ngithub.com/konveyor/forklift-controller/pkg/controller/provider/web/ovirt.(*VMHandler).Expand()\n\t/remote-source/app/pkg/controller/provider/web/ovirt/vm.go:133\ngithub.com/konveyor/forklift-controller/pkg/controller/provider/web/ovirt.VMHandler.List()\n\t/remote-source/app/pkg/controller/provider/web/ovirt/vm.go:66\ngithub.com/gin-gonic/gin.(*Context).Next()\n\t/remote-source/deps/gomod/pkg/mod/github.com/gin-gonic/gin.3/context.go:161\ngithub.com/gin-gonic/gin.RecoveryWithWriter.func1()\n\t/remote-source/deps/gomod/pkg/mod/github.com/gin-gonic/gin.3/recovery.go:83\ngithub.com/gin-gonic/gin.(*Context).Next()\n\t/remote-source/deps/gomod/pkg/mod/github.com/gin-gonic/gin.3/context.go:161\ngithub.com/gin-gonic/gin.LoggerWithConfig.func1()\n\t/remote-source/deps/gomod/pkg/mod/github.com/gin-gonic/gin.3/logger.go:241\ngithub.com/gin-gonic/gin.(*Context).Next()\n\t/remote-source/deps/gomod/pkg/mod/github.com/gin-gonic/gin.3/context.go:161\ngithub.com/gin-gonic/gin.(*Engine).handleHTTPRequest()\n\t/remote-source/deps/gomod/pkg/mod/github.com/gin-gonic/gin.3/gin.go:409\ngithub.com/gin-gonic/gin.(*Engine).ServeHTTP()\n\t/remote-source/deps/gomod/pkg/mod/github.com/gin-gonic/gin.3/gin.go:367\nnet/http.serverHandler.ServeHTTP()\n\t/usr/lib/golang/src/net/http/server.go:2855\nnet/http.(*conn).serve()\n\t/usr/lib/golang/src/net/http/server.go:1937\nruntime.goexit()\n\t/usr/lib/golang/src/runtime/asm_amd64.s:1374"}
[GIN] 2021/08/03 - 07:13:48 | 200 |    1.886501ms |   192.168.216.1 | GET      "/providers?detail=1"
[GIN] 2021/08/03 - 07:13:51 | 500 |  3.908699785s |   192.168.216.1 | GET      "/providers/ovirt/70ac5ea7-d593-4ce4-a890-87d7270f41d8/vms?detail=1"
{"level":"info","ts":1627974831.7858493,"logger":"web|ovirt","msg":"","sql":"\nSELECT\nID\n,Name\n,Description\n,Revision\n,Shared\n,Profile\n,StorageDomain\n,Status\n,ActualSize\n,Backup\n,StorageType\n,ProvisionedSize\nFROM Disk\nWHERE\nID = :ID\n;\n","params":[{"Name":"ID","Value":"9ebb4501-99bd-46e4-86bc-59a49b16086d"}],"url":"/providers/ovirt/70ac5ea7-d593-4ce4-a890-87d7270f41d8/vms?detail=1","error":"sql: no rows in result set","stacktrace":"\ngithub.com/konveyor/controller/pkg/inventory/model.Table.scan()\n\t/remote-source/deps/gomod/pkg/mod/github.com/konveyor/controller.0/pkg/inventory/model/table.go:1009\ngithub.com/konveyor/controller/pkg/inventory/model.Table.Get()\n\t/remote-source/deps/gomod/pkg/mod/github.com/konveyor/controller.0/pkg/inventory/model/table.go:460\ngithub.com/konveyor/controller/pkg/inventory/model.(*Client).Get()\n\t/remote-source/deps/gomod/pkg/mod/github.com/konveyor/controller.0/pkg/inventory/model/client.go:133\ngithub.com/konveyor/forklift-controller/pkg/controller/provider/web/ovirt.(*VM).Expand()\n\t/remote-source/app/pkg/controller/provider/web/ovirt/vm.go:303\ngithub.com/konveyor/forklift-controller/pkg/controller/provider/web/ovirt.(*VMHandler).Expand()\n\t/remote-source/app/pkg/controller/provider/web/ovirt/vm.go:133\ngithub.com/konveyor/forklift-controller/pkg/controller/provider/web/ovirt.VMHandler.List()\n\t/remote-source/app/pkg/controller/provider/web/ovirt/vm.go:66\ngithub.com/gin-gonic/gin.(*Context).Next()\n\t/remote-source/deps/gomod/pkg/mod/github.com/gin-gonic/gin.3/context.go:161\ngithub.com/gin-gonic/gin.RecoveryWithWriter.func1()\n\t/remote-source/deps/gomod/pkg/mod/github.com/gin-gonic/gin.3/recovery.go:83\ngithub.com/gin-gonic/gin.(*Context).Next()\n\t/remote-source/deps/gomod/pkg/mod/github.com/gin-gonic/gin.3/context.go:161\ngithub.com/gin-gonic/gin.LoggerWithConfig.func1()\n\t/remote-source/deps/gomod/pkg/mod/github.com/gin-gonic/gin.3/logger.go:241\ngithub.com/gin-gonic/gin.(*Context).Next()\n\t/remote-source/deps/gomod/pkg/mod/github.com/gin-gonic/gin.3/context.go:161\ngithub.com/gin-gonic/gin.(*Engine).handleHTTPRequest()\n\t/remote-source/deps/gomod/pkg/mod/github.com/gin-gonic/gin.3/gin.go:409\ngithub.com/gin-gonic/gin.(*Engine).ServeHTTP()\n\t/remote-source/deps/gomod/pkg/mod/github.com/gin-gonic/gin.3/gin.go:367\nnet/http.serverHandler.ServeHTTP()\n\t/usr/lib/golang/src/net/http/server.go:2855\nnet/http.(*conn).serve()\n\t/usr/lib/golang/src/net/http/server.go:1937\nruntime.goexit()\n\t/usr/lib/golang/src/runtime/asm_amd64.s:1374"}

Version-Release number of selected component (if applicable):
Cloud38
OCP-48
CNV-48-451
OCS-48
MTV-2.1.0-36

How reproducible:
1. create a new migration plan,
2. run the  plan 
3. try to access the plan > Migration details by VM > you will exit on "Could 
   not load VMs 500:Internal Server Error"

Comment 1 Jeff Ortel 2021-08-04 19:22:49 UTC
The root cause is:  When a template is created, the referenced VM's disks are cloned. The cloned disks are created and NO EVENTS ARE GENERATED. VMs subsequently created using the template will reference disks that are not in inventory.

Comment 2 David Vaanunu 2021-08-13 19:31:00 UTC
verify MTV_2.1.0-48 / IIB 97916

Comment 5 errata-xmlrpc 2021-08-26 07:09:27 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 (Migration Toolkit for Virtualization 2.1.0), and where to find the updated
files, follow the link below.

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

https://access.redhat.com/errata/RHEA-2021:3278