-
Notifications
You must be signed in to change notification settings - Fork 453
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: Network fixes #181
Conversation
Along with 1f4c85f, this corrects a couple of issues and adds tests for one that we can test for: Fixes #165, which was an issue where network searches in govmomi were not working for networks with unescaped slashes in their names. We also have a test for this now as well where we reproduce by adding a host-level portgroup, which the API does not escape slashes for. Fixes #161, which was an issue with network searches where panics could happen on trying to load a network backed by a 3rd party hardware DVS. The latest govmomi has commits that properly use base types for the respective items.
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.
A couple of minor comments - but this otherwise LGTM :)
os.Getenv("VSPHERE_IPV4_GATEWAY"), | ||
os.Getenv("VSPHERE_DATASTORE"), | ||
os.Getenv("VSPHERE_TEMPLATE"), | ||
os.Getenv("VSPHERE_USE_LINKED_CLONE"), |
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.
minor/not a blocker feels like this lot would make a nice test helper object
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, things are getting a little ridiculous here 😉
Definitely could be something we could assemble into an object, although I'm a little resistant to the idea of breaking the variable configuration off, which is kind of what this would do, as right now all config fixtures are pretty easy to read and look like real Terraform config rather than chunks, which was a problem with this test code before (in a different way, though, one that made a lot less sense than what would be accomplished with a proper test fixture generator. 🙂 )
iops = 500 | ||
} | ||
|
||
depends_on = ["vsphere_host_port_group.pg"] |
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'd have thought this should be implied by network_interface.0.label
being set to "${vsphere_host_port_group.pg.0.name}"
?
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.
We wait on all resources here because while we are only referencing the first resource for the network name, the VM could be created on any of the three hosts, hence it's important to ensure that the network is available on all three before proceeding with creation of the VM.
Thanks for the review @tombuildsstuff! Merging now |
An update of govmomi corrects a couple of recent issues with handling networks in
vsphere_virtual_machine
:Fixes #165, which was an issue where network searches in govmomi were
not working for networks with unescaped slashes in their names. We also
have a test for this now as well where we reproduce by adding a
host-level portgroup, which the API does not escape slashes for.
Fixes #161, which was an issue with network searches where panics could
happen on trying to load a network backed by a 3rd party hardware DVS.
The latest govmomi has commits that properly use base types for the
respective items.