How to get the status of Proxmox API?

kotakomputer

Renowned Member
May 14, 2012
429
13
83
Jakarta, Indonesia
www.proxmoxindo.com
I run this PHP code for $vmid = 101
Code:
$result = $pve2->post("/nodes/$svr_hostname/$svr_virt/$vmid/status/start");
The result is:
Code:
UPID:dsi-094117:000471B3:058A929A:5207DFD9:qmstart:101:root@pam:

I need to get the same result provided by Proxmox Web UI:
- When VMID 101 is not started then Proxmox Web UI says: OK
- When VMID 101 was already started then Proxmox Web UI says: ERROR: VM 101 already running

Any idea? Or should I check the node status before perform $pve2->post ?
What does the "000471B3:058A929A:5207DFD9" mean?
 
What does the "000471B3:058A929A:5207DFD9" mean?

Some commands can take a long time to finish, so the are started as background task. The
returned string 'UPID:dsi-094117:000471B3:058A929A:5207DFD9:qmstart:101:root@pam:'
is an unique identifier for that task, and can be used to query further info.

# pvesh get nodes/<NODE>/tasks/<UPID>/status
# pvesh get nodes/<NODE>/tasks/<UPID>/log
 

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!