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

r/virtual_machine: Switch ContainerView search to use manual filter #391

Merged
merged 2 commits into from
Feb 7, 2018

Conversation

vancluever
Copy link
Contributor

There seems like there is possibly a bug in RetrieveWithFilter when it
comes to MO's with missing keys and the function returning a false
positive for the object in question. This has caused issues with the VM
search functionality where duplicate UUID errors will be returned for
VMs with UUIDs that are otherwise unique within vSphere inventory if
there are orphaned VMs in inventory that lack a configuration (as in the
whole config data object is missing).

This bug applies to the provider when being used with vSphere 6.0 and
earlier.

There seems like there is possibly a bug in RetrieveWithFilter when it
comes to MO's with missing keys and the function returning a false
positive for the object in question. This has caused issues with the VM
search functionality where duplicate UUID errors will be returned for
VMs with UUIDs that are otherwise unique within vSphere inventory if
there are orphaned VMs in inventory that lack a configuration (as in the
whole config data object is missing).

This bug applies to the provider when being used with vSphere 6.0 and
earlier.
@vancluever vancluever added the regression Impact: Regression label Feb 6, 2018
@vancluever vancluever requested a review from a team February 6, 2018 18:44
@vancluever
Copy link
Contributor Author

Ref: #382

@johnjelinek and anyone else having this issue can you give this fix a shot?

Thanks!

@den-is
Copy link

den-is commented Feb 6, 2018

@vancluever just tell how to test it? I don't know

@vancluever
Copy link
Contributor Author

vancluever commented Feb 6, 2018

Hey @den-is, you will want to follow the instructions here. Make sure you switch to the b-vm-containerview-search branch first before you build (git checkout b-vm-containerview-search after cloning).

@johnjelinek
Copy link

@vancluever: I get the same error from this version

@johnjelinek
Copy link

nvm, I was forgetting a step to push in the new binary. Works on my machine 😄 ! It's slow though:

time terraform plan   
17.59s user 1.60s system 75% cpu 25.555 total

@vancluever
Copy link
Contributor Author

Great! Glad that it works!

Just making one more change - would you be able to test it? It's a speed improvement. :)

This actually results in a significant speedup. We only grab the UUID,
versus the entire VM MO, as we always get the rest of the VM through
other helpers.
@vancluever
Copy link
Contributor Author

vancluever commented Feb 6, 2018

@johnjelinek if you can check the latest commit here, that would be great!

I actually tested the different searches on the vcsim with 1000 VMs and there definitely was a slowdown when all properties were being retrieved. Since we only need the UUID to check it, we can skip the rest, which brings it back closer to near RetrieveWithFitler speeds.

@johnjelinek
Copy link

much better, thanks!

time terraform plan
1.57s user 0.68s system 24% cpu 9.320 total

@vancluever
Copy link
Contributor Author

Awesome! Merging now 👍

@vancluever vancluever merged commit d0386dc into master Feb 7, 2018
@vancluever vancluever deleted the b-vm-containerview-search branch February 13, 2018 15:57
@ghost ghost locked and limited conversation to collaborators Apr 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
regression Impact: Regression
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants