-
Notifications
You must be signed in to change notification settings - Fork 452
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
I can't import a machine with a clone block in it #333
Comments
+1 |
@djhaskin987 and @almoore, this is currently intended behaviour. Importing does not populate the There have been some offline requests to change this behaviour and I can see the value in not duplicating your configs, as such I will mark this as an enhancement to see if we can find a better way. The challenge lies in the complexity of the structure of |
This means that either I can import all my VMs, or I can clone them, but I can't do both. I can't tell Terraform how to make a new VM and also tell Terraform that a previously created one exists. I understand that this is a complicated task and the vsphere soap api doesn't make it easier, but I can't really use this provider (or pitch it to the ops team) if I don't have the assurance that I can import resources while also being able to recreate them. I appreciate your taking time and marking it an enhancement :) |
@djhaskin987 to be fair, this is more of a TF issue than it is a vSphere issue. 🙂 I have some ideas around how this can be implemented, so it might be reasonable to see this in 1.2.0 or 1.3.0 in the new year. Stay tuned! |
"not duplicating your configs" - does that mean there's a workaround involving using a few extra config blocks? If so, I welcome it and would happily use it instead. Is there such a workaround? Also, Thanks! |
@djhaskin987 yeah, importing those VMs with a config that doesn't have the What I would do (personally, not saying this applies to your org) is just run the current projects out of a different config repo for now, maybe using a variation of your Even further, if you are managing all of this with a module, it might just be as easy as forking the module for now, switching to that one, and then switching back either when you need to re-deploy those VMs (at that point, you should be able to taint the resources with So sorta more config, and sorta less config. 🙂 But if you can deal with the divergence for now, it should work for you. |
Hey all, We just released 1.4.0 which lifts the import and legacy upgrade restrictions on the |
Terraform Version
vSphere Provider Version
Affected Resource(s)
vsphere_virtual_machine
Configuration File and Steps to Reproduce
Basically, I have a
vsphere_virtual_machine
block that has aclone
block in it.I do a
terraform state rm <virtual-machine-object>
and reimport it.Finally, I run a
terraform plan
. I get an error message generated by this line of code.Expected Behavior
It should say "nothing to do" on the terraform plan
Actual Behavior
It errors, saying I can't have a clone block
Comments
The error message says I must either delete the
clone
block from config or not import machines. But if I delete the clone block, I can't make new ones if I need them.I can't use terraform to import machines and then manage them afterwards.
The text was updated successfully, but these errors were encountered: