VM delete via API

I

Igor_K

Guest
Hello everyone!
I want to delete VM via API.
As I can see, there is an optional parameter:


> root@{my_node}:~# pvesh help /nodes/{my_node}/qemu/{vmid} -v
> USAGE: delete /nodes/{node}/qemu/{vmid} [OPTIONS]
> Destroy the vm (also delete all used/owned volumes).
>
> -skiplock boolean
>
> Ignore locks - only root is allowed to use this option.


I run in cmd as below, but something is wrong:


> root@{my_node}:~# pvesh delete /nodes/{my_node}/qemu/{vmid} --skiplock=true
> usage: delete [path]


I also try like this:


> pvesh delete /nodes/{my_node}/qemu/{vmid} -skiplock=true
> pvesh delete /nodes/{my_node}/qemu/{vmid} --skiplock=1
> pvesh delete /nodes/{my_node}/qemu/{vmid} -skiplock=1


Is it my error? Maybe, it is an error in API-documentation or in delete command?


PS
pve:/> get version
200 OK
{
"release" : "20",
"repoid" : "0428106c",
"version" : "3.0"
}
 
That is simply a bug in pvesh. The API itself is fully functional -test with:

# qm delete <vmid> --skiplock
 

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!