-
-
Notifications
You must be signed in to change notification settings - Fork 153
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
Terraform destroy of a VM is never finishing #1620
Comments
Hey @ckhordiasma 👋🏼 Do you have the qemu agent enabled for your VM? If yes, do you have it installed and enabled in the template? From the docs:
|
hi @bpg, thanks for the reply! I have agent.enabled set to false in my case. In particular I have (from https://github.com/kodama-labs/tf-proxmox/blob/master/vm/main.tf):
var.has_qemu_agent is set to false when my issue is occurring. |
I couldn't reproduce this issue in my environment. Here's the minimal configuration I used for testing: resource "proxmox_virtual_environment_vm" "ubuntu_vm" {
name = "test-ubuntu"
node_name = "pve"
# should be true if qemu agent is not installed / enabled on the VM
stop_on_destroy = true
initialization {
user_account {
# do not use this in production, configure your own ssh key instead!
username = "user"
password = "password"
}
}
disk {
datastore_id = "local-lvm"
file_id = proxmox_virtual_environment_download_file.ubuntu_cloud_image.id
interface = "virtio0"
iothread = true
discard = "on"
size = 20
}
}
resource "proxmox_virtual_environment_download_file" "ubuntu_cloud_image" {
content_type = "iso"
datastore_id = "local"
node_name = "pve"
url = "https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64.img"
} Output:
If the issue is still relevant to you, could you please share the |
Describe the bug
I have some VMs that get stuck on the "qmdestroy" task when I try to
terraform destroy
them. I have stop_on_destroy set to true (tried true/false with same results).To Reproduce
Create a VM resource (I am using a module I made: https://github.com/kodama-labs/tf-proxmox/tree/master/vm) and
terraform destroy
it. Terraform gets stuck on "still destroying", and proxmox stays stuck on qmdestroy of that task forever.Workaround
My workaround is to stop the qmdestroy task and then delete the VM from the proxmox web UI (or delete the vm conf file from the proxmox host)
Additional context
Proxmox output:
The text was updated successfully, but these errors were encountered: