簡體   English   中英

terraform init vsphere provider - 無法查詢可用的提供程序包 vmsphere

[英]terraform init vsphere provider - Failed to query available provider packages vmsphere

在 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 僅從本地磁盤安裝提供程序,禁用 Terraform Registry ,但那是為了 terraform 版本升級。

錯誤信息是正確的。 沒有名為vmsphere提供程序 也許您想要vsphere提供程序? 您的模塊exa_v30_01似乎在某處使用了錯誤的提供程序。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM