0
votes

I am trying to create the VM in VmWare Vcloud data center using terraform VCD provider. here is the entire code for that

what i have done

provider "vcd" {
  user                 = "abc"
  password             = "xyz"
  org                  = "I1250-Se"
  vdc                  = "I1250-Se"
  url                  = "https://nlu02.abc.com/api"
  max_retry_timeout    = "30"
  allow_unverified_ssl = "true"
}

resource "vcd_vapp" "web" {
  name = "web"
  power_on = "true"
}

data "vcd_vapp" "web" {
  name             = "web"
  org              = "I1250-Se"
}

data "vcd_catalog_item" "my-cat-item" {
  org  = "I1250-Se"
  name = data.vcd_catalog.my-cat.name
  catalog = data.vcd_catalog.my-cat.name
}

data "vcd_catalog" "my-cat" {
  org  = ""
  name = "ID120_ISO"
}


resource "vcd_vapp_vm" "web1" {
  vapp_name     = data.vcd_vapp.web.name
  name          = var.vmname
  catalog_name  = "ID120_ISO"
  template_name = ""
  memory        = 2048
  cpus          = 2
  cpu_cores     = 1
}

what is the error

vcd_vapp_vm.web1: Creating...

Error: error finding catalog: [ENF] entity not found

on main.tf line 33, in resource "vcd_vapp_vm" "web1": 33: resource "vcd_vapp_vm" "web1" {

environment

Terraform v0.12.18

OS :

Linux jenvm 4.4.0-142-generic #168-Ubuntu SMP Wed Jan 16 21:00:45 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

what is expected

the script should accept the catalog name (which is already exist) and create the VM. another point to be noted is that , the catalog name which i am referring does not contain nay VApp template, so not sure how it will behave. what i am expecting is , it should accept the catalog name and use the media (ISO image) to install the OS on the newly created VM through terraform.

please suggest.

1
please suggest. this is critical and blocker for us - user2315104

1 Answers

0
votes

currently such feature where creating VM without Vapp template is being scrutinized. catalog name should contain the VApp template , ISO image can not be considered as catalog name.

So in order to resolve this issue, upload the valid OVA file as VApp template and use in the code. Thanks