Skip to content

Fixes "failed to create VM instance" error#44

Merged
k8s-ci-robot merged 2 commits intokubernetes-sigs:mainfrom
davidvossel:reconcile-tests-1
Dec 17, 2021
Merged

Fixes "failed to create VM instance" error#44
k8s-ci-robot merged 2 commits intokubernetes-sigs:mainfrom
davidvossel:reconcile-tests-1

Conversation

@davidvossel
Copy link
Copy Markdown
Contributor

This PR introduces two changes.

  • Adds unit tests to exercise reconcileNormal() behavior
  • fixes race condition in kubevirt machine controller that causes reconcile error immediately after VM creation

I noticed quite a few failed to create VM instance errors in the logs and found a race condition in our VM creation logic. If we attempt to get a VM's VMI immediately after VM creation, there's a very high chance that get will fail. This is because the VM controller has not had enough time to react to the created VM and create the corresponding VMI object.

We don't actually need to check to see if the VMI has been created immediately after the VM is created. Now that the machine controller is checking the IsReady() function, we'll naturally wait (re-enqueue) the VMI to get recreated before proceeding with the rest of the controllers logic.

This pr also introduces some unit tests to verify we re-enqueue after VM creation.

NONE

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Dec 13, 2021
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Dec 13, 2021
Signed-off-by: David Vossel <davidvossel@gmail.com>
…ation

Signed-off-by: David Vossel <davidvossel@gmail.com>
@agradouski
Copy link
Copy Markdown
Contributor

thanks for the fix @davidvossel !

/approve
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 17, 2021
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: agradouski, davidvossel

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 17, 2021
@k8s-ci-robot k8s-ci-robot merged commit 2b9a3bd into kubernetes-sigs:main Dec 17, 2021
nunnatsa pushed a commit to nunnatsa/cluster-api-provider-kubevirt that referenced this pull request Mar 29, 2023
…ream_2023-01-23-20-55

Auto sync upstream 2023 01 23 20 55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants