After installing Terraform and GO. I want to talk with my Hyper-v server for deploying some VMs.
I used this provider: https://github.com/taliesins/terraform-provider-hyperv.git
How to Install the Hyperv provider:
1 2 3 4 |
mkdir -p $env:GOPATH/src/github.com/taliesins; cd $env:GOPATH/src/github.com/taliesins git clone https://github.com/taliesins/terraform-provider-hyperv.git cd $env:GOPATH/src/github.com/taliesins/terraform-provider-hyperv go build |
Now there is a file created: terraform-provider-hyperv.exe
After a terraform init you get the following message.
“A provider named “hyperv” could not be found in the Terraform Registry.”
This is because the custom provider is not installed in your default plugin directory.
The Windows default plugin directory is located in the following location: (C:\Users\YOURUSERNAME\AppData\Roaming\terraform.d\plugins\windows_amd64)
With PowerShell:
1 |
mkdir -p C:\Users\$($env:USERname)\AppData\Roaming\terraform.d\plugins\windows_amd64 |
Copy the (terraform-provider-hyperv.exe) file you created with the go build in the plugin folder.
Now navigate to your cloned git directory \ examples \ basic and do a terraform init.