You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After the VM is bootstrapped, I would like to remove the cloud-init drive from it. Another scenario is to update the user_data_file, which also cases a force replacement of the VM.
Both because user_data_file_id is touched.
To Reproduce
Steps to reproduce the behavior:
Create a resource proxmox_virtual_environment_file and proxmox_virtual_environment_vm which references the env file in initialization.user_data_file_id
Remove initialization {} or update proxmox_virtual_environment_file content
See VM force replacement
Please also provide a minimal Terraform configuration that reproduces the issue.
It's standard among Terraform providers to recreate a VM or instance when user data changes. To work around this, use ignore_changes in a lifecycle block to tell Terraform not to update your infrastructure when it sees that the cloud init has changed.
As for removing the cloud init drive completely, I'm less clear on the right approach here. On the one hand it's a user data change which should recreate the VM, but on the other hand, it's a drive and lots of drive operations can happen without recreating the VM. But given that the initialization block is more than just a drive, I'm of the opinion that removing that block completely signals a change to the initial state of that VM and recreating the VM is appropriate and consistent with the behavior of other Terraform providers.
If wrapping the whole initialization block in an ignore_changes block isn't sufficient and you really want to remove the cloud init drive, you could try using Terraform's removed block to remove it from state, and then remove the drive from Proxmox via some other means.
Describe the bug
After the VM is bootstrapped, I would like to remove the cloud-init drive from it. Another scenario is to update the user_data_file, which also cases a force replacement of the VM.
Both because
user_data_file_id
is touched.To Reproduce
Steps to reproduce the behavior:
proxmox_virtual_environment_file
andproxmox_virtual_environment_vm
which references the env file ininitialization.user_data_file_id
initialization {}
or updateproxmox_virtual_environment_file
contentPlease also provide a minimal Terraform configuration that reproduces the issue.
and the output of
terraform|tofu apply
.Expected behavior
cloud-init device is removed without replacing VM or cloud-init config is updated without replacing VM.
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: