-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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 must be PowerOn to destroy #7168
Labels
Comments
dkalleg
added a commit
to hpcloud/terraform
that referenced
this issue
Jun 16, 2016
This patch adds a wait when powering on a vm so setupVirtualMachine does not return until the vm is actually powered on. This allows other functions to work off the assumption that the current state of the vm is not in flux. During resourceVSphereVirtualMachineRead(), the wait for IP would cause a hang for any VM with no network interfaces or for vms that had been powered off for any reason. This also means that the user could not delete a vm with no network interfaces or that is powered off. Checking power state before trying to check for network interfaces. Resolves hashicorp#7168
dkalleg
added a commit
to hpcloud/terraform
that referenced
this issue
Jun 20, 2016
This patch adds a wait when powering on a vm so setupVirtualMachine does not return until the vm is actually powered on. This allows other functions to work off the assumption that the current state of the vm is not in flux. During resourceVSphereVirtualMachineRead(), the wait for IP would cause a hang for any VM with no network interfaces or for vms that had been powered off for any reason. This also means that the user could not delete a vm with no network interfaces or that is powered off. Checking power state before trying to check for network interfaces. Resolves hashicorp#7168
dkalleg
added a commit
to hpcloud/terraform
that referenced
this issue
Jun 22, 2016
This patch adds a wait when powering on a vm so setupVirtualMachine does not return until the vm is actually powered on. This allows other functions to work off the assumption that the current state of the vm is not in flux. During resourceVSphereVirtualMachineRead(), the wait for IP would cause a hang for any VM with no network interfaces or for vms that had been powered off for any reason. This also means that the user could not delete a vm with no network interfaces or that is powered off. Checking power state before trying to check for network interfaces. Resolves hashicorp#7168
stack72
pushed a commit
that referenced
this issue
Jul 12, 2016
…#7206) This patch adds a wait when powering on a vm so setupVirtualMachine does not return until the vm is actually powered on. This allows other functions to work off the assumption that the current state of the vm is not in flux. During resourceVSphereVirtualMachineRead(), the wait for IP would cause a hang for any VM with no network interfaces or for vms that had been powered off for any reason. This also means that the user could not delete a vm with no network interfaces or that is powered off. Checking power state before trying to check for network interfaces. Resolves #7168
rachappag
pushed a commit
to rachi-tfproviders/vmware-vsphere
that referenced
this issue
Apr 20, 2017
… (#7206) This patch adds a wait when powering on a vm so setupVirtualMachine does not return until the vm is actually powered on. This allows other functions to work off the assumption that the current state of the vm is not in flux. During resourceVSphereVirtualMachineRead(), the wait for IP would cause a hang for any VM with no network interfaces or for vms that had been powered off for any reason. This also means that the user could not delete a vm with no network interfaces or that is powered off. Checking power state before trying to check for network interfaces. Resolves hashicorp/terraform#7168
grubernaut
pushed a commit
to hashicorp/terraform-provider-vsphere
that referenced
this issue
Jun 6, 2017
… (#7206) This patch adds a wait when powering on a vm so setupVirtualMachine does not return until the vm is actually powered on. This allows other functions to work off the assumption that the current state of the vm is not in flux. During resourceVSphereVirtualMachineRead(), the wait for IP would cause a hang for any VM with no network interfaces or for vms that had been powered off for any reason. This also means that the user could not delete a vm with no network interfaces or that is powered off. Checking power state before trying to check for network interfaces. Resolves hashicorp/terraform#7168
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. |
ghost
locked and limited conversation to collaborators
Apr 24, 2020
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi there,
There seems to be an issue with deleting a VM in vsphere if it's not powered on. There is logic in the 'get vm' code path that expects to find an IP. When a VM is not powered on, there is no IP available.
Terraform Version
2016/06/14 11:35:52 [INFO] Terraform version: 0.7.0 dev e7ce5a2
Affected Resource(s)
Debug Output
vsphere_virtual_machine.testdiskuuid: Refreshing state... (ID: vipul-testuuid) 2016/06/14 11:11:21 [DEBUG] plugin: terraform: vsphere-provider (internal) 2016/06/14 11:11:21 [DEBUG] virtual machine resource data: &schema.ResourceData{schema:map[string]*schema.Schema{"folder":(*schema.Schema)(0xc820379ce0), "linked_clone":(*schema.Schema)(0xc82037a380), "gateway":(*schema.Schema)(0xc82037a460), "custom_configuration_parameters":(*schema.Schema)(0xc82037aa80), "vcpu":(*schema.Schema)(0xc820379dc0), "domain":(*schema.Schema)(0xc82037a540), "dns_suffixes":(*schema.Schema)(0xc82037a700), "windows_opt_config":(*schema.Schema)(0xc82037ab60), "network_interface":(*schema.Schema)(0xc82037ac40), "cdrom":(*schema.Schema)(0xc82037ae00), "memory":(*schema.Schema)(0xc820379ea0), "memory_reservation":(*schema.Schema)(0xc82037a000), "datacenter":(*schema.Schema)(0xc82037a0e0), "cluster":(*schema.Schema)(0xc82037a1c0), "resource_pool":(*schema.Schema)(0xc82037a2a0), "time_zone":(*schema.Schema)(0xc82037a620), "skip_customization":(*schema.Schema)(0xc82037a8c0), "enable_disk_uuid":(*schema.Schema)(0xc82037a9a0), "name":(*schema.Schema)(0xc820379c00), "dns_servers":(*schema.Schema)(0xc82037a7e0), "disk":(*schema.Schema)(0xc82037ad20)}, config:(*terraform.ResourceConfig)(nil), state:(*terraform.InstanceState)(0xc820260940), diff:(*terraform.InstanceDiff)(nil), meta:map[string]string(nil), multiReader:(*schema.MultiLevelFieldReader)(nil), setWriter:(*schema.MapFieldWriter)(nil), newState:(*terraform.InstanceState)(nil), partial:false, partialMap:map[string]struct {}(nil), once:sync.Once{m:sync.Mutex{state:0, sema:0x0}, done:0x0}, isNew:false} 2016/06/14 11:11:25 [DEBUG] vertex root, waiting for: provider.vsphere (close) 2016/06/14 11:11:26 [DEBUG] vertex provider.vsphere (close), waiting for: vsphere_virtual_machine.testdiskuuid 2016/06/14 11:11:30 [DEBUG] vertex root, waiting for: provider.vsphere (close) 2016/06/14 11:11:31 [DEBUG] vertex provider.vsphere (close), waiting for: vsphere_virtual_machine.testdiskuuid 2016/06/14 11:11:35 [DEBUG] vertex root, waiting for: provider.vsphere (close) 2016/06/14 11:11:36 [DEBUG] vertex provider.vsphere (close), waiting for: vsphere_virtual_machine.testdiskuuid 2016/06/14 11:11:40 [DEBUG] vertex root, waiting for: provider.vsphere (close) 2016/06/14 11:11:41 [DEBUG] vertex provider.vsphere (close), waiting for: vsphere_virtual_machine.testdiskuuid 2016/06/14 11:11:45 [DEBUG] vertex root, waiting for: provider.vsphere (close) 2016/06/14 11:11:46 [DEBUG] vertex provider.vsphere (close), waiting for: vsphere_virtual_machine.testdiskuuid 2016/06/14 11:11:50 [DEBUG] vertex root, waiting for: provider.vsphere (close) 2016/06/14 11:11:51 [DEBUG] vertex provider.vsphere (close), waiting for: vsphere_virtual_machine.testdiskuuid 2016/06/14 11:11:55 [DEBUG] vertex root, waiting for: provider.vsphere (close)
Expected Behavior
running a
terraform destroy
when a VM is powered off, should not wait for IP, and clean up the VM.Actual Behavior
Terraform spins forever waiting for an IP from the node.
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
terraform apply
with a vsphere_virtual_machine resourceterraform destroy
The text was updated successfully, but these errors were encountered: