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: Network fixes #181

Merged
merged 2 commits into from
Sep 29, 2017
Merged

r/virtual_machine: Network fixes #181

merged 2 commits into from
Sep 29, 2017

Conversation

vancluever
Copy link
Contributor

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.

This adds in a few fixes:

* Network searching issues when "/" is present in a network name
escaped (#165)
* Use of a network backed by a 3rd party hardware DVS (#161)
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.
@vancluever vancluever added bug Type: Bug crash Impact: Crash dependencies Type: Dependencies labels Sep 29, 2017
Copy link

@tombuildsstuff tombuildsstuff left a 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"),

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

Copy link
Contributor Author

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"]

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}"?

Copy link
Contributor Author

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.

@vancluever
Copy link
Contributor Author

Thanks for the review @tombuildsstuff! Merging now

@vancluever vancluever merged commit bbce292 into master Sep 29, 2017
@vancluever vancluever deleted the b-vm-network-fixes branch October 12, 2017 00:30
@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
bug Type: Bug crash Impact: Crash dependencies Type: Dependencies
Projects
None yet
2 participants