Closed scluff closed 2 years ago
I am having the same issue. More precisely I try to deploy virtual ESXi hosts. Used the script available at https://www.virtuallyghetto.com/2020/06/full-ova-ovf-property-support-coming-to-terraform-provider-for-vsphere.html
I am using the vsphere v1.24.2 plugin, terraform 0.13.4.
I am having the same issue. More precisely I try to deploy virtual ESXi hosts. Used the script available at https://www.virtuallyghetto.com/2020/06/full-ova-ovf-property-support-coming-to-terraform-provider-for-vsphere.html
I am using the vsphere v1.24.2 plugin, terraform 0.13.4.
I just downgraded the plugin version to v1.24.0. This seems to work like expected!
DiffSuppressFunc
removed from them get deleted after the OVF has been cloned because they aren't declared in the TF code. I noticed this trying to deploy a nested ESXi appliance and discovering all of my network cards were gone after a reconfiguration that got kicked off after the deployment.I confirmed this locally. I pulled master and then ran git revert 649c894744ded10e22b14ac89bb2f881ac836c84
. With that done and compiled I am able to deploy the nested ESXi appliance as in v1.24.0.
@bill-rich Is #1218 working as intended? Should I need to have all of these different hardware elements declared in my resource when I am deploying an OVF?
@scluff -
Have you tested deploying the OVA with the latest
(e.g. v2.0.2) version of the provider?
See https://github.com/hashicorp/terraform-provider-vsphere/issues/1227#issuecomment-1005112446 for an example using the Nested_ESXi7.0u3_Appliance_Template_v1.ova
OVA image along with the vsphere_ovf_vm_template
data source.
Ryan
@scluff -
Have you tested deploying the OVA with the latest
(e.g. v2.0.2) version of the provider?
See https://github.com/hashicorp/terraform-provider-vsphere/issues/1227#issuecomment-1005112446 for an example using the Nested_ESXi7.0u3_Appliance_Template_v1.ova
OVA image along with the vsphere_ovf_vm_template
data source.
Ryan Johnson Staff II Solutions Architect, VMware, Inc.
Marking this issue as resolved based on the solution example provided in the previous comments (1) (2) with the example for deploying the Nested_ESXi7.0u3_Appliance_Template_v1.ova OVA image.
If the issue persists with the solution provided, the latest version of the provider, and the recommended use of the vsphere_ovf_vm_template
data source, please open a new issue and reference this issue for additional context.
Ryan Johnson Staff II Solutions Architect, VMware, Inc.
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Terraform Version
0.13.4
vSphere Provider Version
1.24.1
Affected Resource(s)
vsphere_virtual_machine
Terraform Configuration Files
variable "vsphere_user" { type = string description = "This is the username for vSphere API operations." }
variable "vsphere_password" { type = string description = "This is the password for vSphere API operations." }
variable "vsphere_server" { type = string description = "This is the vCenter server name for vSphere API operations." }
variable "vsphere_insecure" { type = bool description = "Boolean that can be set to true to disable SSL certificate verification. This should be used with care as it could allow an attacker to intercept your auth token." default = false }
variable "vsphere_datacenter" { type = string }
variable "vsphere_cluster" { type = string }
variable "vsphere_host" { type = string }
variable "vsphere_datastore" { type = string }
variable "vsphere_dvs" { type = string }
variable "network_grid" { type = string }
variable "network_admin" { type = string }
variable "network_client" { type = string }
provider "vsphere" { user = var.vsphere_user password = var.vsphere_password vsphere_server = var.vsphere_server allow_unverified_ssl = var.vsphere_insecure }
data "vsphere_datacenter" "datacenter" { name = var.vsphere_datacenter }
data "vsphere_resource_pool" "pool" { name = "${var.vsphere_cluster}/Resources" datacenter_id = data.vsphere_datacenter.datacenter.id }
data "vsphere_host" "host" { name = var.vsphere_host datacenter_id = data.vsphere_datacenter.datacenter.id }
data "vsphere_datastore" "datastore" { name = var.vsphere_datastore datacenter_id = data.vsphere_datacenter.datacenter.id }
data "vsphere_distributed_virtual_switch" "dvs" { name = var.vsphere_dvs datacenter_id = data.vsphere_datacenter.datacenter.id }
data "vsphere_network" "grid" { name = var.network_grid datacenter_id = data.vsphere_datacenter.datacenter.id distributed_virtual_switch_uuid = data.vsphere_distributed_virtual_switch.dvs.id }
data "vsphere_network" "admin" { name = var.network_admin datacenter_id = data.vsphere_datacenter.datacenter.id distributed_virtual_switch_uuid = data.vsphere_distributed_virtual_switch.dvs.id }
data "vsphere_network" "client" { name = var.network_client datacenter_id = data.vsphere_datacenter.datacenter.id distributed_virtual_switch_uuid = data.vsphere_distributed_virtual_switch.dvs.id }
resource "vsphere_virtual_machine" "primary-admin" { name = "sglab-primary-admin" datacenter_id = data.vsphere_datacenter.datacenter.id resource_pool_id = data.vsphere_resource_pool.pool.id host_system_id = data.vsphere_host.host.id datastore_id = data.vsphere_datastore.datastore.id wait_for_guest_net_timeout = 0 num_cpus = 8 memory_reservation = 0
ovf_deploy { local_ovf_path = "/home/scluff/StorageGRID-Webscale-11.4.0/vsphere/vsphere-primary-admin.ovf" disk_provisioning = "thin" ovf_network_map = { "Grid Network" = data.vsphere_network.grid.id "Admin Network" = data.vsphere_network.admin.id "Client Network" = data.vsphere_network.client.id } } lifecycle { ignore_changes = [ host_system_id ] } vapp { properties = { "GRID_NETWORK_GATEWAY" = "10.0.0.1" "GRID_NETWORK_IP" = "10.0.0.2" "GRID_NETWORK_MASK" = "255.255.255.0" "NODE_NAME" = "primary-admin" } } }
2020-10-15T17:36:14.063-0700 [DEBUG] plugin.terraform-provider-vsphere_v1.24.1_x4: panic: runtime error: index out of range [0] with length 0 2020-10-15T17:36:14.063-0700 [DEBUG] plugin.terraform-provider-vsphere_v1.24.1_x4: 2020-10-15T17:36:14.063-0700 [DEBUG] plugin.terraform-provider-vsphere_v1.24.1_x4: goroutine 52 [running]: 2020-10-15T17:36:14.063-0700 [DEBUG] plugin.terraform-provider-vsphere_v1.24.1_x4: github.com/hashicorp/terraform-provider-vsphere/vsphere/internal/virtualdevice.DiskPostCloneOperation(0xc000548f50, 0xc00049e010, 0xc000213100, 0x10, 0x10, 0x5, 0xc000663100, 0x5, 0x8, 0x5, ...) 2020-10-15T17:36:14.063-0700 [DEBUG] plugin.terraform-provider-vsphere_v1.24.1_x4: /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-vsphere/vsphere/internal/virtualdevice/virtual_machine_disk_subresource.go:1008 +0x23d7