terraform-provider-proxmox icon indicating copy to clipboard operation
terraform-provider-proxmox copied to clipboard

timeout while waiting for VM "7001" configuration to become unlocked

Open intelline opened this issue 3 years ago • 4 comments

Problem:

  • I get timeout while waiting for VM "7001" configuration to become unlocked while cloning a template

Error: proxmox_virtual_environment_vm.vm-test-debian: Still creating... [13m30s elapsed] proxmox_virtual_environment_vm.vm-test-debian: Still creating... [13m40s elapsed] proxmox_virtual_environment_vm.vm-test-debian: Still creating... [13m50s elapsed] 2022-10-12T10:01:44.827+0300 [ERROR] provider.terraform-provider-proxmox_v0.6.2: Response contains error diagnostic: tf_provider_addr=registry.terraform.io/example-namespace/example tf_resource_type=proxmox_virtual_environment_vm @caller=github.com/hashicorp/[email protected]/tfprotov5/internal/diag/diagnostics.go:55 diagnostic_detail= diagnostic_severity=ERROR diagnostic_summary="timeout while waiting for VM "7001" configuration to become unlocked" tf_proto_version=5.3 tf_req_id=46a764bd-ee63-bfa4-d7d7-7f63685c30d4 tf_rpc=ApplyResourceChange @module=sdk.proto timestamp=2022-10-12T10:01:44.826+0300 2022-10-12T10:01:44.854+0300 [ERROR] vertex "proxmox_virtual_environment_vm.vm-test-debian" error: timeout while waiting for VM "7001" configuration to become unlocked ╷ │ Error: timeout while waiting for VM "7001" configuration to become unlocked │ │ with proxmox_virtual_environment_vm.vm-test-debian, │ on main.tf line 46, in resource "proxmox_virtual_environment_vm" "vm-test-debian": │ 46: resource "proxmox_virtual_environment_vm" "vm-test-debian" { │

How to replicate: ` terraform { required_providers { proxmox = { source = "bpg/proxmox" version = "0.6.2" } } }

provider "proxmox" { virtual_environment { endpoint = "https://XXXXXXX:8006" username = "xxxxx@pve" password = "xxxx" insecure = true } } resource "proxmox_virtual_environment_vm" "vm-test-debian" { name = "terraform-vm1" description = "Managed by Terraform"

node_name = "XX-node1" vm_id = 7001

clone { node_name = "XX-node1" vm_id = 8000 datastore_id = "slow" } }`

intelline avatar Oct 12 '22 07:10 intelline

I'm seeing similar timeouts time to time as well. I would say the provider is sensitive to increased IO delays on the PVE node, for example, if underlying storage is HDD rather than SDD. Quite annoying, but I wasn't able to pinpoint the issue so far.

bpg avatar Oct 17 '22 03:10 bpg

@intelline, you may have an issue connecting with the qemu agent on the cloned VM. Please make sure the agent is enabled on the source vm (8000), and also check the status of the cloned VM (7001) in PVE after you've got an error from terraform apply -- it should show the agent as enabled, and you should also see the VM's IP address: Screen Shot 2022-10-16 at 11 29 38 PM

Screen Shot 2022-10-16 at 11 29 52 PM

bpg avatar Oct 17 '22 03:10 bpg

I have the same timeout issue on some off my vm's, the common thing for those vm's are that they are k3s vm's with alot of networks. All are cloned from the same vm and those without k3s works like a charm. The only visible difference is that the network list contains also the CNI networks for k3s.

IO Should not be a problem here since i run this on a SSD and the overall io is pretty low

Maybe not the same issue?

xonvanetta avatar Oct 17 '22 08:10 xonvanetta

Maybe not the same issue?

Not sure... this particular error seems to be coming from https://github.com/bpg/terraform-provider-proxmox/blob/v0.6.2/proxmoxtf/resource_virtual_environment_vm.go#L1162 Which indicates that PVE didn't mark the VM as "ready" after 5min. Which support my previous suggestion that this could be related to some sort of resource constrains during the clone operation.

@intelline If the issue is reproducible, could you check in what state the cloned VM is in the PVE UI, right after you received the TF error?

bpg avatar Oct 20 '22 21:10 bpg

Marking this issue as stale due to inactivity in the past 180 days. This helps us focus on the active issues. If this issue is reproducible with the latest version of the provider, please comment. If this issue receives no comments in the next 30 days it will automatically be closed. If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you!

github-actions[bot] avatar Apr 19 '23 00:04 github-actions[bot]