【问题标题】:terraform init vsphere provider - Failed to query available provider packages vmsphereterraform init vsphere provider - 无法查询可用的提供程序包 vmsphere
【发布时间】:2021-07-26 05:05:15
【问题描述】:

在 Mac OS 上通过 brew 安装 terraform v1.0.3

这是我第一次将 Terraform 与“vshpere”提供程序一起使用。当我对我的计划执行 terraform init 时,我收到以下错误。

provider "vsphere" {
  user           = var.vsphere_user
  password       = var.vsphere_password
  vsphere_server = var.vsphere_server
}

module "exa_v30_01" {
  source           = "../modules/vm"
  vsphere_user     = var.vsphere_user
  vsphere_password = var.vsphere_password
  template_name    = var.template_name
  vm_name          = var.vm_name
}

$ terraform init
Initializing modules...

Initializing the backend...

Initializing provider plugins...
- Finding latest version of hashicorp/vsphere...
- Finding latest version of hashicorp/vmsphere...
- Installing hashicorp/vsphere v2.0.2...
- Installed hashicorp/vsphere v2.0.2 (signed by HashiCorp)
╷
│ Error: Failed to query available provider packages
│ 
│ Could not retrieve the list of available versions for provider
│ hashicorp/vmsphere: provider registry registry.terraform.io does
│ not have a provider named registry.terraform.io/hashicorp/vmsphere
│ 
│ All modules should specify their required_providers so that
│ external consumers will get the correct providers when using a
│ module. To see which modules are currently depending on
│ hashicorp/vmsphere, run the following command:
│     terraform providers
╵

$ terraform providers

Providers required by configuration:
.
├── provider[registry.terraform.io/hashicorp/vsphere]
└── module.exa_v30_01
    ├── provider[registry.terraform.io/hashicorp/vsphere]
    └── provider[registry.terraform.io/hashicorp/vmsphere]

我该如何解决这个问题?我在这里用谷歌搜索和搜索,但没有与 VSphpere 相关的内容。有什么线索吗?谢谢

更新:

我看到了Force Terraform to install providers from local disk only, disabling Terraform Registry,但那是为了升级 terraform 版本。

【问题讨论】:

    标签: terraform terraform-provider-vsphere


    【解决方案1】:

    错误信息是正确的。有 not provider 称为vmsphere。也许您想要vsphere 提供者?您的模块 exa_v30_01 似乎在某处使用了错误的提供程序。

    【讨论】:

    • 对我说。我的vm 模块中有一个拼写错误,要求vmsphere。谢谢!
    猜你喜欢
    • 2022-08-09
    • 1970-01-01
    • 1970-01-01
    • 2021-08-26
    • 1970-01-01
    • 2020-10-17
    • 1970-01-01
    • 2021-07-07
    • 2021-12-28
    相关资源
    最近更新 更多