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

Allow blank networkID #787

Merged
merged 2 commits into from
Jun 14, 2019
Merged

Allow blank networkID #787

merged 2 commits into from
Jun 14, 2019

Conversation

MFiederlein
Copy link

Resolves #316 by allowing a blank network name. This occurs when cloning a template to another cluster where the distributed port group on the template does not exist.

@ghost ghost added the size/xs Relative Sizing: Extra-Small label Jun 13, 2019
@bill-rich
Copy link
Contributor

This looks like a good solution. The only thing I'd like to confirm is what the network is showing up as in the vSphere client? Is it blank, or does it still show the network from the original cluster?

@MFiederlein
Copy link
Author

MFiederlein commented Jun 14, 2019

Yes, in this scenario, the network name is blank in vSphere client. After this change, the provider comes along and happily sets the network properly after clone instead of erroring out.

Copy link
Contributor

@bill-rich bill-rich left a comment

Choose a reason for hiding this comment

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

Looks good! Thanks for getting this fix in!

@bill-rich bill-rich merged commit 9676e7d into hashicorp:master Jun 14, 2019
@chuanran
Copy link

@bill-rich @MFiederlein as far as I understand, this is just a workaround to make sure clone can work for cross-cluster, however, it cannot finish the post-clone actions like network configuration, etc, and it is not helpful from automation perspective.

Basically we need terraform to support cross-cluster vms' cloning and post-clone actions . Thoughts and any plans to make sure terraform has this ability?

@chuanran
Copy link

thoughts on above comments pls? @bill-rich @MFiederlein

@MFiederlein
Copy link
Author

@chuanran cross-cluster template cloning and post-clone actions (setting network config etc) seem to be working OK for me after this merge. e.g. I can configure a network, and it is set properly post-clone.
My specific issue was down to the fact that the host I was provisioning on did not have the network available that was configured in the template, therefore would produce an error and fail. This PR caters for that scenario by allowing a blank network name (I believe that's what vSphere will do in that scenario anyway when cloning to a host that does not have a template's network). After it's cloned, the provider changes the network properly.

@chuanran
Copy link

chuanran commented Jan 8, 2020

@MFiederlein I got what you meant now. when you clone a vm in vsphere/vcsa manually, you can assign the network adapter name, and finally the vm can be cloned to the target cluster right? but terraform vsphere plugin cannot work well for this scenario. you can assign it as empty for the networkID,but it could not configure the network adapter and ip address, netmask, gateway etc. those network config successfully and automatically.

@chuanran
Copy link

chuanran commented Jan 8, 2020

cc @bill-rich

@DmitryZakharov
Copy link

Can somebody point an example how it is supposed to work ? Where do you specify blank network name ?

@ghost
Copy link

ghost commented Apr 18, 2020

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

@ghost ghost locked and limited conversation to collaborators Apr 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
size/xs Relative Sizing: Extra-Small
Projects
None yet
Development

Successfully merging this pull request may close these issues.

clone from template - network_interface.0: ServerFaultCode: The object or item referred to could not be found
5 participants