-
Notifications
You must be signed in to change notification settings - Fork 452
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
VM is recreated after changing non-destructive resources #2267
Comments
Hello, svg-mn! 🖐 Thank you for submitting an issue for this provider. The issue will now enter into the issue lifecycle. If you want to contribute to this project, please review the contributing guidelines and information on submitting pull requests. |
i am not able to re-produce this, i have tested each setting one by one and get change for each, please provide info of output.
|
Marking as closed. Please open a new issue and reference #2267 is the problem persists. |
Community Guidelines
Terraform
1.9.6
Terraform Provider
2.9.2
VMware vSphere
8.0.2
Description
When using the vSphere Terraform provider, certain resource changes that should not require the destruction and recreation of the virtual machine (such as changing the VM name or adjusting CPU count) are causing the provider to unnecessarily destroy and recreate the VM. This behavior leads to service disruption and increased downtime, which is not expected for these types of changes.
Affected Resources or Data Sources
resource/vm
Terraform Configuration
resource "vsphere_virtual_machine" "example" {
name = "example-vm"
num_cpus = 2
memory = 4096
resource_pool_id = "resgroup-123"
datastore_id = "datastore-123"
network_interface {
network_id = "network-123"
adapter_type = "vmxnet3"
}
disk {
label = "disk0"
size = 50
}
}
Debug Output
I can't link the debug GitHub log since it's not connected to the internet
Panic Output
No response
Expected Behavior
Changes to non-destructive fields (like the VM name, CPU count) should be applied in place without triggering a VM destruction and recreation.
Actual Behavior
When modifying resources like the VM name or CPU count Terraform plans to destroy the existing VM and recreate a new one. These changes should instead be updated without needing to delete and recreate the virtual machine.
Steps to Reproduce
Deploy a VM using the vsphere_virtual_machine resource.
Change the name, CPU, or memory allocation in the Terraform configuration.
Run terraform plan and observe that it plans to destroy and recreate the VM instead of updating the resources in place.
Environment Details
No response
Screenshots
No response
References
No response
The text was updated successfully, but these errors were encountered: