Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vsphere_virtual_machine.vm: error sending customization spec: fault.NicSettingMismatch.summary #592

Closed
ghost opened this issue Aug 20, 2018 · 1 comment

Comments

@ghost
Copy link

ghost commented Aug 20, 2018

This issue was originally opened by @whiggs as hashicorp/terraform#18717. It was migrated here as a result of the provider split. The original body of the issue is below.


Ok. So I am confused. The title of this issue reflects the error that I am currently receiving when attempting to clone a vm from a template. Based on the research that I have done, this is not a new issue (see references at bottom), but these various issues have been closed as resolved. I found that a merge was performed into the Master branch to address this issue, so I am dumbfounded as to why I am still getting the error:

vsphere_virtual_machine.vm: error sending customization spec: fault.NicSettingMismatch.summary

Based on what I have read, the issue used to occur due to the fact that terraform requires that a network adapter be configured and added to the vm being created, which would generate the error due to the fact the vm would always have one additional nic than the number of nics originally present in the template. Apparently, terraform was updated in such a way that, when terraform clones a vm, terrraform will first removes all of the nics from the vm being cloned so that it can then add them back using the configurations in the terraform file. So, once again, dumbfounded as to why I am getting this error, as the terrafrom configuration file that I am using is almost completely copied from the vsphere provider "vsphere_virtual_machine resource" template provided for cloning a vm:
https://www.terraform.io/docs/providers/vsphere/r/virtual_machine.html

Terraform Version

Terraform v0.11.8

vSphere Provider Version

  • provider.vsphere v1.6.0

Affected Resource(s)

  • vsphere_virtual_machine

Terraform Configuration Files

	provider "vsphere" {
	user           = "user"
	password       = "password"
	vsphere_server = "vcenter-test.domain.com"

  # If you have a self-signed cert
	allow_unverified_ssl = true
}

	data "vsphere_datacenter" "dc" {
	name = "Test Environment"
}

	data "vsphere_datastore" "datastore" {
	name          = "NFS_CDOTSAS_Busintellocal"
	datacenter_id = "${data.vsphere_datacenter.dc.id}"
}

	data "vsphere_compute_cluster" "compute_cluster" {
	name          = "Test Environment"
	datacenter_id = "${data.vsphere_datacenter.dc.id}"
}

	data "vsphere_network" "network" {
	name          = "Production"
	datacenter_id = "${data.vsphere_datacenter.dc.id}"
}

	data "vsphere_virtual_machine" "template" {
		name	= "Templates/vagrbase"
		datacenter_id = "${data.vsphere_datacenter.dc.id}"
}

	resource "vsphere_virtual_machine" "vm" {
	name             = "terraform-test"
	folder			 = "B.Local/Hyperion"
	resource_pool_id = "${data.vsphere_compute_cluster.compute_cluster.resource_pool_id}"
	datastore_id     = "${data.vsphere_datastore.datastore.id}"

	num_cpus = 4
	memory   = 12288
	guest_id = "${data.vsphere_virtual_machine.template.guest_id}"

	scsi_type = "${data.vsphere_virtual_machine.template.scsi_type}"

	network_interface {
    network_id   = "${data.vsphere_network.network.id}"
    adapter_type = "${data.vsphere_virtual_machine.template.network_interface_types[0]}"
  }

  disk {
    label            = "disk0"
    size             = "${data.vsphere_virtual_machine.template.disks.0.size}"
    eagerly_scrub    = "${data.vsphere_virtual_machine.template.disks.0.eagerly_scrub}"
    thin_provisioned = "${data.vsphere_virtual_machine.template.disks.0.thin_provisioned}"
  }
  clone {
  template_uuid = "${data.vsphere_virtual_machine.template.id}"
  customize {
	windows_options {
		computer_name  = "terraform-test"
		admin_password = "password"
	        join_domain = "domain.com"
		domain_admin_user = "Domain\\user"
		domain_admin_password = "password" #"${data.vault_generic_secret.vmware.data["password"]}"
	}
  }
}
}

Debug Output

https://gist.github.com/whiggs/4f6ae08aa2fbbe68f41cd9da68aab339

Expected Behavior

The vm should be created in vsphere

Actual Behavior

the vm resource was not created with the below logged error:
vsphere_virtual_machine.vm: error sending customization spec: fault.NicSettingMismatch.summary

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform apply

Important Factoids

vsphere vCenter Server Version 5.5.0

References

hashicorp/terraform#3559
hashicorp/terraform#3560
hashicorp/terraform#3624
hashicorp/terraform#3652

@bill-rich
Copy link
Contributor

bill-rich commented Aug 20, 2018

Duplicate of #590.

@ghost ghost locked and limited conversation to collaborators Apr 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant