Issue with Proxmox API Returning Success for Failed VM Cloning Requests

tommy0099

New Member
Aug 17, 2024
2
0
1
Hello Proxmox team,

First, thank you for the great product!
I am encountering an issue when using the Proxmox API in my C# application with the Corsinvest.ProxmoxVE.Api library. Specifically, when I send multiple requests to clone a VM (e.g., cloning 20 VMs simultaneously), the API returns a success message for all requests, even when there are errors on the web server side.
For example, I receive a success response even when the server encounters an error like:
"create full clone of drive ide0 (local-lvm:vm-588-disk-0)
trying to acquire lock...
TASK ERROR: clone failed: can't lock file '/var/lock/pve-manager/pve-storage-local-lvm' - got timeout"

I have tried using the async await functions as well as the WaitForTaskToFinishAsync function in my code, but in both cases, the server still responds with a success message, implying that the VM was cloned successfully even though it wasn’t.
Is there a way to accurately detect such errors when using the Proxmox API, or am I missing something in the implementation?
Thank you for your attention!
 
Not a dev, but I'm suspecting the "success" responds is more-so for "successfully started the task (you have the permissions for it)" instead of "I'm fully done with this task that could take somewhere between a few seconds to a few hours to complete, so thank you for keeping this line open all the time". ;)
One way to see the results/logs for the task would probably be to check the task itself from either something like [1] and/or [2] or just by querying the state of the VM who's ID you set as your clone-target ID (and maybe check for the lock-status for example) [3].

[1] https://pve.proxmox.com/pve-docs/api-viewer/index.html#/nodes/{node}/tasks
[2] https://pve.proxmox.com/pve-docs/api-viewer/index.html#/nodes/{node}/tasks/{upid}/status
[3] https://pve.proxmox.com/pve-docs/api-viewer/index.html#/nodes/{node}/qemu/{vmid}/status/current
 
Not a dev, but I'm suspecting the "success" responds is more-so for "successfully started the task (you have the permissions for it)" instead of "I'm fully done with this task that could take somewhere between a few seconds to a few hours to complete, so thank you for keeping this line open all the time". ;)
One way to see the results/logs for the task would probably be to check the task itself from either something like [1] and/or [2] or just by querying the state of the VM who's ID you set as your clone-target ID (and maybe check for the lock-status for example) [3].

[1] https://pve.proxmox.com/pve-docs/api-viewer/index.html#/nodes/{node}/tasks
[2] https://pve.proxmox.com/pve-docs/api-viewer/index.html#/nodes/{node}/tasks/{upid}/status
[3] https://pve.proxmox.com/pve-docs/api-viewer/index.html#/nodes/{node}/qemu/{vmid}/status/current
Thank you for your response. I understand that the "success" response might indicate that the task has been successfully started. However, I believe this design might not be optimal for API users because it forces me to continuously poll the task status from the logs, which could be resource-intensive.

Given that the API provides asynchronous methods like WaitForTaskToFinishAsync, I would expect the connection to remain open until the task is fully completed, and then return the final status. Is there any way to directly obtain the final task status when initiating it, even if it requires waiting for an extended period?
 
However, I believe this design might not be optimal for API users because it forces me to continuously poll the task status from the logs, which could be resource-intensive.
Feel free to file a well described and argued enhancement request here: https://bugzilla.proxmox.com
You may want to read through this: https://bugzilla.proxmox.com/show_bug.cgi?id=3931

Good luck


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 
  • Like
Reactions: tommy0099

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!