New with terraform in opennebula

Hi all,
First thanks a lot for reading this email I’m completely new with terraform and I was trying to install the opennebula official provider to test how it works. I have created a small example but when I tried to execute terraform init appears:
Initializing provider plugins…

  • Finding latest version of hashicorp/opennebula…
  • Finding latest version of hashicorp/template…
  • Installing hashicorp/template v2.2.0…
  • Installed hashicorp/template v2.2.0 (signed by HashiCorp)

    │ Error: Failed to query available provider packages

    │ Could not retrieve the list of available versions for provider hashicorp/opennebula: provider registry
    registry.terraform.io does not have a provider named registry.terraform.io/hashicorp/opennebula

    │ Did you intend to use opennebula/opennebula? If so, you must specify that source address in each module which requires
    │ that provider. To see which mo…

I have store my terraform-provider-opennebula in /usr/local/bin and set in my home the .terraformrc with the content:
providers {
opennebula = “/usr/local/bin/terraform-provider-opennebula”
}

Can someone please tell me what im doing wrong? Seems like it is not using the provider i have set and tried to find it in hashicorp. Am I right ?

Thanks again
Francisco

1 Like

Hi @Gliese,

Are you using some modified version of the provider? If not, could you just try to use the following configuration (as suggested in the provider page):

terraform {
  required_providers {
    opennebula = {
      source = "OpenNebula/opennebula"
      version = "0.3.0"
    }
  }
}

provider "opennebula" {
  # Configuration options
}

Hi,
Thanks for your answer. No, I’m using the official one. And I have already check with that configuration and didn’t work.
Here is my .terraformrc

terraform {
required_providers {
opennebula = {
source = “OpenNebula/opennebula”
version = “0.3.0”
}
}
}

provider “opennebula” {
opennebula = “/usr/local/bin/terraform-provider-opennebula”
}

As you can see is the standard one.

Cheers,
F.

HI! I found the error. The file was wrong because the provider was called two times. Now it works :slight_smile:

Thanks.