Libvirt provider in Terraform v0.13

Hi All.

I am new to terraform and I am trying to deploy KVM using terraform.

Terraform version :
Terraform v0.13.0

OS: Ubuntu 18.04

I am facing the below issue when running the terraform init command.

Initializing the backend…

Initializing provider plugins…

  • Using previously-installed hashicorp/template v2.1.2
  • Finding latest version of hashicorp/libvirt…

Error: Failed to install provider

Error while installing hashicorp/libvirt: provider registry
registry.terraform.io does not have a provider named
registry.terraform.io/hashicorp/libvirt

Following the steps in link below

https://fabianlee.org/2020/02/22/kvm-terraform-and-cloud-init-to-create-local-kvm-resources/

Copied the below file to the plugin folder and I am facing an error as above.
https://github.com/dmacvicar/terraform-provider-libvirt/releases/download/v0.6.1/terraform-provider-libvirt-0.6.1+git.1578064534.db13b678.Ubuntu_18.04.amd64.tar.gz

Please guide me on how to proceed to resolve this error.

Thanks in Advance!

Terraform 0.13 has a new filesystem layout for in-house providers like this one. Please see this section of the upgrade guide for instructions on how to install your provider. Hope this helps!

Hi @terrarakshasa,

In addition to what @alisdair said, since you are new to Terraform I wanted to give you a little more context, because the upgrade guide is written under the assumption that you’ll be familiar with Terraform v0.12.

Terraform v0.13 has introduced a new mechanism for distributing providers that allows third-party providers like this libvirt provider to be, in theory at least, distributed via the Terraform Registry and thus automatically installed by terraform init.

Unfortunately, that means that the guide you were following by Fabian Lee is no longer suitable for Terraform v0.13. The libvirt provider isn’t available for automatic installation yet, and I expect there will be some technical challenges in publishing this particular provider on the Terraform Registry due to some unique challenges with its design, so you will still need to manually install it but the manual installation procedure will be different than what Fabian described.

To help those who are trying to use this provider with Terraform v0.13 until the provider is available on the registry, I wrote some instructions for installing the libvirt provider under Terraform v0.13 in a comment in the libvirt provider repository. The instructions I wrote there would replace the “Install libvirt provider plugin” section of Fabien’s tutorial, but I think the rest of it should still work.

I hope that helps! Sorry for the rough edges while we’re transitioning to a new provider installation approach.

Hi @apparentlymart @alisdair

Thanks for your reply. I tried the instructions in the article and it worked well. I was able to create the KVM using Terraform now.

Thanks a lot once again for your guidance on this issue.