Problem with using API Delete VM

zpopovski

New Member
Feb 1, 2023
6
0
1
Hi,

I am trying to delete a VM using API DELETE /nodes/{node-name}/qemu/{vm-id} with AUTHORIZATION Token in the header but i am receiving all the time null as response instead of task UPID and the VM is not deleted. Did i miss something?

Thanks
 
Hi, this sounds like the user/token you are using doesn't have the permission to delete the VM. You can check the HTTP response headers for more information. If you use curl, you can use the -i option:
Code:
$ curl -i 'https://.../api2/json/nodes/.../qemu/103' -X DELETE ...
HTTP/1.1 403 Permission check failed (/vms/103, VM.Allocate)
Cache-Control: max-age=0
...
And you can show the user/token permissions using pveum: https://pve.proxmox.com/pve-docs/chapter-pveum.html#_limited_api_token_for_monitoring
 

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!