-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate VMs with direct LUNs from ovirt #371
Conversation
\
not sure I'm following why the raw client is relevant here but looking at this, it looks like the code we use is supposed to set the address.. |
it does. thanks to miguel the problem was on ovirt (in my opinion). some details are not showed when querying the list of disks and when checking out the specific disk it has all the details. |
Codecov ReportPatch and project coverage have no change.
Additional details and impacted files@@ Coverage Diff @@
## main #371 +/- ##
===========================
===========================
☔ View full report in Codecov by Sentry. |
ah yeah, I remember this behavior - makes sense |
9fb4c19
to
605a8ea
Compare
A gap exist when the VM is set only with direct lun. then we must have storage map (ui and backend), but any map will work (without really doing anything). |
381c85d
to
49f04dc
Compare
return | ||
} | ||
} else if len(da.Disk.Lun.LogicalUnits.LogicalUnit) > 0 && da.Disk.Lun.LogicalUnits.LogicalUnit[0].Address == "" { | ||
// have LUN but without the relevant data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's the information we get from oVirt, unrelated to the storage mapping, right? in that case, why putting it here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because we fill up the inventory and in older ovirt versions we won't get the whole details. if so - we can't proceed with the migration
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, it makes sense to do that but the question is why here - can't we filter out this information before saving it to the inventory then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
filtering before saving - so the vm will be without the disk?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh that's even better - then we can produce a validation error!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how so? empty map is allowed...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right but the storage map is set later on - I'm referring to an earlier phase where we examine the vm from the source, if we see a diskless vm (e.g., a vm with a lun disk that we cannot migrate) then we can produce a validation error (not necessarily an 'error', maybe a 'warning in the general case and an 'error' when the vm is set with a bootable disk that we cannot migrate)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still think it would be better to filter out the disk so we won't see invalid disks in the storage mapping and ideally also have a validation warning about this
if err != nil { | ||
return | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this code is not that clear - what does it do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when we get disks from ovirt it gives us the list. only when querying the disk we will get full details (in case of LUN we need them).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so shouldn't it be 'get'?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'm getting an error when it's get
.
{"level":"info","ts":1688392887.263588,"logger":"collector|ovirt","msg":"Failed.","provider":"konveyor-forklift/ovirt","url":"engineurl/disks/c467d491-2646-44f2-bd5c-f4bff1c3186b","phase":"load","error":"not found.","stacktrace":"\ngithub.com/konveyor/forklift-controller/pkg/controller/provider/container/ovirt.(*Client).get.func1()\n\tpkg/controller/provider/container/ovirt/client.go:173\ngithub.com/konveyor/forklift-controller/pkg/controller/provider/container/ovirt.(*Client).get()\n\tpkg/controller/provider/container/ovirt/client.go:188\ngithub.com/konveyor/forklift-controller/pkg/controller/provider/container/ovirt.(*DiskAdapter).List()\n\tpkg/controller/provider/container/ovirt/model.go:1014\ngithub.com/konveyor/forklift-controller/pkg/controller/provider/container/ovirt.(*Collector).create()\n\tpkg/controller/provider/container/ovirt/collector.go:279\ngithub.com/konveyor/forklift-controller/pkg/controller/provider/container/ovirt.(*Collector).load()\n\tpkg/controller/prov...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@liranr23 the response of the 'list' call should specify the URL of each disk AFAIR, what's the URL of the disk c467d491-2646-44f2-bd5c-f4bff1c3186b
there?
@liranr23 it looks good overall! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@liranr23 I thought you said the changes to the 'rego' files don't seem to work - so this PR is not up-to-date in this area, right?
8086926
to
9b556c5
Compare
This patch will collect the data from oVirt provider regarding direct LUNs and populate the inventory. Signed-off-by: Liran Rotenberg <lrotenbe@redhat.com>
This patch will allow importing direct LUNs from oVirt provider to kubeVirt. The attached direct LUNs will be created in the destination cluster. It will be connected to the VM as PVC and a PV which contains the relevant direct LUN details. Only on late oVirt version the API provides the relevant details. Therefore, older version can not perform this flow. The storage should be exposed to the destination environment. Signed-off-by: Liran Rotenberg <lrotenbe@redhat.com>
Signed-off-by: Liran Rotenberg <lrotenbe@redhat.com>
When failing to get the VM from the inventory to detach its LUN disks. Signed-off-by: Arik Hadas <ahadas@redhat.com>
And improve the comment that describes it. Signed-off-by: Arik Hadas <ahadas@redhat.com>
Signed-off-by: Arik Hadas <ahadas@redhat.com>
Signed-off-by: Arik Hadas <ahadas@redhat.com>
Signed-off-by: Arik Hadas <ahadas@redhat.com>
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the open threads can be resolved separately
This patch will allow importing direct LUNs from oVirt provider to
kubeVirt. The attached direct LUNs will be created in the destination
cluster. It will be connected to the VM as PVC and a PV which contains
the relevant direct LUN details.
Only on late oVirt version the API provides the relevant details.
Therefore, older version can not perform this flow.
The storage should be exposed to the destination environment.