Open skydion opened 4 years ago
@skydion - are you still seeing this issue?
The network_interface
should retain the ordering as they are a TypeList
.
Can you provide a redacted but reusable version of your configuration for reproduction?
Ryan
If an OVA has two or more networks, when deployed, potentially the wrong networks are assigned to the adapters. Confirmed with multiple provider versions including the latest 2.1.0.
Example OVA used - VMware Data Management for VMware Tanzu - DMS Provider OVA - dms-provider-va-1.1.0.1577-18978276.ova
Example code can be found here
In the below code, the wrong network labels are configured for the two networks mapped in my OVA file. When the VM is powered on, network connectivity cannot be made (ping), but if I go and manually edit the VM properties and change the VM networks around, the VM now responds to ping.
data "vsphere_ovf_vm_template" "ovf" {
name = "${var.name}"
resource_pool_id = "${var.resource_pool_id}"
datastore_id = "${data.vsphere_datastore.datastore.id}"
host_system_id = "${data.vsphere_host.host.id}"
local_ovf_path = "${var.local_ovf_path}"
ovf_network_map = {
"Management Network": "${data.vsphere_network.mgmt_network.id}"
"Control Plane Network": "${data.vsphere_network.control_plane_network.id}"
}
}
resource "vsphere_virtual_machine" "vm" {
name = "${var.name}"
num_cpus = 8
memory = 16384
resource_pool_id = "${var.resource_pool_id}"
datastore_id = "${data.vsphere_datastore.datastore.id}"
folder = "${var.folder}"
wait_for_guest_net_timeout = 0
wait_for_guest_ip_timeout = 0
datacenter_id = "${data.vsphere_datacenter.dc.id}"
host_system_id = "${data.vsphere_host.host.id}"
dynamic "network_interface" {
for_each = "${data.vsphere_ovf_vm_template.ovf.ovf_network_map}"
content {
network_id = network_interface.value
}
}
ovf_deploy {
ovf_network_map = "${data.vsphere_ovf_vm_template.ovf.ovf_network_map}"
local_ovf_path = "${data.vsphere_ovf_vm_template.ovf.local_ovf_path}"
disk_provisioning = "thin"
}
Terraform Version
Terraform v0.12.29
vSphere Provider Version
provider.vsphere v1.19.0
Affected Resource(s)
vsphere_virtual_machine
Terraform Configuration Files
Debug Output
Panic Output
Expected Behavior
I except than inside VM interfaces will have IP addresses like decribed in terraform output
Actual Behavior
But I have like this
Steps to Reproduce
Important Factoids
References
0000
Community Note