Skip to content
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

Add a wait phase for snapshot tasks #1267

Merged
merged 1 commit into from
Dec 13, 2024
Merged

Add a wait phase for snapshot tasks #1267

merged 1 commit into from
Dec 13, 2024

Conversation

mnecas
Copy link
Member

@mnecas mnecas commented Dec 13, 2024

Issue:
The main problem of the MTV-1753 and MTV-1775 is that we are either not waiting for the VMware task to finish or if we are waiting we are halting the whole controller process. This causes either performance issues or even migration failures. So we need to add a mechanism to wait for the tasks without halting the whole process.

Fix:
My first attempt was in PR #1262 which used the event manager. This on the surface was an easy approach which did not require any additional changes to the CR. The problem there was that some of the tasks were not reported to the taskManager. These tasks had a prefix haTask. After some investigation, I found out that these tasks are directly on the ESXi host and not sent to the vspehre, so we can't use the taskManager.
So the snapshot creation is separated into two separate phases create and wait for the task. Because of this we need to pass the task information to the CRD so the other phase can check it.

This PR adds the taskIds to the status CR so additional wait phases can monitor the tasks. The main controller will get the ESXi client and create a property collector to request the specific task from the host.

Ref:

Issue:
The main problem of the MTV-1753 and MTV-1775 is that we are either not
waiting for the VMware task to finish or if we are waiting we are halting
the whole controller process. This causes either performance issues or
even migration failures. So we need to add a mechanism to wait for the
tasks without halting the whole process.

Fix:
My first attempt was in PR kubev2v#1262 which used the event manager. This on
the surface was an easy approach which did not require any additional changes
to the CR. The problem there was that some of the tasks were not
reported to the taskManager. These tasks had a prefix haTask. After some
investigation, I found out that these tasks are directly on the ESXi host
and not sent to the vspehre, so we can't use the taskManager.

This PR adds the taskIds to the status CR so additional wait phases can
monitor the tasks. The main controller will get the ESXi client and
create a property collector to request the specific task from the host.

Ref:
- https://issues.redhat.com/browse/MTV-1753
- https://issues.redhat.com/browse/MTV-1775
- kubev2v#1262
- kubev2v#1265

Signed-off-by: Martin Necas <[email protected]>
Copy link

sonarcloud bot commented Dec 13, 2024

@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 0% with 114 lines in your changes missing coverage. Please review.

Project coverage is 15.49%. Comparing base (3929eaf) to head (e2c3e0a).

Files with missing lines Patch % Lines
pkg/controller/plan/adapter/vsphere/client.go 0.00% 77 Missing ⚠️
pkg/controller/plan/migration.go 0.00% 20 Missing ⚠️
pkg/controller/plan/adapter/ovirt/client.go 0.00% 7 Missing ⚠️
pkg/controller/plan/adapter/openstack/client.go 0.00% 5 Missing ⚠️
pkg/controller/plan/adapter/ova/client.go 0.00% 5 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1267      +/-   ##
==========================================
- Coverage   15.53%   15.49%   -0.04%     
==========================================
  Files         112      112              
  Lines       23262    23321      +59     
==========================================
  Hits         3613     3613              
- Misses      19364    19423      +59     
  Partials      285      285              
Flag Coverage Δ
unittests 15.49% <0.00%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mnecas mnecas added this to the 2.7.7 milestone Dec 13, 2024
@mnecas mnecas merged commit 58cfc3d into kubev2v:main Dec 13, 2024
16 checks passed
@mnecas mnecas mentioned this pull request Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants