When creating a new VM on vSphere, Terraform is able to clone the template successfully and create a new VM. However, after the VM is created, Terraform attempts to query the Virtual Disk Profile associated with the new VM, and receives a NoPermission response. After this failure, Terraform automatically deletes the VM in order to revert to initial state.
- Terraform Console
- Terraform Request
- vSphere Response
I have been unable to find a way to stop Terraform from performing this query after the clone has been successfully completed, and I’ve also been unable to stop Terraform from performing the post-failure deletion of the VM it had just created.
During troubleshooting with the vSphere administrator, we gave the StorageProfile.View permission to our Terraform vSphere account group, but we’re still receiving the error. Related community/Github posts mention that Profile-driven storage permissions may need to be given at the root level, which isn’t possible in our environment.
Are there any workarounds to skip the disk modification Terraform performs after cloning from template? I’d like to just keep the same disk structure that the template possesses, and modifying the disk post-clone shouldn’t be necessary.
Any thoughts or ideas you might have would be greatly appreciated!