-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
Use more recent version of govmomi #13366
Comments
I am seeing this exact same issue with our vSphere 6.5 environment. We have network labels that have a "/" in the name, and it won't work with the included version of govc. Thanks for posting this, caseyaedwards! |
I believe I've found the same issue with folders. |
Sorry, I think I made a mistake. I patched govmomi myself with a crappy fix; regex matching the way we name our vswitches: #.#.#.#/## (basically ipaddr / cidr) and then manually piecing it back together if it matches. Then I forgot that I did that and rebuilt govc/terraform thinking that it was fixed because I was building off of govmomi 0.14. I will upload my patched version of govmomi. I believe this will fix your issue @Defilan although you may need to adjust the regex slightly to match your vswitch naming scheme. I don't think it will fix your issue though @madrover since the regex needs to be specific enough to not match anything except the final object. From looking at the govmomi source I don't think there's an easy way to fix this since it does a simple path.split or a strings.split on '/'. I don't know Go very well though so I'm hoping I'm wrong and that there's an easy way to fix it. I'll look into opening a more detailed ticket in the govmomi repo with my findings. |
Not super happy with this fix but it works for us: |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Terraform Version
Terraform v0.9.3-dev
Affected Resource(s)
Expected Behavior
vSphere provider works and creates a VM that has a network adapter which has a label with a slash in the name.
Actual Behavior
Fails saying unable to find network since the version of govmomi being used splits across forward slashes and only returns the last section. This means if you have a network label with a slash in it such as IP/CIDR, it will only return the CIDR.
Steps to Reproduce
It's easiest to use govc directly since it will produce the same outcome as Terraform. Here's an example between working and nonworking versions.
govc version
govc 0.13.0
govc vm.network.change -net "v123 4.5.6.7/28" -vm "somevm.domain.com" ethernet-0
govc: network 'v123 4.5.6.7/28' not found
govc version
govc 0.14.0
govc vm.network.change -net "v123 4.5.6.7/28" -vm "somevm.domain.com" ethernet-0
(no output, completed successfully)
Important Factoids
Using slashes in network labels
References
The text was updated successfully, but these errors were encountered: