Terraform VCDプロバイダを使用してvmware vclouddirector 10で仮想マシンを作成しようとしています。
バージョン
terraform {
required_providers {
vcd = {
source = "vmware/vcd"
version = "3.0.0"
}
}
}
主なコード:
resource "vcd_vapp" "vms" {
name = "apatsev-vapp"
power_on = "true"
}
resource "vcd_vapp_vm" "vm1" {
vapp_name = "apatsev_vm"
name = "apatsev1"
catalog_name = "CentOS"
template_name = "CentOS7_64-bit"
memory = 2048
cpus = 2
cpu_cores = 1
depends_on = [vcd_vapp.vms]
}
間違い:
Error: error finding vApp: [ENF] entity not found
on main.tf line 28, in resource "vcd_vapp_vm" "vm1":
28: resource "vcd_vapp_vm" "vm1" {
エラーを修正する方法は?
答え1
作業コード:
resource "vcd_vapp" "vms" {
name = "apatsev-vapp"
power_on = "true"
}
resource "vcd_vapp_vm" "vm1" {
vapp_name = vcd_vapp.vms.name
name = "apatsev1"
catalog_name = "CentOS"
template_name = "CentOS7_64-bit"
memory = 2048
cpus = 2
cpu_cores = 1
depends_on = [vcd_vapp.vms]
}