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

Move disk fails in terraform, but succeeds in proxmox #1195

Open
lug-gh opened this issue Dec 3, 2024 · 0 comments
Open

Move disk fails in terraform, but succeeds in proxmox #1195

lug-gh opened this issue Dec 3, 2024 · 0 comments
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented resource/qemu Issue or PR related to Qemu resource type/bug

Comments

@lug-gh
Copy link

lug-gh commented Dec 3, 2024

v3.0.1-rc6

If you change the storage of a disk in terraform, the provider moves the disk.
A reboot is then executed (in my case, this could be because parameters such as “emulatessd” change). After the reboot, however, the provider wants to force a start, which fails with “VM already running”.

(bottom to top)
image

2:44:18 PM    # module.lug-lab-test-vm.proxmox_vm_qemu.vm will be updated in-place
2:44:18 PM    ~ resource "proxmox_vm_qemu" "vm" {
2:44:18 PM          id                     = "do-lab-pve2/qemu/100"
2:44:18 PM          name                   = "lug-lab-test-vm"
2:44:18 PM          tags                   = "ha;terraform"
2:44:18 PM          # (52 unchanged attributes hidden)
2:44:18 PM   
2:44:18 PM        ~ disks {
2:44:18 PM            ~ scsi {
2:44:18 PM                ~ scsi1 {
2:44:18 PM                    ~ disk {
2:44:18 PM                        ~ discard              = true -> false
2:44:18 PM                        ~ emulatessd           = true -> false
2:44:18 PM                        ~ format               = "raw" -> "qcow2"
2:44:18 PM                          id                   = 1
2:44:18 PM                        ~ storage              = "cephpool" -> "nas1"
2:44:18 PM                          # (20 unchanged attributes hidden)
2:44:18 PM                      }
2:44:18 PM                  }
2:44:18 PM   
2:44:18 PM                  # (1 unchanged block hidden)
2:44:18 PM              }
2:44:18 PM   
2:44:18 PM              # (1 unchanged block hidden)
2:44:18 PM          }
2:44:18 PM   
2:44:18 PM          # (3 unchanged blocks hidden)
2:44:18 PM      }
2:44:18 PM   
2:44:18 PM  Plan: 0 to add, 1 to change, 0 to destroy.
2:44:18 PM  module.lug-lab-test-vm.proxmox_vm_qemu.vm: Modifying... [id=do-lab-pve2/qemu/100]
2:44:28 PM  module.lug-lab-test-vm.proxmox_vm_qemu.vm: Still modifying... [id=do-lab-pve2/qemu/100, 10s elapsed]
2:44:38 PM  module.lug-lab-test-vm.proxmox_vm_qemu.vm: Still modifying... [id=do-lab-pve2/qemu/100, 20s elapsed]
2:44:48 PM  module.lug-lab-test-vm.proxmox_vm_qemu.vm: Still modifying... [id=do-lab-pve2/qemu/100, 30s elapsed]
2:44:58 PM  module.lug-lab-test-vm.proxmox_vm_qemu.vm: Still modifying... [id=do-lab-pve2/qemu/100, 40s elapsed]
2:45:08 PM  module.lug-lab-test-vm.proxmox_vm_qemu.vm: Still modifying... [id=do-lab-pve2/qemu/100, 50s elapsed]
2:45:18 PM  module.lug-lab-test-vm.proxmox_vm_qemu.vm: Still modifying... [id=do-lab-pve2/qemu/100, 1m0s elapsed]
2:45:28 PM  module.lug-lab-test-vm.proxmox_vm_qemu.vm: Still modifying... [id=do-lab-pve2/qemu/100, 1m10s elapsed]
2:45:38 PM  module.lug-lab-test-vm.proxmox_vm_qemu.vm: Still modifying... [id=do-lab-pve2/qemu/100, 1m20s elapsed]
2:45:48 PM  module.lug-lab-test-vm.proxmox_vm_qemu.vm: Still modifying... [id=do-lab-pve2/qemu/100, 1m30s elapsed]
2:45:58 PM  module.lug-lab-test-vm.proxmox_vm_qemu.vm: Still modifying... [id=do-lab-pve2/qemu/100, 1m40s elapsed]
2:46:00 PM  2024-12-03T13:46:00.503Z [ERROR] provider.terraform-provider-proxmox_v3.0.1-rc6: Response contains error diagnostic: tf_proto_version=5.6 tf_req_id=49b6de22-e169-eaa8-59a6-aab27c2626ae tf_resource_type=proxmox_vm_qemu tf_rpc=ApplyResourceChange diagnostic_severity=ERROR diagnostic_summary="VM 100 already running" tf_provider_addr=registry.terraform.io/telmate/proxmox @caller=github.com/hashicorp/[email protected]/tfprotov5/internal/diag/diagnostics.go:58 @module=sdk.proto diagnostic_detail="" timestamp=2024-12-03T13:46:00.503Z
2:46:00 PM  2024-12-03T13:46:00.523Z [ERROR] vertex "module.lug-lab-test-vm.proxmox_vm_qemu.vm" error: VM 100 already running
2:46:00 PM  ╷
2:46:00 PM  │ Error: VM 100 already running
2:46:00 PM  │ 
2:46:00 PM  │   with module.lug-lab-test-vm.proxmox_vm_qemu.vm,
2:46:00 PM  │   on module/vm_module.tf line 47, in resource "proxmox_vm_qemu" "vm":
2:46:00 PM  │   47: resource "proxmox_vm_qemu" "vm" {
2:46:00 PM  │ 
2:46:00 PM  ╵
2:46:00 PM  2024-12-03T13:46:00.535Z [ERROR] provider: error encountered while scanning stdout: error="read |0: file already closed"
2:46:00 PM  Running app failed: exit status 1
@Tinyblargon Tinyblargon added type/bug issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented resource/qemu Issue or PR related to Qemu resource labels Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented resource/qemu Issue or PR related to Qemu resource type/bug
Projects
None yet
Development

No branches or pull requests

2 participants