[pve-devel] Fwd: qm changes
Nicholas Schembri
nicholas.a.schembri at bamboofields.net
Wed Feb 28 18:47:45 CET 2018
All of the command line tools are using the api; we can us pvesh to talk
about the issue.
I'm thinking that we should not search all nodes looking for the vm. I'm
not sure how the gui build the virtual machine list but I'm thinking it
might be nice to have the same thing at the nodes level in the api.
in this example I need to know the source node:
pvesh create nodes/<source node>/qemu/<VMID>/migrate --target <target node>
How about :
pvesh ls nodes/qemu # list all vmid in the cluster
pvesh create nodes/qemu/1000/status/start
pvesh create nodes/qemu/1000/status/stop
pvesh get nodes/qemu/1000/status/current # this is missing the node, but
in the current api it's part of the path
pvesh get nodes/qemu/1000/status/node # add get node
or
# long listing
pvesh ls -l nodes/qemu/
Dr--d 10 red
Dr--d 1000 blue
Dr--d 110 green
Dr--d 111 red
Dr--d 112 red
Dr--d 113 red
Dr--d 120 blue
Dr--d 121 blue
Dr--d 122 green
Dr--d 123 red
Dr--d 200 blue
so from the little looking i've done, I should be looking in Nodes.pm,
/usr/share/perl5/PVE/API2/usr/share/perl5/PVE/API2
to add a list of all vm's to the nodes dir?
or is this something that found in the base /usr/share/perl5/PVE/Cluster.pm,
Qemu.pm, LXC.pm, QemuServer.pm
can you just point me to a good starting place?
On Mon, Feb 26, 2018 at 1:42 AM, Wolfgang Link <w.link at proxmox.com> wrote:
> Hi Nicholas,
>
> you can do this over the API.
> If you like to do this in a bash script you can use "pvesh" [1].
>
> pvesh create nodes/<source node>/qemu/<VMID>/migrate --target <target node>
>
> Here [2] can you see the full API tree.
>
> [1]: https://pve.proxmox.com/wiki/Proxmox_VE_API#Using_.27pvesh.
> 27_to_access_the_API
> [2]: https://pve.proxmox.com/pve-docs/api-viewer/index.html
>
> Best Regards,
>
> Wolfgang Link
>
> w.link at proxmox.com
> http://www.proxmox.com
>
> ____________________________________________________________________
> Proxmox Server Solutions GmbH
> Bräuhausgasse 37, 1050 Vienna, Austria
> Commercial register no.: FN 258879 f
> Registration office: Handelsgericht Wien
>
>
--
Thank you for your time,
Nicholas A. Schembri
337 Brookside blvd.
Pittsburgh pa 15241
734-678-6435
More information about the pve-devel
mailing list