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

vmware_guest speedup module #2278

Conversation

GuideGlyph
Copy link
Contributor

SUMMARY

Speedup network search while creating VM using vmware_guest.

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

vmware_guest.py

ADDITIONAL INFORMATION

vmware_guest network search is slow. It use find_obj() from vmware.py that loop through all objects trying to find correct. I have a lag for 5 mins trying. PyVmomi.network_exists_by_name works much faster.

@GuideGlyph GuideGlyph changed the title vmware_guest speedup vmware_guest speedup module Dec 24, 2024
@GuideGlyph
Copy link
Contributor Author

also curios why Clone task

                    task = vm_obj.Clone(folder=destfolder, name=self.params['name'], spec=clonespec)

dont have self.wait_for_task(task) line like CreateVM_Task or ReconfigVM_Task.
After debugging customize_advanced_settings function (not successfully sadly) I get incorrect facts = self.gather_facts(vm_obj) couple of times because it didnt have time enough to get it correct (i guess)

@GuideGlyph
Copy link
Contributor Author

TODO: also add find_network_by_name function to

                if nic.device.deviceInfo.summary != network_name:
                    if 'DVSwitch' not in nic.device.deviceInfo.summary:
                        nic.device.deviceInfo.summary = network_name
                        nic_change_detected = True
                    else:

@GuideGlyph
Copy link
Contributor Author

Recheck

@mariolenz
Copy link
Collaborator

I'm sorry, I didn't find much time to work on this collection during the last weeks. I hope I'm able to review this PR soon.

Copy link
Collaborator

@mariolenz mariolenz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GuideGlyph Please a changelog fragment. Maybe something like

changelogs/fragments/2278-vmware_guest.yml:

minor_changes:
  - vmware_guest - Speedup network search
    (https://github.com/ansible-collections/community.vmware/pull/2278).

@GuideGlyph
Copy link
Contributor Author

@mariolenz ready

Copy link
Collaborator

@mariolenz mariolenz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @GuideGlyph!

I'm not 100% sure that I understand your changes. But if this speeds up things for you and the CI is happy 🤷

FYI I'm planing to do a new release within the next few days, possibly next weekend.

@GuideGlyph
Copy link
Contributor Author

GuideGlyph commented Jan 21, 2025

Thanks @GuideGlyph!

I'm not 100% sure that I understand your changes. But if this speeds up things for you and the CI is happy 🤷

FYI I'm planing to do a new release within the next few days, possibly next weekend.

Thanks for review!
If someone is interested why it works some info here
#2277 (comment)

@mariolenz
Copy link
Collaborator

Thanks for the additional info @GuideGlyph! I'd have merged this already yesterday, but somehow our CI/CD didn't want me to. I'll give it another try now :-)

Copy link

Build succeeded (gate pipeline).
https://ansible.softwarefactory-project.io/zuul/buildset/587b486e8bd94d08be9c5706885e1e31

✔️ ansible-tox-linters SUCCESS in 5m 23s
✔️ build-ansible-collection SUCCESS in 6m 01s
✔️ ansible-galaxy-importer SUCCESS in 4m 24s

@softwarefactory-project-zuul softwarefactory-project-zuul bot merged commit fa95487 into ansible-collections:main Jan 21, 2025
23 checks passed
@GuideGlyph GuideGlyph deleted the vmware_guest-speedup branch January 21, 2025 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants