Closed ghost closed 5 years ago
@ybaumy the error says that
"error instantiating a new VM: API Error: 400: [ ... ] There is already a VM named \"cust1_mgmt_vm_lx_1\"."}
Are you sure your environment doesn't have any remnants from previous setup (of which the state file has been lost)? Could you try removing everything and starting from empty?
actually that is what i did. rm -f statefile + backup terraform plan terraform init
and I made sure none of the resources were still in the vOrg created.
So it should have been a clean state. That is why I am wondering why this happens.
@lvirbalas i found on the vcd gui an error that is strange.. at least for me.
Recomposed Virtual Application 'mmig-vcloud-providers-testspace' (9ee97503-6089-43a6-930c-72ba801d0ade)
[ b78c21aa-0414-473b-8206-af2e4cb724fd ] Unable to perform this action. Contact your cloud administrator.
This is the error probably why it fails. It just does not say so in the terraform trace output.
I think I found the issue, fix on the way.
Fix in https://github.com/vmware/go-vcloud-director/pull/150 . When this one will be merged, terraform can be updated too.
@vbauzysvmware Just talked to the vCloud Engineer. He provided me another error message.
`[ b78c21aa-0414-473b-8206-af2e4cb724fd ] The operation is not supported on the object.
So it seems that some API call to the VM is wrong?
Yes it is,constructing API call happens one issue, which is solved in PR.
Additional note from my investigation: with current configuration vapp creation won't use network name - it will create raw vApp with only name, all other configuration details ignored. Current implementation expects template_name
and catalog_name
to be provided, and then all other vApp properties will be used.
@vbauzysvmware Ok. But I am using template_name + catalog_name in the resource defintion. So sorry but I do not understand what should be wrong here.
resource "vcd_vapp_vm" "my_vm00" { depends_on = ["vcd_vapp.mmigvapp00"] vapp_name = "${var.vcd_vapp_name}" network_name = "${var.vcdnet_name}" power_on = false name = "${var.vmnamelinux}" catalog_name = "${var.catalognamelinux}" template_name = "${var.templatenamelinux}"
But I can tell you what was wrong in the code. The "ip = x.x.x.x" attribute was missing, since we have to use static_ip_pool and not dhcp.
I rerun the terraform apply and provided an IP address in the vcd_vapp_vm statement block but I am getting the same error.
I was talking about vcd_vapp
resource.
Did you use code from PR I mentioned? Binary update will happen with new release only. In reality it's just one line change in vapp.go
Fix come around and in terraform-providers:vmware-stash-while-master-pr-open until merged to master
2.1.0 version released with the fix. Let me us know it it's good now :)
Sorry for getting back to you that late. But I could not test earlier. Currently I am having the problem that my VM cannot be created anymore.
Terraform v0.11.10
Terraform Version
Terraform v0.11.10
Affected Resource(s)
Please list the resources as a list, for example: vcd_vapp_vm.my_vm00
Terraform Configuration Files
Debug Output
https://gist.github.com/ybaumy/a1fcab843ab3901b2fde871bc9a1a1de
Panic Output
Expected Behavior
VM should have been created but it isn't completely. Then the uploaded ISO file should be attached to the VM
Actual Behavior
That is what i want to know. Am I missing something.
Steps to Reproduce
terraform plan + apply
Important Factoids
I dont know the vCloud Version. Would have to ask.
References